Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Solved! Go to 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.
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.
Check out the November 2025 Fabric update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!