1
votes

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)
2
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.al'ein
The error translates as "An entry with the same key already exists."Kyle Hale
Thank you very much Kyle.jergas
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.jergas

2 Answers

1
votes

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

1
votes

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!