Forum Discussion
An entry with the same key already exists.
Hi Team,
We are refreshing the data for already built report. I am getting the error 'An entry with the same key already exists.' Below is the log for that. We have tried to clear the permission in the data source setting and cleared the cache alos. But, we are facing the same error again. Could any one suggest us for the clear the below issue.
Thanks,
Kota Ratnakar
Log:
------
Feedback Type:
Frown (Error)
Error Message:
Error
Stack Trace:
Microsoft.Mashup.Client.UI.Shared.ExceptionResultException
Microsoft.Mashup.Evaluator.Interface.ErrorException: An entry with the same key already exists. ---> System.ArgumentException: An entry with the same key already exists. ---> System.ArgumentException: An entry with the same key already exists.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
at System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
at Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.AddFunctionsToCatalog(DataTable functionsTable, String functionType, String linkKind, IDictionary`2 typeCatalog)
at Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.LoadTypeCatalog()
at Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.LoadCatalog()
at Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.get_NavigationPropertiesRecord()
at Microsoft.Mashup.Engine1.Library.Common.DbCatalogTableValue.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.SkipTakeEnumerable.GetEnumerator()
at Microsoft.Mashup.Engine1.Language.Query.QueryTableValue.GetEnumerator()
at Microsoft.Mashup.Engine1.Runtime.TableValue.Microsoft.Mashup.Engine.Interface.ITableValue.GetEnumerator()
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.SerializeRows(Int32 count)
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
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_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)
Stack Trace Message:
Error
Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.GetStackTraceInfo(Exception e)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass15_0.<HandleException>b__0()
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.PowerBI.Client.Windows.Utilities.UIBlockingAwareExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.HandleImportEvaluationException(ExceptionResult exceptionView, Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.OnGetPreviewResult(PreviewResult preview, Query query, String sourceID, String formulaTitle, Nullable`1 explicitImportDestination, Boolean isNewQuery, Boolean isFromEditor)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.GetPreviewResult(Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor, Nullable`1 explicitImportDestination)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.<>c__DisplayClass88_1.<OnQuerySettingsResolved>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_0.<Main>b__1()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)
PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.94.921.0","ModuleName":"","Component":"Microsoft.Mashup.Engine1.Library.Common.DbEnvironment","Error":"Microsoft.Mashup.Client.UI.Shared.ExceptionResultException","MethodDef":"AddFunctionsToCatalog","ErrorOffset":""}
Snapshot Trace Logs:
C:\Users\kxd5896\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot4d2dd8c3-b7a9-494c-ae05-70d0600a562a.zip
Model Default Mode:
Empty
Model Version:
PowerBI_V1
Performance Trace Logs:
C:\Users\kxd5896\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip
Enabled Preview Features:
PBI_JsonTableInference
PBI_NewWebTableInference
PBI_ImportTextByExample
PBI_ExcelTableInference
PBI_eimInformationProtectionForDesktop
PBI_cartesianMultiplesAuthoring
PBI_rdlNativeVisual
Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_SpanishLinguisticsEnabled
PBI_qnaLiveConnect
PBI_azureMapVisual
PBI_dataPointLassoSelect
PBI_compositeModelsOverAS
PBI_dynamicParameters
PBI_enhancedTooltips
Disabled DirectQuery Options:
TreatHanaAsRelationalSource
Cloud:
GlobalCloud
ExceptionResultMessage:
An entry with the same key already exists.
PowerBIUserFeedbackServices_IsReported:
True
Formulas:
section Section1;
shared Query1 = let
Source = MySQL.Database("oflow-prod-cluster.cluster-ro-cexch761gufg.us-east-1.rds.amazonaws.com", "oflow_Prod", [ReturnSingleDatabase=true])
in
Source;
8 Replies
- gguilleNew Member
I had the same issue and the cause was a table and a function with the same name.
In MySQL, you can get 4 lists with queries like this.
SHOW FUNCTION STATUS WHERE DB = 'your_db'; SHOW PROCEDURE STATUS WHERE DB = 'your_db'; SELECT TABLES.Table_Name FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'your_db'; SELECT VIEWS.Table_Name FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'your_db';Hope this helps.
- karthiksoorya2New Member
Root cause is in the Database, not in the Power BI.
There are 2 objects with the same in Database.
For example,
There could be a Table as "SalaryDetail"There could be a Function as "SalaryDetail"
This is possible in MySQL.
When PowerBi is connecting the Database, it is collecting database objects as metadata and started storing by object name in its internal collection for reference.
Object name is the unique key in that metadata collection to identify.
So,
When PowerBI is trying the add table object first name as "SalaryDetail", it will be added.
When PowerBI is trying the add function object first as "SalaryDetail", the collection throws an error the key already exists.
So the DB design, should be updated.
Karthik
- amitchandak
Super User
Anonymous , seem like you create a new column in power query or dax on this table and now you are getting the same column name from database too
- AnonymousNot applicable
While we are freshly connecting with the server on that time alspo error is displaying. We have opened a fresh page with cleared cache and the same error is displaying while connecitn to the server. While we click on get data and provide the respective server details and databse name directly the page is displaying with the error with out taking it to the next page for Login and password.
- v-xiaotang
Community Support
Hi Anonymous
It seems that the error is essentially a duplicate column name error,
https://answers.sap.com/questions/5955946/a-row-with-the-same-key-already-exists.html
kindly check column name in your datasource.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
- v-xiaotang
Community Support
Hi Anonymous
Hope you're doing well.
Is the question solved? If yes, to help others find helpful answer quickly, could you mark the solution helpful? Thanks 🙂
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
- gguille077New Member
Getting a very similar error over here trying to connect to an on-premises MySQL 8.0.21.
- technolo_biFrequent Visitor
Did someone solve this problem and can share with it?