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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
gaya3krishnan86
New Contributor II

Spark sql execution for SPN fails with mwc token error

Is anyone else getting mwc token error on spark.sql execution with SPN accounts? SPN has contributor permission on the workspaces and the query refers to shortcut. Any ideas what can cause this? 

 

Thanks,

Gayatri

1 ACCEPTED SOLUTION

It looks like it fails for a named user too all of sudden but worked fine with workspace identity at the same time. Seems like some intermittent issue.

View solution in original post

3 REPLIES 3
v-veshwara-msft
Honored Contributor II

Hi @gaya3krishnan86 ,

Thanks for posting in Microsoft Fabric Community.

The mwc token error when executing spark.sql with Service Principal accounts is usually tied to authentication and token handling. Even if the SPN has Contributor permissions on the workspace, it also needs the right data permissions on the underlying storage used by the shortcut. Please make sure the SPN is properly added as an identity in the Fabric workspace and can access the referenced data source.

 

From the behavior you described, since this involves a shortcut, testing a direct query on a Lakehouse or Warehouse table without the shortcut can help isolate if the issue is shortcut-specific.

 

Similar issues have been reported when running Spark SQL queries. Restarting the kernel can sometimes result in a โ€œcapacity limit exceededโ€ exception, indicating that session or capacity availability can contribute to the error: Solved: Re: Spark SQL error: MetaException(message: Unable... - Microsoft Fabric Community

 

There have also been cases where Spark SQL jobs in Fabric returned mwc token errors due to regional outages or bugs in the Spark engine. These incidents were intermittent and region-specific, and in some cases the issue resolved on retry.

For reference, you can check: Solved: Re: Spark SQL error: MetaException(message: Unable... - Microsoft Fabric Community

 

Hope this helps. Please reach out for further assistance.

Thank you.

 

It looks like it fails for a named user too all of sudden but worked fine with workspace identity at the same time. Seems like some intermittent issue.

Hi @gaya3krishnan86 ,
Thanks for confirming this. Since it also fails for a named user but works with the workspace identity, it appears to be an intermittent platform issue.

If you need further assistance, please reach out.

 

Thank you.

Helpful resources

Announcements
Users online (9,585)