Skip to main content

Error 500 on the server for D365 finance and operations

While working on D365 finance and operations one fine day i came across the error 500.
There are many reasons for this server.
Below link can help you if encounter the same issue.

https://community.dynamics.com/ax/f/33/t/195422


If any of solutions does not work for you then you might need to check if there are any newly added objects through code and they might be causing the issue. Try to remove them build and synchronize them with the database.

https://community.dynamics.com/ax/b/axdilip/archive/2017/01/05/dynamics-365-for-operations-troubleshooting-http-500-httpcompileexception-error

To debug more you can use solution provided in below link.

https://www.linkedin.com/pulse/ax7-500-error-shashi-kant-yadav

In my case the issue was related to the certificate expiration. To check the expired certificate on the server we can go to "Certificate Management Console" and see the certificates expiration date.


To check this is power shell open "Windows PowerShell ISE".
Run below command to check the expired certificates.

Get-ChildItem -path Cert:\LocalMachine\My | Where {$_.NotAfter -lt $(get-date).AddMonths(2)} | Sort NotAfter | Format-Table Subject, Thumbprint, NotAfter

This will give you list of all the expired certificates.

Copy them with the "Thumbprint".

It should look like below.

CN=aadclient.erp.ppe.dynamics.com                                             F5A59257887670ED05BEBC5B7E8B554AC1A816B0 5/4/2018 5:10:48 AM
CN=encyrption.mds.dynaxprod.dynamics.com                                      BD1B21CAE0797ABBEC163957805EAB37609F60A4 5/4/2018 11:07:06 PM
CN="Vision Solutions, Inc.", O="Vision Solutions, Inc.", OU=Double-Take, C=US BEE1D98B6C2C048DA5A776D5BB4718687F881000 6/8/2018 11:15:34 AM
CN=DeploymentsOnebox.MRClientCertificate.pfx                                  6A8CFF863E0CE5A58EAE994BE969B992585717EC 6/23/2018 8:26:40 AM
CN=DeploymentsOnebox.SessionAuthenticationCertificate.pfx                     F79C64B7CD90911328818A2B10DF8BDA2736CC8E 6/23/2018 8:26:41 AM
CN=DeploymentsOnebox.DaxRunnerTokenUserCertificate.pfx                        46EAC9A6779284B5CC07613BFB8D908B96B006FA 6/23/2018 8:26:41 AM
CN=DeploymentsOnebox.LcsClientCertificate.pfx                                 6A95709C2E779E93CEFC60C005E4EE9C790A1FCD 6/23/2018 8:26:42 AM
CN=MicrosoftDynamicsAXDSCEncryptionCert                                       3CDB80BE641A55B243094F3294BA9495D86C1A0D 6/24/2018 3:39:23 PM

Now we need to generate new thumbprint to update the certificate.
To generate new thumbprint use below code in PowerShell.

Set-Location -Path "cert:\LocalMachine\My"
$OldCert = (Get-ChildItem -Path 6A8CFF863E0CE5A58EAE994BE969B992585717EC)
New-SelfSignedCertificate -CloneCert $OldCert -NotAfter (Get-Date).AddMonths(999)

This will generate new thumbprint.
Copy this new thumbprint.

Replace the thumbprint with existing one and repeat it for all the certificate.
Once all the thumbprints are generated we need to update it in "web.config","wif.config","wif.services.config" located in "C:\AOSService\webroot".

Once you update it.

Restart the "AOSService" in IIS.


Reference

https://community.dynamics.com/ax/b/axilitynet/archive/2018/03/27/fix-certificate-issues-on-development-machines

https://blogs.msdn.microsoft.com/lcs/2018/04/24/rotate-the-expired-or-nearly-expired-certificates-on-your-downloadable-vhd/

Happy daxing!!!

Comments

Post a Comment

Popular posts from this blog

A reference to 'Dynamics.AX.XXXXX, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module.

The error "A reference to 'Dynamics.AX.Directory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module." came on when i was building the project in visual studio. This error is thrown when the model is missing any reference which are needed to build the project. To update rectify this error we need to update the model. To do that go to "Dynamics 365 > Model Management > Update model parameter" A new window will open the model you want to update. Here i am selecting "Development" which i have created. Then click on next. On "Select referenced packages" select the missing packages which ones is throwing error. Here i have selected the "Directory" packages as they are the once throwing error. Select the packages. After selecting the packages click on "Next". And Click on "Finish". Rebuild the project and you are good to go.

D365 Month end and year end process

Period Closing Accounts Payable a.          Post invoices for all open/received purchase orders. b.          Post all pending invoices if received from Vendor. c.          Post and settle all payments. d.          Run Currency revaluation e.          Reconcile Vendor balance and trial balance for control accounts. f.           Set fiscal period on-hold for Vendor. Accounts Receivable a.          Post invoices for all open/delivered sales orders. b.          Post all pending free text invoices. c.          Post and settle all received payments. d.          Run Currency revaluation e.          Reconcile Vendor balance and trial balance for control accounts. f.           Set fiscal period on-hold for Customer. Cash and Bank a.          Perform Bank reconciliation b.          Set fiscal period on-hold for Bank. Procurement / Sales a.          Review and Close all open purchase/sales orders/Requisition if require. b.          Perform sort cl