<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unity Credential Scope id not found in thread locals in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103537#M41473</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/139168"&gt;@kasiviss42&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Are you using any Scala code in your notebook?&lt;/P&gt;
&lt;P&gt;The error &lt;CODE&gt;[UNITY_CREDENTIAL_SCOPE_MISSING_SCOPE] Missing Credential Scope. Unity Credential Scope id not found in thread locals&lt;/CODE&gt; that you are encountering when using &lt;CODE&gt;dbutils.fs.ls&lt;/CODE&gt; 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&lt;/P&gt;</description>
    <pubDate>Mon, 30 Dec 2024 13:03:00 GMT</pubDate>
    <dc:creator>Alberto_Umana</dc:creator>
    <dc:date>2024-12-30T13:03:00Z</dc:date>
    <item>
      <title>Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103528#M41469</link>
      <description>&lt;P&gt;&lt;SPAN&gt;i am facing issue :- [UNITY_CREDENTIAL_SCOPE_MISSING_SCOPE] Missing Credential Scope. Unity Credential Scope id not found in thread locals.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Issue occurs:-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when we try to list files using dbutils.fs.ls&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and also this occurs at times when we try to write or&amp;nbsp; read a parquet file&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This occurs 4 in 10 times a day. This occurs in prod as well .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;No Proper fix has been Documented.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone help here ? This is blocked since many days&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 11:34:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103528#M41469</guid>
      <dc:creator>kasiviss42</dc:creator>
      <dc:date>2024-12-30T11:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103537#M41473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/139168"&gt;@kasiviss42&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Are you using any Scala code in your notebook?&lt;/P&gt;
&lt;P&gt;The error &lt;CODE&gt;[UNITY_CREDENTIAL_SCOPE_MISSING_SCOPE] Missing Credential Scope. Unity Credential Scope id not found in thread locals&lt;/CODE&gt; that you are encountering when using &lt;CODE&gt;dbutils.fs.ls&lt;/CODE&gt; 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&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 13:03:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103537#M41473</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2024-12-30T13:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103597#M41511</link>
      <description>&lt;P&gt;Its python&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 16:52:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103597#M41511</guid>
      <dc:creator>kasiviss42</dc:creator>
      <dc:date>2024-12-30T16:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103600#M41514</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/139168"&gt;@kasiviss42&lt;/a&gt;,&amp;nbsp;Thank you for sharing the error details!&lt;/P&gt;
