Microsoft Dynamics AX Support

This blog contains posts by the Microsoft Dynamics AX Support teams Worldwide

SSRS error in AX2012 - An item with the same key has already been added

SSRS error in AX2012 - An item with the same key has already been added

Rate This
  • Comments 2

Recently came across this issue which was that a particualr report would no longer run -at all. Everytime you run it an error is recorded in the SSRS error log (default location is: C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles) that looks something like this:

webserver!ReportServer_0-12!598!03/01/2012-17:57:57:: e ERROR: Reporting Services error Microsoft.ReportingServices.Diagnostics.Utilities.RSException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset 'PurchPurchaseOrderDS'. ---> System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Microsoft.Dynamics.Framework.Reports.SetQueryProjectionVisitor.ProcessQueryFieldMetadata(AxQuerySchemaAnalysisElement fieldElement, QueryFieldMetadata queryField)


I have cut the error short here as it was pretty long, but this top part is the interesting part -  basically the call stack that is shown here, this is a report being run trying to build metadata caches, specifically lists of enum values or similar. It fails here trying to insert a duplicate into a list. We didn't know exactly which enum/ist as we didn't need to get as far as debugging this component.

Redeploying the report here resolved the issue. Before redeploying we had already restarted the AOS that was providing the WCF services for SSRS - but it made no difference.

So from this we can deduce that it wasn't AOS cache, or SSRS cache causing the failure - redeploying the report resolved it therefore the report metadata deployed to SSRS is likely to have been out of step with the related objects in the AOT, redeploying brought everything back into line and no more problem.

Leave a Comment
  • Please add 8 and 2 and type the answer here:
  • Post
  • I have also com accross this issue, same SSRS report.  I initially re deployed the report but recieved the same error.  I than stopped and restarted the AOS and than re deployed the report and this did the trick.  I am not sure if the combination of the two is what resolved this issue but in my case it appears to be that way.

  • I have similar problem. After deploy report was working only once. Then redeployed it twice more times and .... started to work normally :)

Page 1 of 1 (2 items)