Forum Discussion
'Message': 'Internal error MwcTokenValidationException.', 'Source': 15, 'ErrorCode': 0
- Anonymous9 months ago
Hi cesarniyo ,
In Microsoft Fabric, when you run a job manually, it executes under your user identity, and Fabric automatically provides a valid workspace token. That’s why MLflow works in that case.
When the job is triggered via a pipeline, it runs under the pipeline execution identity (usually the workspace managed identity or a configured service principal), not your user account. This identity must be explicitly granted Contributor or higher access to the Fabric workspace. If it isn’t, the Fabric MLflow gateway cannot validate the token and throws MwcTokenValidationException.
To resolve your issue, please check the workspace access and ensure the pipeline’s execution identity has Contributor/Admin permissions. No code changes or manual token handling are required.
Once permissions are updated, MLflow calls from the pipeline should work the same way as manual runs.
Thank you.
Hi cesarniyo,
Thanks for sharing the detailed error message.
Based on the traceback, it looks like the issue is related to MLflow authentication or token validation when the Spark job is executed through the Fabric pipeline.
Since the job runs successfully when triggered manually but fails during pipeline execution, one possible reason is a difference in the execution identity or authentication context between interactive notebook execution and pipeline-triggered execution.
I would suggest checking the following:
1. **Execution Identity:** Verify which identity is used when the pipeline triggers the Spark job.
2. **MLflow Authentication:** Check whether the pipeline execution context has the required permissions to access the MLflow tracking service.
3. **Workspace Permissions:** Ensure the executing identity has appropriate access to the workspace and MLflow experiment.
4. **Token Handling:** Avoid relying on interactive session tokens. Check whether authentication is correctly established in the pipeline execution context.
5. **Runtime Compatibility:** Verify that the MLflow and Synapse ML library versions are compatible with your Fabric Spark environment.
One important thing to investigate is whether the pipeline-triggered execution uses the same identity and permissions as the manual execution.
It would also be helpful to know whether you are triggering a Fabric notebook or a Spark job definition through the pipeline.
Hope these checks help narrow down the issue!
Best regards,
Binita Fulpagare