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.

Reply
CMcAlpine
Frequent Visitor

Error 400 Bad Request when publishing a PBIX file

Getting an error when attempting to publish a desktop file. The file had been publishing perfectly fine prior to this, and if I rename the pbix file it publishes fine, the issue is I have multiple reports created in the service off of this datasource that I would lose and have to re-create if i have to rename the datasource and/or delete the datasource and re-import.

 

Any help would be appreciated.

 

 

Error Message:

The remote server returned an error: (400) Bad Request.

Stack Trace:

Microsoft.PowerBI.Client.Windows.PowerBIService.PowerBIServiceException: The remote server returned an error: (400) Bad Request. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.PowerBI.Client.Windows.PowerBIService.ServiceProxyRequest.GetResponse[T]()
at Microsoft.PowerBI.Client.Windows.PowerBIService.PowerBIServiceProxy.GetResponse[T](ServiceProxyRequest request)
--- End of inner exception stack trace ---
at Microsoft.PowerBI.Client.Windows.PowerBIService.PowerBIServiceProxy.GetResponse[T](ServiceProxyRequest request)
at Microsoft.PowerBI.Client.Windows.PowerBIService.PowerBIServiceProxy.UploadReportFile(String groupId, Boolean overwrite, CancellationToken cancellationToken, String activityId)
at Microsoft.PowerBI.Client.Windows.PowerBIService.Flows.PublishReportFlow.<>c__DisplayClass10.<PublishReport>b__f()
at Microsoft.PowerBI.Client.Windows.PowerBIService.Flows.BaseFlow`1.MakeWebRequest(WebRequestFunc webRequest, Int32 maxTriesAllowed)
at Microsoft.PowerBI.Client.Windows.PowerBIService.Flows.PublishReportFlow.PublishReport(IFileManager fileManager, String activityId, Boolean overwrite, Boolean configureGateway, PromptUserForGatewayFunc promptUserForGatewayCallback, CancellationToken cancellationToken, String& reportUrl, String& datasetId, Boolean& gatewayConfigured, Boolean& dataSourceNeedsCredentials)
at Microsoft.PowerBI.Client.Windows.PowerBIService.Flows.PublishReportFlow.<ExecuteInternal>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoPublishDialog.<<OnLoad>b__4>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<HandleAsyncExceptions>d__0.MoveNext()

Invocation Stack Trace:

at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.ClientShared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace)
at Microsoft.Mashup.Client.ClientShared.FeedbackErrorInfo..ctor(String message, Nullable`1 errorCode, String requestId, Exception exception)
at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<HandleAsyncExceptions>d__0.MoveNext()
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.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
at System.Threading.Tasks.Task.FinishContinuations()
at System.Threading.Tasks.Task.Finish(Boolean bUserDelegateExecuted)
at System.Threading.Tasks.Task`1.TrySetException(Object exceptionObject)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception)
at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoPublishDialog.<<OnLoad>b__4>d__5.MoveNext()
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.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
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.ClientShared.WindowManager.ShowDialog[T](T form, IWin32Window owner)
at Microsoft.Mashup.Client.ClientShared.Ux.FloatingDialog.FloatingDialog.ShowDialogWithTimeout(IWin32Window owner, Nullable`1 showTimeout)
at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoPublishDialog.ShowDialogAndPublish()
at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoPublishDialog.TryShowDialogAndPublish(String groupId, IWin32Window ownerWindow, WindowsHost windowsHost, IWindowService shellService, IReportManager reportManager, IFileManager fileManager, IPowerBIServiceClient powerBIServiceClient, IAuthenticationManager authenticationManager, IClusterManager clusterManager, Boolean configureGateway, TelemetryUserActionId entryPoint, LocalizedString title)
at Microsoft.PowerBI.Client.Windows.MainWindow.<>c__DisplayClass39.<<PublishReport>b__37>d__3c.MoveNext()
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.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
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.ClientShared.WindowManager.ShowDialog[T](T form, IWin32Window owner)
at Microsoft.Mashup.Client.ClientShared.Ux.FloatingDialog.SimpleDialog.StatusDialog.ShowStatusDialog(IWin32Window owner, Action cancelCallback, Nullable`1 showTimeoutInMs)
at Microsoft.PowerBI.Client.Windows.Services.WindowService.ShowStatusDialog(LocalizedString message, Action cancelCallback, Nullable`1 showDelayInMs)
at Microsoft.PowerBI.Client.Windows.BusyHelper.ShowBusyDialog(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.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.ClientShared.WindowManager.ShowDialog[T](T form, IWin32Window owner)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClassc.<Main>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)


BackendUrl
https://api.powerbi.com/

ActivityId
e2fdbd25-ff6e-4ec7-a918-6ff7e78c17d2

RequestId
cd32805a-0170-4013-bf65-f98d1dfc448a

HttpStatusCode
BadRequest

ErrorDetails
{"code":"ExcelWorkbookAlreadyImported","pbi.error":{"code":"ExcelWorkbookAlreadyImported","parameters":{},"details":[]},"error":{"code":"ExcelWorkbookAlreadyImported","pbi.error":{"code":"ExcelWorkbookAlreadyImported","parameters":{},"details":[]}}}

ErrorCode
ExcelWorkbookAlreadyImported

 

6 REPLIES 6
v-qiuyu-msft
Community Support
Community Support

Hi @CMcAlpine,

 

According to your description, you have the same dataset in Power BI Service, and you have created many reports based on this dataset. Now you want to publish the .PBIX file which contains the same dataset name, right?

 

When you publish the report to Power BI Service, make sure only one dataset with the same name in service. Otherwise, the publish will fail. Also please check if the issue occurs when you Get Data->Files->Local Files to publish .PBIX file. For more information, please refer to this article: Publish from Power BI Desktop.

 

If you have any question, please feel free to ask.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-qiuyu-msft 

 

Am getting the same error.

 

As you suggested, there are datasets with samename in power bi service. But those are in differen workspaces. Will it still cause an issue. Am using the one belongs to Manoj Gadde. Getting the error "The remote server returned an error: (400) Bad Request." while publishing.

Kannan_Thiyaga_0-1610347347208.png

 

 

I have had this issue multiple times, and logged a but with MS today.  To solve my problem, I deleted the workbook from the service, and then republished it again.  If you have lots of pinned tiles, this is a pain in the butt, but no other way I know of.  Also I had my pbix as part of a content pack, and had to delete the content pack first before I could remove the pbix.

 

I recommend you log  bug first (to get some attention on the problem), then execute what ever work around you need to move forward.

 

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Yup there doesn't seem to be a rhyme or reason, or if it is it's on the service side and it's definately a bug, will be logging it for visbility.

 

Still getting the issue, for instance last night changed one of the data sets, tried to publish for over 2 hours without success (Same error as above).

 

Go home, come in first thing in the morning, file is still open on my dekstop from last night, click publish and it was successful. I just wish i knew why and had a dependable work around, but it makes having a deployment schedule and change release management a nightmare.

 

 

Hi @CMcAlpine,

 

On the forum side, it's hard for us to provide any more support about this issue. I would suggest you open a support ticket to get dedicated support from the Microsoft personally.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-qiuyu-msft: I appreciate your effort in the matter, i've just logged a support request now. Thanks again all! Hopefully we get an answer soon.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.