Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Unexpected Failure: InvalidOperationException when opening particular PBIX file

Hi all,

 

This is the first time I have such an issue with PowerBI. I'm going to give context as briefly and consicely as possible:

 

I have a template for a monthly report I make each month. I usually open it, change the data source file path to the most recent month's version, and manully change the model name to match the new data source file name (because I like doing so).

 

This time around, I introduced a new column to the newest iteration of the data source file, and changed the naming pattern for future files with the new column, including this most recent file naming pattern. It made the name longer. Starting from the template, I selected the new data source file, renamed the model appropriately (which made both names a little bit longer), changed the data source query with the Advanced Editor to read the new column, and changed the visualizations to filter/use the new column. (I mention the file and model naming changes because the naming for the methods in the stack trace suggest they deal with that when loading PBIX file)

 

Everything is fine and dandy. I save multiple times throught my current PowerBI Desktop program instance and when I'm satisfied, I close the file (I name it similar to previous ones, but with the same pattern change that makes the file name a little bit longer). Later, when I decide I want to edit it some more and try opening it again, I get the following error information and stack trace:

 

Feedback Type:
Frown (Error)

Error Message:
Unexpected failure:

Stack Trace:
System.InvalidOperationException
at Microsoft.Mashup.Host.Document.OperationResult.ThrowIfFailed()
at Microsoft.PowerBI.Client.Windows.Modeling.Hosting.ModelingMashupDocumentBuilder.<>c__DisplayClass18_0.<BuildQueries>b__2(PackageEditor packageEditor)
at Microsoft.Mashup.Host.Document.Model.Queries.<>c__DisplayClass163_0.<InvokeWithWritablePackageEditor>b__0(PackageEditor packageEditor)
at Microsoft.Mashup.Host.Document.Model.Queries.ChangeScope.Invoke[T](Func`2 action, Nullable`1 changeReason)
at Microsoft.Mashup.Host.Document.Model.Queries.InvokeWithPackageEditor[T](Nullable`1 changeReason, Func`2 action)
at Microsoft.Mashup.Host.Document.Model.Queries.InvokeWithWritablePackageEditor(ChangeReason changeReason, Action`1 action)
at Microsoft.PowerBI.Client.Windows.Modeling.Hosting.ModelingMashupDocumentBuilder.BuildQueries()
at Microsoft.PowerBI.Client.Windows.Modeling.Hosting.ModelingMashupDocumentBuilder.BuildRestorationInput()
at Microsoft.PowerBI.Client.Windows.Modeling.Utilities.MashupQueryGenerator.GenerateRestorationInputFromModel(IDataModel dataModel, QueriesSettings queriesSettings)
at Microsoft.PowerBI.Client.Windows.Services.ReportFactory.CreateReportFromPowerBIPackage(IPowerBIPackage powerBIPackage, String pbixFilePath, Byte[] securityBindings, Boolean requiresConversionToReportLayout, PowerBIPackageOpenOptions options, IPowerBITelemetryService powerBITelemetryService, IAnalysisServicesService analysisServices, Version pbixFileVersion, PackageValidationResult& mashupValidationResult)
at Microsoft.PowerBI.Client.Windows.Services.PowerBIPackagingService.Open(Stream stream, String streamName, IPowerBIWindowService windowService, Nullable`1 entryPoint, PowerBIPackageOpenOptions options, ReportPreparerResult& prepareResult)
at Microsoft.PowerBI.Client.Windows.Services.FileManager.<LoadFromPbix>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.<>c__DisplayClass14_0`1.<<BlockUIAndRun>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.WaitOnUIThreadForTaskCompletion[T](Task`1 task)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.BlockUIAndRun[T](Func`1 asyncMethod)
at Microsoft.PowerBI.Client.Windows.Services.FileManager.OpenFile(IPowerBIWindowService windowService, IPbixFile fileToOpen, Nullable`1 entryPoint)
at Microsoft.PowerBI.Client.Program.TryOpenOrCreateReport(IUIHost uiHost, IPowerBIWindowService windowService, IFileManager fileManager, IFileHistoryManager fileHistoryManager, String filePath, FileType fileType, IFileInformationProtectionManager fileInformationProtectionManager)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_0.<Main>b__1()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

Stack Trace Message:
Unexpected failure:

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.<HandleException>b__0()
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)


PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.91.884.0","ModuleName":"Microsoft.Mashup.Document.dll","Component":"Microsoft.Mashup.Host.Document.OperationResult","Error":"System.InvalidOperationException","MethodDef":"ThrowIfFailed","ErrorOffset":"34"}

PowerBIUserFeedbackServices_IsReported:
True

 

I tried updating to PowerBI Desktop latest version, and I also tried going through the steps above multiple times, and each time, after starting from the template, making my changes, closing the file, and trying to open it again, I got the same error, and then I gave up. It only happens with this one report. All others work fine. Could it have to do with any of the new file/model name length (data source file path length, model name length, PBIX path length? I don't have any other hunch.

 

Ivan Miranda Marrero

Status: New
Comments
v-chuncz-msft
Community Support