AX 2012 SSRS Troubleshooting

Today I got the following message… “Could you just fix the reports on this AX 2012 environment… It is broken”

Then I tried to validate the report configuration I got the following error:

The SQL Server Reporting Services server name [servername] does not exist or the Web service URL is not valid.

OK… First test:

Can I browse to the report URLs in System Administration – Business Intelligence – Reporting Services – Report Servers.

No I could not, from the AX Server. it worked from the SQL Server so I checked the firewall on the SSRS Server and added port 80.

I still get the same issue when validating. So I opened the Microsoft Dynamics AX 2012 Management Shell as an administrator and ran Test-AXReportServerConfiguration

What… I opened the port and I can browse to the URLs. Apparently the as scripts tests for Remote Admin Ports so when I open those ports using this netsh command

netsh.exe firewall set service type=REMOTEADMIN mode=ENABLE scope=ALL

Presto!! The validation was successful!!


Links
Configure a Report Server for Remote Administration

Validating SSRS settings in AX 2012 fails

Tonight one of my colleagues called me having issues with validating the SSRS setup for an old AX 2012 R3 environment. Unfortunately it had been many years since I even touched a 2012 server which meant I had to turn to my trusted advisor… Google 🙂

The error he got was this:
“Make sure that SQL Server Reporting Services is configured correctly. Verify the Web Service URL and Report Manager URL configuration in the SQL Reporting Services Configuration Manager.”

Image

The problem is caused by UAC end there are 2 “solutons”

  1. Turning off UAT (which is absolutely NOT recommended).
    Error when validate settings in Report servers by any admin account which is not account used to install the AX reporting services extensions. – Microsoft Dynamics AX Forum Community Forum
  2. Running the AX client as Administrator. To do this right-click the AX 2012 Client (it has to be the client and not the .axc file) and slect “Run as Administrator”
    AX2012R2 SSRS Validation error as make sure the SQL Server Reporting Services is configured correctly – Microsoft Dynamics AX Community

That is it for today

SSRS using wrong configuration

Everything that is printed in AX 2012 is using SQL Server Reporting Services (SSRS). It does this by connecting to AX when it is told to and gets the data. To find the settings for the AX Server it normally uses the default client configuration. In some cases (especially when you have multiple instances) this fails or SSRS is using the wrong configuration.

You can help SSRS by saving the correct configuration in  C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer\bin with the name Microsoft.Dynamics.AX.ReportConfiguration.axc

Have a nice day

/Johan

Issues with Retail Layout designer

One of my colleagues had an issue accessing the Screen Layout designer in the AX Client and I was a bit confused… it worked for me… This turned out to be two separate issues.

image    image

The first one was that he and I was logged into two different AOSes and the Retail Headquarter was not installed on the one he was logged on to… simple enough to fix… I simply installed it. The Retail Headquarter component includes some DLLS that are required. If you want to be able to run the Retail Layout Designer on a  client or terminal server you will need to install the retail components on the client/terminal server as well.

When we installed the Headquarter components we unfortunately missed the fact the we “probably should” install Expression Blend Sad smile (note to self… read all the instructions)

image

When we tried to start the Designer it crashed with this error.

image

I found information on this issue on LCS Issue Search (Link below). The trick is to install Expression Blend Dev Kit for .NET and then copy Microsoft.Expression.Interactions.dll and System.Windows.Interactivity.dll from “C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries” to “C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin”

When these issues was fixed and my colleague tried to start the Button Grid Layout he gets this error:

SNAGHTML54766cd

Normally the AX AOS Service user is used to access the AX database but in some cases the individual user needs to have specific access… below is a link to an article that describes steps involved

 

Links
https://fix.lcs.dynamics.com/Issue/Solution/1223064?bugId=3725829&qc=dd5219a830d7a93c687ff03083b2970a6ae1775a018daa69b8be820ab77ae101

http://daxdude.blogspot.se/2013/02/ax-issue-method-start-in-com-object-of.html

The given value of type String from the data source cannot be converted to type nvarchar of the specified target column when syncing Retail Data to Channel Database

One of our customer are going to use the AX 2012 R3 Retail solution and the setup of the Async Server – Client in the TEST environment was setup and tested. The application consultants started importing the product data to AX and suddenly the sync stopped with this error:

Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.ProcessSourceRequestHeaderException: ProcessTargetRequestHeader failed due to an InvalidOperationException.connectionString: Data Source=XXXXXX;Initial Catalog=ClientChannelDB;Integrated Security=True;Connect Timeout=60;Application Name=”Commerce Data Exchange Async Client” —> System.InvalidOperationException: The given value of type String from the data source cannot be converted to type nvarchar of the specified target column. —> System.InvalidOperationException: String or binary data would be truncated.

