Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fanofgolfdsm
Helper I
Helper I

An item with the same key has already been added - Since October 2017 release

After upgrading to the October 2017 release, I am now getting the following error on a query that was workin previously. "Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DatasSource.Error] An error happened while reading data from the provider. ' An item with the same key has already been added.'. The query in question pulls the same table from 4 separate databases and does not modify the data in any way. I created a query for each server to pull all the info from the table and those queries work fine. When I try to combine them into a single query (using the append function), the error occurs and I cannot load the table. Is this an issue with the October release and if so, when will it be fixed.

12 REPLIES 12
Anonymous
Not applicable

I am getting the following error and none of the keys are the same, so I do not know why this is happening. I seem to have the latest Power Bi Desktop App, so I don't think it is an update issue, but I may be wrong. Please can someone help. Many thanks in advance.

 

Unexpected error: An item with the same key has already been added.
Details:
Microsoft.Mashup.Evaluator.Interface.ErrorException: An item with the same key has already been added. ---> System.ArgumentException: An item with the same key has already been added. ---> 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 Microsoft.Internal.DictionaryTracing.AddWithTracing[K,V](IDictionary`2 dictionary, K key, V value, IEngineHost host, Boolean keyIsPii, Boolean valueIsPii)
at Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.RetrieveKeysForTable(String schemaName, String tableName, Keys columnNames)
at Microsoft.Mashup.Engine1.Library.Common.QueryResultTableTypeValue.get_TableKeys()
at Microsoft.Mashup.Engine1.Runtime.TableTypeValue.GetPrimaryKey()
at Microsoft.Mashup.Engine1.Runtime.TypeValue.get_KeyColumnNames()
at Microsoft.Mashup.Evaluator.ITableSourceSerializationExtensions.WriteITableSource(BinaryWriter writer, ITableSource tableSource)
at Microsoft.Mashup.Evaluator.BinarySerializer.Serialize(Action`1 serializer)
at Microsoft.Mashup.Evaluator.Interface.BufferedMessage.Prepare()
at Microsoft.Mashup.Evaluator.ChannelMessenger.PostWithoutFlowControl(MessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass0_0.<RunStub>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass11_0.<TryReportException>b__1()
at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)
at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost, IMessageChannel channel, Func`1 getPreviewValueSource)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass12_1`1.<OnBeginGetResult>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_TableSource()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_TableSource()
at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)

Anonymous
Not applicable

I'm facing with this issue since Apr 2020 update. 

My data source is sap bw. 

Is there anyone have any idea ?

FJ
Frequent Visitor

hey...i'm facing the same issue. Did you manage to find the solution? please share. Even my datasource is SAP

v-sihou-msft
Employee
Employee

@fanofgolfdsm

 

What's your data source? What's the version number of your Power BI Desktop?

 

Regards,

Anonymous
Not applicable

I'm having the same issue, also using a SQL data source. Using 2.51.4885.701 64-bit (October 2017).

 

A query that was working in PBI, and still works in SSMS now no longer works in PBI Desktop.

 

What i've found is that if I disregard the error and publish the report anyway, then refreshing the report online grabs all the correct data and the report works enitrely as it should... it's just not working in the desktop, which suggests something odd is going on in the desktop client?

 

NeilBarrett, I finally figured out what the issue was but not why it worked in the old version. There were a couple of fields in the table that had duplicate values and Power BI seemed to think were DB keys. I tweaked the query to remove those, as I didn't need them anyway, and the appended query worked fine. 

I'm having the same issue when merging two queries and scheduling a refresh from Power BI Report Server.

Renaming the columns afterwards doesn't resolve the issue.

 

Was this issue resolved? I have the same problem and I suspect it is mergerd queries

@BrookBracewell this issue is resolved in the March 2018 Power BI Report Server update.

 

Thanks Yousra.

I am struggling to find an elegant way of completing this upgrade- would I be correct in saying the new server needs setting up from scratch and migrating existing reports over? Or can I simply reinstall on to the existing location and expect it to pick up all existing settings and refresh schedules?

Thanks NeilBarrett for the information, unfortunately my company doesn't have a gateway installed for us to be able to refresh the report online. It is supposed to be available soon and will definitely try this when I can.

My data sources are 4 SQL databases and I’m using the most recent Power BI desktop, October 2017.

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.