DataConnectors icon indicating copy to clipboard operation
DataConnectors copied to clipboard

NullReferenceException on AdoDotNetSchemasTableValue.<Initialize>b__19()

Open monty241 opened this issue 6 years ago • 1 comments

On the July release on one customer site (not reproducible in our testing environment strangely enough), we get a NullReferenceException when the list of data sets is being loaded from a custom connector.

The NulLReferenceException is only visible in the trace logs maintained by Power BI, as described on issue #26 a stackoverflow is shown.

Version: 2.48.4792.481 64-bit (juli 2017)

09:13:21.280: De objectverwijzing is niet op een exemplaar van een object ingesteld.
   bij Microsoft.Mashup.Engine1.Library.AdoDotNet.AdoDotNetSchemasTableValue.<Initialize>b__19()
09:13:21.280: !! Memorized first chance exception of type System.NullReferenceException:
09:13:21.280: De objectverwijzing is niet op een exemplaar van een object ingesteld.
09:13:21.280: !!    bij System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   bij System.Environment.get_StackTrace()
   bij Invantive.Data.ErrorUtility.CurrentDomain_FirstChanceException(Object sender, FirstChanceExceptionEventArgs e)
   bij Microsoft.Mashup.Engine1.Library.AdoDotNet.AdoDotNetSchemasTableValue.<Initialize>b__19()
   bij Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.RunWithRetryGuard[T](Func`1 action, Func`2 retryAfterSqlError, Action finalizeOnRetry, String dataSourceNameString, IEngineHost host)
   bij Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.ConvertDbExceptions[T](IResource resource, Func`1 action, Func`2 retryAfterSqlError, Action finalizeOnRetry, String dataSourceNameString, IEngineHost host)
   bij Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.ConvertDbExceptions[T](IResource resource, Func`1 action)
   bij Microsoft.Mashup.Engine1.Library.AdoDotNet.AdoDotNetSchemasTableValue.get_Columns()
   bij Microsoft.Mashup.Engine1.Runtime.TableValue.SelectRows(RecordValue index)
   bij Microsoft.Mashup.Engine1.Runtime.TableValue.TryGetValue(Value key, Value& value)
   bij Microsoft.Mashup.Engine1.Runtime.TableValue.get_Item(Value key)
   bij Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)
   bij Microsoft.Mashup.Engine1.Language.FieldAccessExpression.Execute(Value frame)
   bij Microsoft.Mashup.Engine1.Language.DebugExpression.Execute(Value frame)

The method Invantive.Data.ErrorUtility.CurrentDomain_FirstChanceException is something from Invantive and as you may guess carefully does some extra registration of an exception as some problems go unnoticed.

Properties:

property-0-System.NullReferenceException-HResult='-2147467261'
property-0-System.NullReferenceException-Source='Microsoft.MashupEngine'
property-0-System.NullReferenceException-TargetSite='Boolean <Initialize>b__19()'

The table with the data sets is the same for all environments and customers, in that case on Exact Online.

It seems to be converting some database exceptions based upon call stack and then retrying and failing. The trace contains no description on what db exception is being converted.

After that call, it seems to dispose the mashup engine and the connection used.

A little further in the trace it says:

DataMashup.Trace Error: 24579 : {"Start":"2017-07-07T07:13:22.4038487Z","Action":"Engine/IO/Db/Invantive.ExactOnline.NL/ProcessException","HostProcessId":"4648","Exception":"Exception:\r\nExceptionType: System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\r\nMessage: De objectverwijzing is niet op een exemplaar van een object ingesteld.\r\nStackTrace:\n   bij Microsoft.Mashup.Engine1.Library.AdoDotNet.AdoDotNetSchemasTableValue.<Initialize>b__19()\r\n   bij Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.RunWithRetryGuard[T](Func`1 action, Func`2 retryAfterSqlError, Action finalizeOnRetry, String dataSourceNameString, IEngineHost host)\r\n   bij Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.ConvertDbExceptions[T](IResource resource, Func`1 action, Func`2 retryAfterSqlError, Action finalizeOnRetry, String dataSourceNameString, IEngineHost host)\r\n\r\n\r\n","ProductVersion":"2.48.4792.481 (PBIDesktop)","ActivityId":"176373e7-ed7d-44fa-903d-96bf3f673a58","Process":"Microsoft.Mashup.Container.NetFX40","Pid":8368,"Tid":1,"Duration":"00:00:00.0035802"}
09:13:22.414: [DataSource.Error] Er is een fout opgetreden tijden het lezen van gegevens van de provider: De objectverwijzing is niet op een exemplaar van een object ingesteld.
   bij Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.ConvertDbExceptions[T](IResource resource, Func`1 action, Func`2 retryAfterSqlError, Action finalizeOnRetry, String dataSourceNameString, IEngineHost host)
09:13:22.414: !! Memorized first chance exception of type Microsoft.Mashup.Engine1.Runtime.ValueException:
09:13:22.414: [DataSource.Error] Er is een fout opgetreden tijden het lezen van gegevens van de provider: De objectverwijzing is niet op een exemplaar van een object ingesteld.
De objectverwijzing is niet op een exemplaar van een object ingesteld.

It would be great when not a NullReferenceException would be triggered, but instead a meaningful exception.

monty241 avatar Jul 07 '17 07:07 monty241