microsoft / coe-starter-kit

Other
742 stars 218 forks source link

[CoE Starter Kit - BUG]: Power BI template fails to load ("Object reference not set to an instance of an object") #547

Closed mschaefer85 closed 3 years ago

mschaefer85 commented 3 years ago

Describe the bug We're unable to load the Power BI template. After a few minutes of loading, it shows the error "Something went wrong: Object reference not set to an instance of an object".

Component (please tell us which flow or app you are experiencing issues with):

To Reproduce Steps to reproduce the behavior:

  1. Install the Core Components of the CoE Starter Kit.
  2. Open Power BI Desktop.
  3. Click on File -> Import -> Power BI template
  4. Choose Dashboard-PowerPlatformAdminDashboard-2021-04-08.pbit
  5. Enter the OrgUrl without "http://" as a prefix or "/" as a postfix.
  6. Click on Load.
  7. Wait for several minutes.
  8. See error.

Expected [behavior] I'd expect the Power BI report to load.

Screenshots image

Additional context

  1. The Power Platform we're working on is pretty large, with over 700 environments.
  2. The error details are as follows:

Error details

Feedback Type: Frown (Error) Error Message: Object reference not set to an instance of an object. Stack Trace: Microsoft.Mashup.Host.Document.SerializedException at Microsoft.Mashup.Evaluator.ChannelMessenger.CreateChannel() at Microsoft.PowerBI.Client.OleDbProvider.PowerBIMashupDataSource.EvaluationSession.Dispose() at Microsoft.Mashup.Host.ProviderShared.PackageMashupEvaluator.<>c__DisplayClass7_0.b__1(Object o) at Microsoft.Mashup.Evaluator.Interface.InvokeManyAction`1.CheckDone() at Microsoft.Mashup.Evaluator.Interface.InvokeManyAction`1.InvokeMany(T value) at Microsoft.Mashup.OleDbProvider.DataHost.MashupEvaluator.<>c__DisplayClass4_1.b__1() at Microsoft.Mashup.OleDbProvider.DataHost.AsyncResultIDataReaderSourceHelper.InvokeThenOnDispose(Action`1 callback, AsyncResult`1 result, Action action) at Microsoft.Mashup.OleDbProvider.DataHost.MashupEvaluator.<>c__DisplayClass4_0.b__0(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.DocumentEvaluator.<>c__DisplayClass7_0`1.b__0(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action`1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation`1.Complete(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation`1.TryComplete(EvaluationResult2`1 result) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation`1.TryCompleteWithException(Exception exception) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation.Evaluate(Boolean enableFirewall) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.EvaluationThread(Object state) at Microsoft.Mashup.Evaluator.GlobalizedEvaluatorThreadPool.<>c__DisplayClass1_0.b__0(Object s) at Microsoft.Mashup.Evaluator.EvaluatorThreadPool.EvaluatorThread(Object state) at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass3_0.b__0(Object o) at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.b__0(Object o) Stack Trace Message: Object reference not set to an instance of an object. 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.b__0() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass2_1.b__0(Object null) 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.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.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.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.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at Microsoft.Mashup.Client.UI.Windows.DialogWindowBase.ShowModal(IWindowHandle windowHandle) at Microsoft.PowerBI.Client.Windows.CefHtmlForm.<>n__1(IWindowHandle windowHandle) at Microsoft.PowerBI.Client.Windows.CefHtmlForm.<>c__DisplayClass34_0.b__0() at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction) at Microsoft.PowerBI.Client.Windows.CefHtmlForm.ShowModal(IWindowHandle owner) at Microsoft.Mashup.Client.UI.Shared.Ux.WindowService.ShowDialog(IDialog dialog) at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoLoadToReportDialog.TryShowDialog(Report report, IExceptionHandler exceptionHandler, IPowerBIWindowService windowService, IQueryServices queryServices, IModelingService modelingService, LocalizedString title, LoadToModelContext loadToModelContext) at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoLoadToReportDialog.<>c__DisplayClass16_0.b__0() at Microsoft.PowerBI.Client.Windows.Report.<>c__DisplayClass60_0`1.b__0() at Microsoft.PowerBI.Client.Windows.Report.d__61`1.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Windows.Report.SynchronizeLooselyWithQueriesAsync[T](Func`1 getTask) at Microsoft.PowerBI.Client.Windows.Report.SynchronizeLooselyWithQueries[T](Func`1 action) at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoLoadToReportDialog.TryShowDialogForQueries(Report report, IExceptionHandler exceptionHandler, IPowerBIWindowService windowService, IQueryServices queryServices, IEnumerable`1 queriesToApply, String loadReason, LocalizedString title, QueryLoadMode queryLoadMode, Action`1 beforeSchemaSyncCallback, Action`1 afterSchemaSyncCallback) at Microsoft.PowerBI.Client.Windows.Services.TemplateManager.PromptForParametersAndCredentials(IPowerBIWindowService windowService, IQueryServices queryServices, IExceptionHandler exceptionHandler, String filePath, Report templateReport, Boolean allCredentialsSatisfied, Boolean& editQueries) at Microsoft.PowerBI.Client.Windows.Services.TemplateManager.TryImportTemplate(IPowerBIWindowService windowService, IQueryServices queryServices, IExceptionHandler exceptionHandler, TelemetryUserActionId entryPoint, Boolean& editQueries, String filePath) at Microsoft.PowerBI.Client.Windows.Commands.ApplicationCommands.DataImportCommands.ImportTemplate(IPowerBIWindowService windowService, IExceptionHandler exceptionHandler, ImportTemplateParameters parameters) at Microsoft.PowerBI.Client.Windows.Commands.CommandFactory.<>c__DisplayClass13_1`1.b__1() at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action) at Microsoft.PowerBI.Client.Windows.Commands.CommandFactory.ExecuteWithExceptionHandler(Action executeMethod, IExceptionHandler exceptionHandler, String telemetryCommandName) at Microsoft.PowerBI.Client.Windows.Commands.CommandFactory.<>c__DisplayClass13_0`1.b__0(UICommandParameter`1 p) at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass1_0.<.ctor>b__0(Object o) at Microsoft.Practices.Prism.Commands.DelegateCommandBase.<>c__DisplayClass4_0.<.ctor>b__0(Object arg) at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter) at Microsoft.Practices.Prism.Commands.DelegateCommand`1.Execute(T parameter) at Microsoft.PowerBI.Client.Windows.Commands.CompositeCommand`1.Execute(ICommand command, Object parameter) at Microsoft.Practices.Prism.Commands.CompositeCommand.Execute(Object parameter) at Microsoft.PowerBI.Client.Windows.Commands.CompositeCommand`1.Execute(T parameter) at Microsoft.PowerBI.Client.Windows.FileMenuHostService.Import(String id) at Microsoft.PowerBI.Client.Windows.FileMenuHostService.<>c__DisplayClass29_0.b__0() at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.d__1.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.HandleAwaitableAsyncExceptions(IExceptionHandler exceptionHandler, Func`1 asyncFunc) at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.d__0.MoveNext() at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.HandleAsyncExceptions(IExceptionHandler exceptionHandler, Func`1 asyncFunc) at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass8_0.b__0() at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action) at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass5_0.b__0(Object null) 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.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.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.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.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at Microsoft.PowerBI.Client.Program.<>c.
b__4_11() at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction) at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_0.
b__1() at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.b__0() at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action) at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.HandleExceptionsWithNestedTasks(IExceptionHandler exceptionHandler, Action action) at Microsoft.PowerBI.Client.Program.Main(String[] args) PowerBINonFatalError: {"AppName":"PBIDesktop","AppVersion":"2.91.884.0","ModuleName":"","Component":"Microsoft.Mashup.Evaluator.ChannelMessenger","Error":"Microsoft.Mashup.Host.Document.SerializedException - System.NullReferenceException","MethodDef":"CreateChannel","ErrorOffset":""} Snapshot Trace Logs: C:\Users\xxxxxx\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShota15b3ffa-2e84-4760-9963-575d47d46a40.zip Model Default Mode: Empty Model Version: PowerBI_V1 Performance Trace Logs: C:\Users\xxxxxx\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip Enabled Preview Features: PBI_JsonTableInference PBI_NewWebTableInference PBI_ImportTextByExample PBI_ExcelTableInference PBI_eimInformationProtectionForDesktop Disabled Preview Features: PBI_shapeMapVisualEnabled PBI_SpanishLinguisticsEnabled PBI_qnaLiveConnect PBI_azureMapVisual PBI_dataPointLassoSelect PBI_compositeModelsOverAS PBI_narrativeTextBox PBI_dynamicParameters PBI_anomalyDetection PBI_newFieldList PBI_cartesianMultiplesAuthoring Disabled DirectQuery Options: TreatHanaAsRelationalSource Cloud: GlobalCloud PowerBINonFatalError_ErrorDescription: System.NullReferenceException PowerBIUserFeedbackServices_IsReported: True Formulas: section Section1;
manuelap-msft commented 3 years ago

Hello,

this is an error we sometimes see when you're not on the latest version of Power BI Desktop.

  1. Can you please upgrade Power BI Desktop to the latest version?
  2. Can you select "Cancel" there and see if a better error message is available from the "Refresh" screen (currently hidden behind the Something went wrong pop up) - sometimes when you scroll down there, there's one table causing issues with a better error message? Thank you Manuela
manuelap-msft commented 3 years ago

PS: If this is for the same tenant as your other issue #548, then you're likely hitting limitations of the TDS endpoint in Power BI which can only return 80 MB.

You can learn more about how to connect to Dataverse from Power BI here, which documents the two different connectors and their limitations. https://docs.microsoft.com/en-us/powerapps/maker/data-platform/data-platform-powerbi-connector#connect-to-dataverse-using-the-connector

As we have had a few customers hit this issue, we have just published a new version of the CoE Starter kit reports - one using the new Dataverse connector (that's using the TDS endpoint) and one using the old Common Data Service (Legacy) connector that's using Import and can be used for datasets larger than 80MB.

You can download the new release here aka.ms/coestarterkitdownload and use the Legacy_CoEDashboard202106.pbit to connect to your Dataverse instance. Please note that when using the Legacy dashboard, you have to enter the Environment URL with https:// at the beginning again.

We have added all these instructions to our documentation and are waiting for them to be published (hopefully later today or tomorrow). I will update this thread here once the instructions are live.

Thank you Manuela

mschaefer85 commented 3 years ago

Thank you for your quick reply.

We've installed a new version of Power BI Desktop, but the errors remain the same:

image image image

But according to your last reply, we'll try to download the new release and try the Legacy_CoEDashboard_202106.pbit.

I'll keep you updated.

manuelap-msft commented 3 years ago

Typically, the "A connection was successfully established with the server, but then an error occurres during the pre-login handshake" happens when ports that the TDS endpoint requires are blocked. Here's a link to troubleshoot connection problems: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/dataverse-sql-query#troubleshooting-connection-problems that you can try.

If not, the Legacy_ should work as it is not using the TDS endpoint.

Thank you Manuela

abhishekmaru commented 3 years ago

Hi,

Thank you for the reply, As suggested performed the following steps:

  1. Upgraded Power BI Desktop to the latest version (2.93.981.0) from the following url: https://www.microsoft.com/en-us/download/details.aspx?id=58494

  2. Download the new release here aka.ms/coestarterkitdownload and use the Legacy_CoEDashboard_202106.pbit. strangely getting the version error while importing Legacy_CoEDashboard_202106.pbit. Here are the screen shot:

    Error
manuelap-msft commented 3 years ago

Hello,

as per our Troubleshooting tips https://docs.microsoft.com/en-us/power-platform/guidance/coe/setup-powerbi#troubleshooting please select Close, and the Dashboard will continue to load. This is a known issue that can sometimes happen.

Thank you Manuela

abhishekmaru commented 3 years ago

Hello,

Still the same errors, here are screen shots:

E1 E2 E3
manuelap-msft commented 3 years ago

Can you scroll down the "Refresh" screen and share all the error messages?

abhishekmaru commented 3 years ago

Following are the remaining error messages:

E4 E5
abhishekmaru commented 3 years ago

Hi, any feedback on this issue.

JeneferM-MSFT commented 3 years ago

You will need to use the Legacy_CoEDashboard_202106.pbit instead due to your tenant size. Please install the latest version of the toolkit to retrieve