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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Object reference not set to an instance of an object

I have a report which uses an excel file in sharepoint as its source. When I refresh the report in Power BI desktop, I get the error 'Object reference not set to an instance of an object'. This report was working file till yesterday. Can someone help me with this? Has anything changed in the latest release of desktop?

 

Release:
October 2021

Product Version:
2.98.683.0 (21.10) (x64)

 

 

Error Message:
Object reference not set to an instance of an object.

Stack Trace:
System.NullReferenceException
at Microsoft.Mashup.Client.UI.Shared.Controllers.JsonOAuthCredentialData..ctor(TokenCredential credential)
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.ChallengeFloatingDialogBase.JsOAuthDialogResult.ToJson(OAuthDialogResult oAuthDialogResult)
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.ChallengeFloatingDialogBase.InvokeChallengeOAuthDialogCallback(IJsHostedScript jsHostedScript, OAuthDialogResult oAuthDialogResult)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

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.<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 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.WebDialogs.WebDialog.<>n__0(IWindowHandle owner)
at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.ChallengeEditFloatingDialog.Show(IWindowHandle owner, IUIHost uiHost, CredentialsStorage credentialsStorage, PackageReference packageReference, FormulaPath formulaPath, ResourceChallenge resourceChallenge, ITelemetryService telemetryService, Credential existingCredential, Credential& newCredential)
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.KoEditDataSourcePermissionsDialogBase.<>c__DisplayClass38_0.<OnEditClick>b__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.Windows.DialogWindowBase.ShowModal(IWindowHandle windowHandle)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.<>n__0(IWindowHandle owner)
at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.KoEditCurrentFilePermissionsDialog.Show(IWindowHandle owner, PackagePath packagePath, Int32 sessionID, IUIHost uiHost, Boolean isWorkbookLocked, JsonDataSourceEntry entry, CredentialsStorage credentialsStorage, QueryPermissionsStorage queryPermissionsStorage, FirewallStorage firewallStorage, PackageReference packageReference, ITelemetryService telemetryService, IApplicationSettings settings)
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.KoBaseManageDataSourcesDialog.EditEntries()
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.Windows.DialogWindowBase.ShowModal(IWindowHandle windowHandle)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.<>n__0(IWindowHandle owner)
at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.PowerBI.Client.Windows.Services.PowerBIWindowServiceExtensions.<>c__DisplayClass0_0.<ExecuteWithLegacyOwnerWindow>b__0(IWindowHandle ownerWindow)
at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoManageDataSourcesDialog.Show(IPowerBIWindowService windowService, IQueryServices queryServices, IGetServiceDatasetProvider getServiceDataSetProvider)
at Microsoft.PowerBI.Client.Windows.LocalDataSourceUI.Show(IUIHost uiHost, IPowerBIWindowService windowService)
at Microsoft.PowerBI.Client.Windows.Commands.ApplicationCommands.DataImportCommands.<ShowDataSourceSettingsDialog>d__43.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.PowerBI.Client.Windows.Commands.ApplicationCommands.DataImportCommands.ShowDataSourceSettingsDialog(IPowerBIWindowService windowService, IExceptionHandler exceptionHandler, ShowDataSourceSettingsDialogParameters parameters)
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<HandleAwaitableAsyncExceptions>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.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.ManageSettings(String id)
at Microsoft.PowerBI.Client.Windows.FileMenuHostService.<>c__DisplayClass19_0.<HandleMenuItem>b__0()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<HandleAwaitableAsyncExceptions>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.<HandleAsyncExceptions>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.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, Func`1 showModalFunction)
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)
at Microsoft.PowerBI.Client.Program.Main(String[] args)


PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.98.683.0","ModuleName":"Microsoft.Mashup.Client.UI.dll","Component":"Microsoft.Mashup.Client.UI.Shared.Controllers.JsonOAuthCredentialData","Error":"System.NullReferenceException","MethodDef":".ctor","ErrorOffset":"0"}

 

 

I also get this error,

Unexpected error: Specified value has invalid CRLF characters.
Parameter name: value
Details:
Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified value has invalid CRLF characters.
Parameter name: value ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified value has invalid CRLF characters.
Parameter name: value ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified value has invalid CRLF characters.
Parameter name: value ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified value has invalid CRLF characters.
Parameter name: value ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified value has invalid CRLF characters.
Parameter name: value ---> System.ArgumentException: Specified value has invalid CRLF characters.
Parameter name: value ---> System.ArgumentException: Specified value has invalid CRLF characters.

Status: Investigating
Comments
v-chuncz-msft
Community Support
Status changed to: Investigating
 
v-chuncz-msft
Community Support

@Quest 

 

I tried the latest version to create a report and all seem to be working fine. Try to clear permissions in data source settings.

Quest
Advocate I

I have already tried that Option. This is only for one datasource which is accessing an xlsx file in sharepoint. 

Quest
Advocate I

I would add that any file that I access from sharepoint site is giving me this error:

Stack Trace:
Microsoft.Mashup.Client.UI.Shared.ExceptionResultException
Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified value has invalid CRLF characters.
Parameter name: value ---> System.ArgumentException: Specified value has invalid CRLF characters.
Parameter name: value ---> System.ArgumentException: Specified value has invalid CRLF characters.
Parameter name: value
at System.Net.WebHeaderCollection.CheckBadChars(String name, Boolean isHeaderValue)
at System.Net.WebHeaderCollection.Set(String name, String value)
at System.Net.WebHeaderCollection.set_Item(HttpRequestHeader header, String value)

 

 

The formula is 

shared #"Set%Tracker" = let
Source = Web.Contents("https://tenant.sharepoint.com/sites/library/folder/Shared%20Documents/folder/Set%20Tracker.xlsx")
in
Source;

Anonymous
Not applicable

Having problems in GCC as well with SharePoint datasources with the October 2021 update. Everything worked fine until today, SharePoint data sources now give the 'Object reference not set to an instance of an object' error. Reported the issue.

Anonymous
Not applicable

@Quest @v-chuncz-msft 

 

Just a quick followup, after troubleshooting it turns out only SharePoint datasources without HTTPS at the begining were displaying the error. Adding https:// to the start of my SharePoint datasources has resolved the issue. Hope this helps.

Anonymous
Not applicable

dlprentice_0-1634566603583.jpeg

dlprentice_1-1634566610584.jpeg

 

 

suyoga
Regular Visitor

I am facing the same issue as well since last Monday 

StNi
Frequent Visitor

Same problem here (v. 2.99.621.0)

AudLTxr
New Member

I have the exact same issue. And all my Sharepoint data sources are in https. Any ideas ?