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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Cannot deserialize - fails to open

This is the second time I've gotten this particular message.  My coworkers have gotten this message as well and to the best of our ability we cannot figure out how to fix the problem.  This results in many many hours of wasted work being required to rebuild reports.  I would like to either know how to fix the issue or know what I need to do to make sure it doesn't ever occur again.

 

Feedback Type:
Frown (Error)

Error Message:
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IReadOnlyDictionary`2[System.String,Microsoft.PowerBI.Packaging.Storage.QueryResourceInfoStorage]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'DirectQueryResources', line 1, position 266.

Stack Trace:
Newtonsoft.Json.JsonSerializationException
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at Microsoft.PowerBI.Packaging.PowerBIPackagingUtils.DeserializeSettingsJson[T](JObject jsonContent, Int32 expectedVersion)
at Microsoft.PowerBI.Packaging.ReportMetadataUtils.TryDeserializeReportMetadata(IStreamablePowerBIPackagePartContent streamablePowerBIPackagePartContent, Version pbixFileVersion, ReportMetadataContainer& reportMetadataContainer)
at Microsoft.PowerBI.Client.Windows.Services.ReportFactory.DeserializeReportMetadata(IStreamablePowerBIPackagePartContent streamablePowerBIPackagePartContent, Version pbixFileVersion)
at Microsoft.PowerBI.Client.Windows.Services.ReportFactory.<CreateReportFromPowerBIPackage>d__1.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.PowerBIPackagingService.<Open>d__5.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.FileManager.<LoadFromPbix>d__24.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__DisplayClass13_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(IPowerBIWindowService windowService, IFileManager fileManager, IFileHistoryManager fileHistoryManager, String filePath, FileType fileType, IFileInformationProtectionManager fileInformationProtectionManager)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_1.<Main>b__2()
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:
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IReadOnlyDictionary`2[System.String,Microsoft.PowerBI.Packaging.Storage.QueryResourceInfoStorage]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'DirectQueryResources', line 1, position 266.

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__DisplayClass14_0.<HandleException>b__0()
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.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.105.1143.0","ModuleName":"Microsoft.PowerBI.Packaging.dll","Component":"Microsoft.PowerBI.Packaging.PowerBIPackagingUtils","Error":"Newtonsoft.Json.JsonSerializationException","MethodDef":"DeserializeSettingsJson","ErrorOffset":"15"}

PowerBIUserFeedbackServices_IsReported:
True

Status: Investigating
Comments
Anonymous
Not applicable

Hi @Anonymous ,

 

Please update to the latest version Power BI Desktop.

Also check you are running the 32- or 64-bit version that matches your operating system,

and reboot your computer and then try to run Power BI desktop with admin, then open the report via File -> Open in Power BI desktop. 

 

Regards,

Caitlyn

Anonymous
Not applicable

Yes, I have tried those steps because that was the only suggestion I found prior to posting here.  It did not fix the issue.  It sitll gives the same thing.

Anonymous
Not applicable

Hi @Anonymous

 

Based on the above information, if you are a Power BI Pro licensee, you can create a support ticket for free and a dedicated Microsoft engineer will come to solve the problem for you.
It would be great if you continue to share in this issue to help others with similar problems after you know the root cause or solution.

 

The link of Power BI Support: Support | Microsoft Power BI

For how to create a support ticket, please refer to How to create a support ticket in Power BI - Microsoft Power BI Community

 

Best Regards,
Community Support Team _ Caitlyn

mwrdm
Frequent Visitor

Hi all,

 

I had this issue today and managed to resolve it. Mine was with "PendingConceptualSchemaFilters" rather than "DirectQueryResources" as described in the first post in this thread but I believe it is the same issue.

 

Here is how I did it:

 

  1. Install 7-zip
  2. Right click on your .pbix file and click "Open archive" in the 7-zip options
  3. Open the Metadata file from the directory in a text editor such as Notepad++ (or just Notepad).
  4. Locate the object (in my case, PendingConceptualSchemaFilters).

    mwrdm_0-1680471310650.png

     

  5. You can see that there is nothing in the array. For that reason, I simply deleted the object

    mwrdm_1-1680471352774.png

     

  6. Now, the Metadata file you are working on is NOT actually the one inside the pbix file. If you check the path, it is probably in a temp directory. For that reason, you need to save the file and then drag it into the 7-zip window (where you have the pbix directory open) and overwrite the existing Metadata file.

I recommend creating a copy of the pbix file to do this on, in case you mess something else up.

 

Good luck.