After having a look online I found that there is no sync of the schema between the AX database and the Channel Database (!!!). This meant that when we imported data to AX everything worked but when we did the sync jobs it failed. The reason being that some field types did not match.

After talking to MS support I got a script to try to figure out which fields were wrong

select t1.table_name, t1.column_name, t1.character_maximum_length, t2.character_maximum_length
from MicrosoftDynamicsAX.INFORMATION_SCHEMA.columns t1
inner join RetailHoustonStore.INFORMATION_SCHEMA.columns t2
on t1.table_name = t2.table_name
and t1.column_name = t2.column_name
and t1.character_maximum_length != t2.character_maximum_length order by TABLE_NAME

this query finds all of the fields which are not matched between the AX database and the Channel Database. With some help we found that the issue probably was the field called RETAILVARIANTID which was present in INVENTDIMCOMBINATION and INVENTITEMBARCODE

We ran these SQL queries:

ALTER TABLE [ClientChannelDB].ax.INVENTDIMCOMBINATION ALTER COLUMN RETAILVARIANTID nvarchar(25) NOT NULL;
ALTER TABLE [ClientChannelDB].ax.INVENTITEMBARCODE ALTER COLUMN RETAILVARIANTID nvarchar(25) NOT NULL;

And there was also a view called INVENTDIMCOMBINATION which we scripted out to a query windows, deleted and recreated again. This solved the issue.

System.InvalidOperationException: The given value of type String from the data source cannot be converted to type datetime of the specified target column.

I had an issue today with the sync between Async Server and Client. Some of the jobs worked and some threw an error

Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.ProcessSourceRequestHeaderException: ProcessTargetRequestHeader failed due to an InvalidOperationException.
connectionString: Data Source=XXXXXXXX;Initial Catalog=ClientChannelDB;Integrated Security=True;Connect Timeout=60;Application Name=”Commerce Data Exchange Async Client” —> System.InvalidOperationException: The given value of type String from the data source cannot be converted to type datetime of the specified target column. —> System.FormatException: Failed to convert parameter value from a String to a DateTime. —> System.FormatException: String was not recognized as a valid DateTime.
   at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at System.Convert.ToDateTime(String value, IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming)
   — End of inner exception stack trace —
   at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming)
   at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
   — End of inner exception stack trace —
   at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
   at System.Data.SqlClient.SqlBulkCopy.ReadWriteColumnValueAsync(Int32 col)
   at System.Data.SqlClient.SqlBulkCopy.CopyColumnsAsync(Int32 col, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyRowsAsync(Int32 rowsSoFar, Int32 totalRows, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlWriteRequestRunner.BulkCopyData(SqlConnection connection, SqlTransaction transaction)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlWriteRequestRunner.Run(SqlConnection connection, SqlTransaction transaction)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlTargetRequestHandler.ProcessWriteRequest(SqlConnection connection, SqlTransaction transaction)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlTargetRequestHandler.ProcessTargetRequestHeader(ISCTargetRequestHeader targetRequestHeader)
   — End of inner exception stack trace —
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlTargetRequestHandler.ProcessTargetRequestHeader(ISCTargetRequestHeader targetRequestHeader)
   at Microsoft.Dynamics.Retail.SynchClient.Core.DownloadAgent.ApplySessionFileToClientDatabase(SessionManager sessionMgr, String fileName)

The error turned out to be a mismatch in the configuration of the Channel Data Group where I had set the force locale to EN-UK instead of EN-US and apprently there is a difference in the date format. After changeing this parameter everything worked again.

RetailCDXMonDataSync object not initialized when processing Status Messages in AX 2012 Retail

Todays issue is regarding AX 2012 Retail…

When I try to Process status messages under Retail – Inqueries – Download sessions i get the following error

image

First I found some hints online that it had to do with the Working Folders set up in Retail – Setup – POS – Retail Scheduler – Channel Integration – Working Folders. I verified that the settings were OK and then I set the permissions on the folders to allow the service account for AsyncServer/AsyncClient had full access to them.

That did not help… strange… so I thought that I really needed to verify the permissions… Process Monitor to the rescue

image

Apparently the changes I made did not propagate all through the folder structure… After fixing it everything is working nicely.

Links:
https://community.dynamics.com/ax/b/dynamicsaxretail/archive/2016/03/13/retailcdxmondatasync-object-not-initialized-when-you-run-process-status-message

Trying to give my AX 2012 demo VM in Azure Internet Access

Today little issue was a bit frustrating…. to say the least

I have set up a new AX 2012 Vm in Azure for my colleagues to do some troubleshooting on. The need to install a Hotfix there and thus needs Internet Access from the VM. Normally this is not a problem… there are normally no issues accessing the internet from a correctly configured VM… the key phrase being correctly configured

I installed the VM from LifeCycle Services which is the normal way for AX machines which means I get a preconfigured VM with AX 2012 and it also has Active Directory installed locally to decrease dependencies. I am able to access the VM but no internet access… so I do some basic testing and I can do nslookup when using an external DNS which tells me 1) the VM has internet Access and 2) there is something wrong with the DNS settings. The local dns setting is pointing to the address is pointing to 10.20.12.4 which has nothing to do with my VM. So I tried to change it to 127.0.0.1 and as soon as I saved the settings the connection to the VM dropped… that is strange. I tried again after restarting but got the same result. So what to do…

