microsoft / powerapps-tools

Unsupported PowerApps Tools & Apps
MIT License
1.04k stars 432 forks source link

Power BI report setup failing with "Object reference not set to an instance of an object" #967

Closed poppynka closed 3 years ago

poppynka commented 3 years ago

Description We are facing issues with upgrading the Power BI report to latest version attached to latest CoE release. After login and setting the environment URL, we get "Object reference not set to an instance of an object" error. We are using service account, which has access to the CoE environment (the CoE solution upgrade was also done with this user). We had tried to use also one of our admin accounts who also has access to the environment and proper privileges.

Steps to reproduce the behavior:

  1. open Dashboard-PowerPlatformAdminDashboard-2021-04-08.pbit in Power BI Desktop app
  2. when prompted, copied the environment URL from the session details in make.powerapps.com without http prefix
  3. when prompted, log in with a service account
  4. watch window loading the data image
  5. after some time operation fails with following message image

Version of the Power BI Desktop image

Trace log: 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.<>cDisplayClass7_0.b1(Object o) at Microsoft.Mashup.Evaluator.Interface.InvokeManyAction`1.CheckDone() at Microsoft.Mashup.OleDbProvider.DataHost.MashupEvaluator.<>cDisplayClass4_1.b1() at Microsoft.Mashup.OleDbProvider.DataHost.AsyncResultIDataReaderSourceHelper.InvokeThenOnDispose(Action1 callback, AsyncResult1 result, Action action) at Microsoft.Mashup.OleDbProvider.DataHost.MashupEvaluator.<>cDisplayClass4_0.b0(EvaluationResult21 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action1 callback, EvaluationResult21 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action1 callback, EvaluationResult21 result, Action action) at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation1.Complete(EvaluationResult21 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action1 callback, EvaluationResult21 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action1 callback, EvaluationResult2`1 result, Action action) at Microsoft.Mashup.Evaluator.DocumentEvaluator.<>cDisplayClass7_0`1.b0(EvaluationResult21 result) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose(Action1 callback, EvaluationResult21 result, Action action) at Microsoft.Mashup.Evaluator.Interface.EvaluationResultExtensions.InvokeThenOnDispose[T](Action1 callback, EvaluationResult21 result, Action action) at Microsoft.Mashup.Evaluator.LimitedDocumentEvaluatorFactory.Evaluation1.Complete(EvaluationResult21 result) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation1.TryComplete(EvaluationResult21 result) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation1.TryCompleteWithException(Exception exception) at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.RemoteEvaluation.Evaluate(Boolean enableFirewall) at Microsoft.Mashup.Evaluator.EvaluatorThreadPool.EvaluatorThread(Object state) 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.<>cDisplayClass15_0.b0() at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>cDisplayClass2_1.b0(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.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.Windows.DialogWindowBase.ShowModal(IWindowHandle windowHandle) at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func1 showModalFunction) 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.<TryShowDialogForQueries>b__0() at Microsoft.PowerBI.Client.Windows.Report.<>c__DisplayClass60_01.b0() at Microsoft.PowerBI.Client.Windows.Report.d611.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Windows.Report.SynchronizeLooselyWithQueriesAsync[T](Func1 getTask) at Microsoft.PowerBI.Client.Windows.Report.SynchronizeLooselyWithQueries[T](Func1 action) 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.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action) at Microsoft.Practices.Prism.Commands.DelegateCommandBase.<>cDisplayClass4_0.<.ctor>b0(Object arg) at Microsoft.PowerBI.Client.Windows.Commands.CompositeCommand1.Execute(ICommand command, Object parameter) at Microsoft.Practices.Prism.Commands.CompositeCommand.Execute(Object parameter) at Microsoft.PowerBI.Client.Windows.Commands.CompositeCommand1.Execute(T parameter) at Microsoft.PowerBI.Client.Windows.MainWindow.OpenDocument(TelemetryUserActionId entryPoint, String testFilePath) at Microsoft.PowerBI.Client.Windows.MainWindow.d96.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Windows.MainWindow.ShowStartDialog() at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_7.<

b7>d.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Program.<>cDisplayClass4_7.
b7(MainWindow mainWindow) at Microsoft.PowerBI.Client.Windows.MainWindow.<b114_1>d.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Windows.MainWindow.b114_1() at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.d1.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.d0.MoveNext() at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.HandleAsyncExceptions(IExceptionHandler exceptionHandler, Func1 asyncFunc) at Microsoft.PowerBI.Client.Windows.MainWindow.<ActivateMainWindow>b__114_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, Func1 showModalFunction) at Microsoft.PowerBI.Client.Program.<>cDisplayClass4_0.
b1() at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>cDisplayClass3_0.b0() at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action) at Microsoft.PowerBI.Client.Program.Main(String[] args)

PowerBINonFatalError: {"AppName":"PBIDesktop","AppVersion":"2.92.706.0","ModuleName":"","Component":"Microsoft.Mashup.Evaluator.ChannelMessenger","Error":"Microsoft.Mashup.Host.Document.SerializedException - System.NullReferenceException","MethodDef":"CreateChannel","ErrorOffset":""}

Snapshot Trace Logs: C:\Users*****\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot7c60182c-2990-4a1f-bfb0-74e6bc19c185.zip

Model Default Mode: Empty

Model Version: PowerBI_V1

Performance Trace Logs: C:\Users****\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip

Enabled Preview Features: PBI_JsonTableInference PBI_NewWebTableInference PBI_ImportTextByExample PBI_ExcelTableInference PBI_eimInformationProtectionForDesktop PBI_newFieldList

Disabled Preview Features: PBI_shapeMapVisualEnabled PBI_SpanishLinguisticsEnabled PBI_qnaLiveConnect PBI_azureMapVisual PBI_dataPointLassoSelect PBI_compositeModelsOverAS PBI_narrativeTextBox PBI_dynamicParameters PBI_anomalyDetection 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,

unfortunately the log dump provided doesn't give us enough detail about the failure - in the screen pop up where it says "Refresh" could you scroll down there and see if there's on table in particular that is failing and causing issues and check if on that table more detailed error messages are provided?

Thank you Manuela

poppynka commented 3 years ago

I'm unable to scroll in the list, because of the error above. It locks the other popup

image

Pressing cancel multiple times, this is the information in the scrollable Refresh popup"

OrgUrl Load was cancelled by an error in loading a previous table. Environment Load was cancelled by an error in loading a previous table. App OLE DB or ODBC error: Exception from HRESULT: 0x80040E4E. Flow OLE DB or ODBC error: Exception from HRESULT: 0x80040E4E. Maker Load was cancelled by an error in loading a previous table. App Connection Reference Load was cancelled by an error in loading a previous table. Flow Connection Reference OLE DB or ODBC error: [DataSource.Error] Microsoft SQL: Return records size cannot exceed 83886080. Make sure to filter result set to tailor it to your report. RequestId: TDS;8fd14c4f-2c3a-4387-9a66-808d31799451;2 Time: 2021-04-28T10:48:48.8316241Z. Audit Log Load was cancelled by an error in loading a previous table. Connector Load was cancelled by an error in loading a previous table. Flow Action Details Load was cancelled by an error in loading a previous table. NonProdWords Load was cancelled by an error in loading a previous table. CoE Settings Load was cancelled by an error in loading a previous table. Virtual Agent Load was cancelled by an error in loading a previous table. Virtual Agent Component Load was cancelled by an error in loading a previous table. Virtual Agent Flows Load was cancelled by an error in loading a previous table. Virtual Agent Makers Load was cancelled by an error in loading a previous table. RPA OLE DB or ODBC error: Exception from HRESULT: 0x80040E4E. RPA Sessions OLE DB or ODBC error: Exception from HRESULT: 0x80040E4E. Environment Maker Load was cancelled by an error in loading a previous table. Date Last Refreshed Load was cancelled by an error in loading a previous table. Flow Makers Load was cancelled by an error in loading a previous table.

Does it mean that we have too many flows in the tenant maybe?

manuelap-msft commented 3 years ago

Hello,

unfortunately when we switched the PBI to TDS/DirectQuery with the last release, there's a limitation in terms of size we didn't take into consideration. Do you have a previous version of the PBI that you can use (the pages and reports are exactly the same, it just works with Import mode rather than DirectQuery) or is this your first install of the CoE Starter Kit?

(If you don't have a previous version of the Power BI I can upload one for you. We are looking to make both DirectQuery and Import available with the next release)

Thank you Manuela

poppynka commented 3 years ago

Hi,

It's an upgrade, so we already have older version in place. We just wanted to update everything :) So, we probably will have to wait for the next upgrade because of the limitations, right?

Thanks Andrea

manuelap-msft commented 3 years ago

Hello,

thanks for confirming!

The old dashboard uses Import and the new dashboard uses DirectQuery but the pages and visuals are exactly the same. Because of the product limitations, large tenants will have to continue to stay on the Import version - and going forward we will provide two dashboards that are always both updated.

Hope that clarifies it - basically, at the moment you are not missing any new pages or visuals in the old dashboard, we kept them all the same and just changed the connection mode to DirectQuery but missed some of the limitations when we did that.

Thank you Manuela

poppynka commented 3 years ago

Hi Manuela,

all clear, thanks for the explanation :)

have a great rest of the day!

regards, Andrea

manuelap-msft commented 3 years ago

Sorry we made things complicated unintentionally by not reading the full manual ;)

Thanks for using the CoE!

rosannaGorman commented 3 years ago

I have had this same issue that I have been working on all week and just see your post today. I have now reverted to february file Dashboard-PowerPlatformAdminDashboard-2021-01-07.pbit which is now working. We have a large Tenant. I will watch for the two dashboards in your future releases. Thanks for the posting.

osbornecc commented 3 years ago

We also experienced a similar issue in our tenant on the Audit Logs table. It keeps timing out with the newer dashboard that uses DirectQuery (but not with Import)

For now, I still have the March version of the dashboard in place and will wait for the next round. Thank you!

manuelap-msft commented 3 years ago

@osbornecc Due to limitations with the TDS endpoint used for DirectQuery when used with Dataverse (see https://docs.microsoft.com/en-us/powerapps/developer/data-platform/dataverse-sql-query#limitations) we are going to have to offer two dashboards going forward - Import mode for larger tenants, DirectQuery for smaller tenants. Because of the limitations, DirectQuery will not work for larger tenants unfortunately.