Unity Credential Scope id not found in thread locals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 03:34 AM
i am facing issue :- [UNITY_CREDENTIAL_SCOPE_MISSING_SCOPE] Missing Credential Scope. Unity Credential Scope id not found in thread locals.
Issue occurs:-
when we try to list files using dbutils.fs.ls
and also this occurs at times when we try to write or read a parquet file
This occurs 4 in 10 times a day. This occurs in prod as well .
No Proper fix has been Documented.
Can someone help here ? This is blocked since many days
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 05:03 AM
Hi @kasiviss42,
Are you using any Scala code in your notebook?
The error [UNITY_CREDENTIAL_SCOPE_MISSING_SCOPE] Missing Credential Scope. Unity Credential Scope id not found in thread locals
that you are encountering when using dbutils.fs.ls
and while reading or writing parquet files is a known issue related to Unity Catalog in Databricks. This issue occurs because Unity Credential Scopes are stored as thread locals, and in certain scenarios, such as when using Scala thread pools, these scopes are not transferred to the new threads, leading to the error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 08:52 AM
Its python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 09:16 AM
Hi @kasiviss42, Thank you for sharing the error details!
To provide better guidance, could you clarify the following details about your environment and use case?
-
Cluster Configuration:
- Are you using a single-user cluster or a shared/multi-user cluster? If single-user, have you set
spark.databricks.unityCatalog.singleUserAutoGlobalScope
totrue
?
- Are you using a single-user cluster or a shared/multi-user cluster? If single-user, have you set
-
Workload Details:
- What type of operation or workload are you running when this error occurs (e.g., a Spark job, Delta Lake operation, or background process)?
- Are you using thread pools, asynchronous tasks, or submitting jobs programmatically?
-
Specific Context:
- Does this issue occur consistently or intermittently?
- Have you noticed if certain operations or configurations (e.g., checkpointing, writing to S3, or specific thread usage) trigger the error?
-
Setup and Logs:
- Are you running this on a free trial or a production workspace?
- Can you share the specific stack trace or log details (excluding sensitive information) to help identify where the issue arises?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 09:51 AM
1. Cluster Configuration
: com.databricks.backend.daemon.data.common.InvalidMountException:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 12:31 PM
@kasiviss42 thanks for sharing these details.
We can potentially get to the root cause by enabling the traceLogging for UC, but the communication will not be efficient through this channel. Could you please raise a Support Ticket? We'd like to help you address this problem or at the very least find a workaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 06:26 AM
Any solution for this, I am facing this too when creating a thread and using SQL query inside it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 08:27 AM
Use dbr 15.4 lts and try once
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 09:02 AM
Thanks for the reply.
Its working in dbr 15.4 but I want to use it with 13.3, is there a workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 09:40 AM
Databricks has released the fix in DBR 15.4 LTS
not sure if there is any work around for < 15.4 versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 09:51 AM
Thanks for the information.
Can you share me the link where they have mentioned that this has been fixed.