&lt;P&gt;To provide better guidance, could you clarify the following details about your environment and use case?&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Cluster Configuration&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Are you using a single-user cluster or a shared/multi-user cluster? If single-user, have you set &lt;CODE&gt;spark.databricks.unityCatalog.singleUserAutoGlobalScope&lt;/CODE&gt; to &lt;CODE&gt;true&lt;/CODE&gt;?&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Workload Details&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What type of operation or workload are you running when this error occurs (e.g., a Spark job, Delta Lake operation, or background process)?&lt;/LI&gt;
&lt;LI&gt;Are you using thread pools, asynchronous tasks, or submitting jobs programmatically?&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Specific Context&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Does this issue occur consistently or intermittently?&lt;/LI&gt;
&lt;LI&gt;Have you noticed if certain operations or configurations (e.g., checkpointing, writing to S3, or specific thread usage) trigger the error?&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Setup and Logs&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Are you running this on a free trial or a production workspace?&lt;/LI&gt;
&lt;LI&gt;Can you share the specific stack trace or log details (excluding sensitive information) to help identify where the issue arises?&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 30 Dec 2024 17:16:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103600#M41514</guid>
      <dc:creator>VZLA</dc:creator>
      <dc:date>2024-12-30T17:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103603#M41517</link>
      <description>&lt;P&gt;1. Cluster Configuration&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Policy :- Shared Compute&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Access Mode :- Shared&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Hence we &lt;STRONG&gt;haven't&lt;/STRONG&gt; set&amp;nbsp;singleUserAutoGlobalScope&lt;SPAN&gt;&amp;nbsp;to True.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;WorkLoad Details.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Executing a notebook written in Pyspark .&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;i. We are simply writing dataframe to parquet and read it back.(For kind of checkpointing)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;ii. And using dbutils.fs.ls through volumes&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Above two cases error is thrown intermittently&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;We are not using asynchronous threads or pools &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;3.&lt;/DIV&gt;&lt;DIV class=""&gt;Error is frequently occurring i.e. 40% of the times it fails . 60% it succeeds. We need a code to be 100% succeeding&lt;/DIV&gt;&lt;DIV class=""&gt;We have noticed failures when dbutils.fs.ls is being executed in the code. as well as when we write dataframe to parquet or read the dataframe written in parquet back&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;4.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;We are running on a prod workspace.&lt;/DIV&gt;&lt;DIV class=""&gt;i. Below error occurs when a parquet file is written or read&lt;/DIV&gt;&lt;DIV class=""&gt;Below is the underlying error caused by :-&amp;nbsp;(com.databricks.backend.daemon.data.common.InvalidMountException)&lt;/DIV&gt;&lt;DIV class=""&gt;Caused by: com.databricks.unity.error.MissingCredentialScopeException: [UNITY_CREDENTIAL_SCOPE_MISSING_SCOPE] Missing Credential Scope. Unity Credential Scope id not found in thread locals.. SQLSTATE: XXKUC&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;ii. Below error occurs when dbutils.fs.ls is being executed.&lt;/DIV&gt;&lt;DIV class=""&gt;Exception: An error occurred while calling o542.ls.&lt;BR /&gt;: com.databricks.backend.daemon.data.common.InvalidMountException:&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Strange thing here is both the code is same notebook .&lt;/DIV&gt;&lt;DIV class=""&gt;One time it fails at parquet read but succeeds dbutils.fs.ls&lt;/DIV&gt;&lt;DIV class=""&gt;other time it fails at dbutils.fs.ls itself&amp;nbsp; .&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Please suggest&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Dec 2024 17:51:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103603#M41517</guid>
      <dc:creator>kasiviss42</dc:creator>
      <dc:date>2024-12-30T17:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103624#M41521</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/139168"&gt;@kasiviss42&lt;/a&gt;&amp;nbsp;thanks for sharing these details.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can potentially get to the root cause by enabling the&amp;nbsp;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 20:31:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/103624#M41521</guid>
      <dc:creator>VZLA</dc:creator>
      <dc:date>2024-12-30T20:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106913#M42638</link>
      <description>&lt;P&gt;Any solution for this, I am facing this too when creating a thread and using SQL query inside it&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 14:26:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106913#M42638</guid>
      <dc:creator>ashishCh</dc:creator>
      <dc:date>2025-01-24T14:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106929#M42645</link>
      <description>&lt;P&gt;Use dbr 15.4 lts and try once&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:27:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106929#M42645</guid>
      <dc:creator>kasiviss42</dc:creator>
      <dc:date>2025-01-24T16:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106933#M42647</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;BR /&gt;Its working in dbr 15.4 but I want to use it with 13.3, is there a workaround?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 17:02:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106933#M42647</guid>
      <dc:creator>ashishCh</dc:creator>
      <dc:date>2025-01-24T17:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106935#M42649</link>
      <description>&lt;P&gt;Databricks has released the fix in DBR 15.4 LTS&lt;/P&gt;&lt;P&gt;not sure if there is any work around for &amp;lt; 15.4 versions&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 17:40:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106935#M42649</guid>
      <dc:creator>kasiviss42</dc:creator>
      <dc:date>2025-01-24T17:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unity Credential Scope id not found in thread locals</title>
      <link>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106938#M42650</link>
      <description>&lt;P&gt;Thanks for the information.&amp;nbsp;&lt;BR /&gt;Can you share me the link where they have mentioned that this has been fixed.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 17:51:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unity-credential-scope-id-not-found-in-thread-locals/m-p/106938#M42650</guid>
      <dc:creator>ashishCh</dc:creator>
      <dc:date>2025-01-24T17:51:42Z</dc:date>
    </item>
  </channel>
</rss>

