1

I'm trying to connect PowerBI to Postgres. We have:

  • Office 2016
  • Npgsql 3.0.3
  • PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11), 64-bit

When I click on the desired table I get this error:

Error inesperado: Ya existe una entrada con la misma clave.
Detalles:
    Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Ya existe una entrada con la misma clave. ---> System.ArgumentException: Ya existe una entrada con la misma clave.
   en System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   en System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
   en System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
   en Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.RetrieveIncomingRelationshipsForTable(String schemaName, String tableName)
   en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.RetrieveLinks(NavigationPropertiesRecord navigationPropertyRecord, TableValue table, DbEnvironment environment)
   en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.AddNavigationPropertiesToTable(NavigationPropertiesRecord record, DbEnvironment environment, TableValue table, NameGenerator nameGenerator)
   en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.NavigationPropertiesRecord.get_Item(SchemaItem key)
   en Microsoft.Mashup.Engine1.Library.Common.NavigationPropertiesHelper.LinkTableFunctionValue.TypedInvoke()
   en Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue0`1.Invoke()
   en Microsoft.Mashup.Engine1.Runtime.Relationship.EnsureRightKeyColumns()
   en Microsoft.Mashup.Engine1.Runtime.Relationship.get_RightKeyColumns()
   en Microsoft.Mashup.Engine1.Runtime.Relationship.Microsoft.Mashup.Engine.Interface.IRelationship.OtherKeyColumn(Int32 index)
   en Microsoft.Mashup.Evaluator.ArrayHelpers.NewArray[T](Int32 count, Func`2 getter)
   en Microsoft.Mashup.Evaluator.ITableSourceSerializationExtensions.WriteIRelationship(BinaryWriter writer, IRelationship relationship)
   en Microsoft.Mashup.Evaluator.BinaryReaderWriterExtensions.WriteArray[T](BinaryWriter writer, T[] array, Action`2 writeItem)
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.TableSourceMessage.Serialize(BinaryWriter writer)
   en Microsoft.Mashup.Evaluator.BinarySerializer.Serialize(Action`1 serializer)
   en Microsoft.Mashup.Evaluator.Interface.BufferedMessage.Prepare()
   en Microsoft.Mashup.Evaluator.ChannelMessenger.Post(MessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass10.<OnBeginGetPreviewValueSource>b__f(EvaluationResult2`1 result)
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 handler)
   --- Fin del seguimiento de la pila de la excepción interna ---
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 handler)
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
   en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
   en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.EvaluationHost.Run()
   en Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
   en Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
   en Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
   en Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
   --- Fin del seguimiento de la pila de la excepción interna ---
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.OnEvaluationException(IMessageChannel channel, EvaluationExceptionMessage message)
   en Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   en Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.PreviewValueSourceRemoteEvaluation.GetResult(Boolean enableFirewall)
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state)
   --- Fin del seguimiento de la pila de la excepción interna ---
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation`1.TryCompleteWithException(Exception exception)
   en Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state)
   en Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
   en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   en System.Threading.ThreadPoolWorkQueue.Dispatch()
   --- Fin del seguimiento de la pila de la excepción interna ---
   en Microsoft.Mashup.Evaluator.Interface.EvaluationResult2`1.get_Result()
   en Microsoft.Mashup.Host.Document.Preview.PreviewEvaluation.<>c__DisplayClassb.<StartEvaluation>b__8(EvaluationResult2`1 result)
3
  • Your error is in spanish and this is an english-talking community, what can dificult things a little. Besides, you can't dump a wall of error stack trace and expect people to debug it for you. Please, provide more details about your code background. Commented Oct 19, 2015 at 16:53
  • The error translates as "An entry with the same key already exists." Commented Oct 20, 2015 at 14:55
  • Alan, there is no programming code. I'm connecting Microsoft PowerBI to Postgres as I said in first place. The error is in spanish an I didn't want to change it to aboid mistakes. Commented Oct 20, 2015 at 17:38

2 Answers 2

1

I was able to reproduce this when there were:

tableA, tableB, tableC

tableA has a foreign key directed to tableC's primary key

tableB has a foreign key directed to tableC's primary key

both of these foreign keys have the same constraint name.

Can you confirm that this is the case in your database? (tableC doesn't have to be the table you're trying to connect, it could be any table in your database.)

The fix will be in the PowerQuery in couple of months, instead of waiting for it, you can try to rename one of those foreign key constraints.

Thanks for reporting the issue to us,

Oguz

Sign up to request clarification or add additional context in comments.

4 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
But I did tell him that renaming one of the constraints in his db would workaround his issue. Could we say that's kind of an answer?
Thank you Oguz. As you said, we had foreign key constraints names duplicated. We've changed them removing every duplicate name and we have still the same error
In case there are other people having same problems and looking at this page, we cleared the PowerQuery cache and then it worked :)
1

This is definitely a bug in Power Query.

Could you cause the error to happen again, then choose [Send Frown] to get the bug entered in our system?

Thanks!

5 Comments

Thank you very much Carl. This question is preceded by this one: stackoverflow.com/questions/33177598/install-npgsql-for-powerbi/… For sure I can make it happen again. There is no code. It is a simple connection between Excel (PowerQuery) and Postres Server. I you want I can post screenshots of the process.
Send-A-Frown is the best way to report a bug. It include some debugging info, and helps us keep tabs on what issues customers are seeing.
Send a Frown does nothing in my Excel 2016 (PowerQuery). Is there another way to send it to you?
Thanks again for bringing up the bug. Send-A-Frowns seems to have changed in Excel 2016, but I imagine it worked. I added this bug to our bug backlog. If you're available to follow up if we have more debugging questions, can you send an email to [email protected] and reference this web page?
I have the same issue with a postgres database, just sent a frown. Any table that I select in the database throws the same error. I downloaded the table data as csv and PBI was okay working with that. It only seems to be a problem via a live connection to the database. Clearing the cache did not help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.