I tried changing it using Powershell… Success!! Restarted the VM and it was back to 10.20.12.4… Fail!! Something is rotten in the state of Denmark…

I started by looking through Group policies for something strange but could not find anything. So I fired up Sysinternal Autostart and found a strange script:

image

Hmmm… Looking at the script:

image

I found it!! This is not OK!!! Well, well… I changed the script and restarted and it worked… So if your AX 2012 VM is behaving strangely look at the c:\scripts\start.ps1 script. It also fiddles with services autostart settings and some other things

/Johan

Changing the certificate used for Channel database sync in AX 2012 Retail

I have been trying the past couple of bays to get retail up and running on the Microsoft Dynamics AX 2012 R3 demo environment. There are some issues in the default environment that needs to be fixed before everything is running flawlessly.

One issue I noticed was that the SSL certificate used between the async client and async server has expired (in 2015 Smile ).

           image

To fix this we first need to request and issue a new certificate. Since the CA in the Demo is a stand-alone CA we cannot use the MMC to request the certificate, so I am using the web interface. Start Internet Explorer and browse to the address https://localhost/certsrv (since the certificate for the site is not issued to localhost there will be an error… ignore this).

           image

Select Request a certificate

           image

Select advanced certificate request

           image

Select create and submit a request to this CA

           image

Click Yes to continue

          image

Fill in the name of the certificate. In our case the adress is retail.contoso.com, the other fields are not mandatory. Select Server Authentication Certificate and check  Mark keys as exportable. Click Submit.

           image

Note the id of the request and start the Certificate Authority mmc Management Console

           image

Find the request above under Pending Request. Right-click and select the task Issue

           image

Go back to https://localhost/certsrv and click View the status of a pending certificate request. Click your request.

           image

Click Yes to continue.

          image

Click the Install this certificate. Unfortunately the certificate will be installed in you personal Certificate Store and you will have to move it before IIS can use it.

          image

Start the management Console and add the Certificates snap-in for Current User and for Local Computer. Go to Current User – Personal – Certificates and find your new certificate

          image

Right click the certificate and select Export

            image

Select Yes, export the private key

           image

Check Export all extended properties and click next

           image

Enter a password and click next

          image

In the console on Local Computer – Personal – Certificates right click and import the Certificate you exported previously

          image     image

In IIS Manager edit Binding for the sites AsyncServerSite and Retail Server Website and change the certificate for HTTPS. Restart the IIS sites.

That is all

/Johan

Error Doing a Full Data Sync

Today I am setting up a proof of concept for the retail solution in AX 2012 R3. As a base I am using the Microsoft AX 2012 R3 demo VM deployed to Azure using LCS

When Trying to do a  full data sync I got the following error:
”The target principal name is incorrect. Cannot generate SSPI context”

SSPI context has to do with Service Principal Name in Active Directory. The Service Account for SQL (contoso\sqlsvc) needs to have SPN set like this:

setspn –A MSSQLSvc/AX2012R2A:1433 contoso\sqlsvc
setspn –A MSSQLSvc/AX2012R2A.contoso.com:1433 contoso\sqlsvc

Where AX2012R2A and AX2012R2A.contoso.com are hostname and FQDN for the AX demo VM.

In my case I had duplicate FQDN and no hostname. I cleaned out the duplicates and added the hostname.

Links:
https://dynamicsessentials.net/2015/04/12/the-target-principal-name-is-incorrect-crm-setup/#comments