<?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: Is the databricks token expired? in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156663#M11769</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/229708"&gt;@pikachu89&lt;/a&gt;,&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3f3 _1ibi0s3ce _1ibi0s3e8" data-pm-slice="1 1 []"&gt;Thanks for the clarification. If the client is already being created during inference, then the usual stale-client explanation does not apply. Even then... this still does not look like an expected 13-day token lifetime. In Model Serving, the SDK resolves auth per request, and the serving runtime rereads the injected token source at a short cadence rather than holding a single token for days.&lt;/P&gt;
&lt;P&gt;Given that a stop/start immediately fixes it, this points more to a server-side token refresh or a runtime auth issue than to something obviously wrong in your code. The best path is to raise a support ticket and submit the exact timestamp of the failure, the HTTP status and response body, request IDs, and confirmation that the downstream endpoint permissions for the service account did not change.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is also worth moving off get_open_ai_client(), since that path is deprecated in favour of the newer Databricks OpenAI client.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2026 09:55:21 GMT</pubDate>
    <dc:creator>Ashwin_DSA</dc:creator>
    <dc:date>2026-05-12T09:55:21Z</dc:date>
    <item>
      <title>Is the databricks token expired?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156515#M11759</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I set up a serverless endpoint for my agent via an S-account. This S-account is also granted access to another serverless endpoint. During the inference of my endpoint, I use the Databricks SDK to connect to the other endpoint without explicitly declaring the BEARER TOKEN:&lt;BR /&gt;```&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;workspace_client &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;WorkspaceClient&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;client &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; workspace_client.serving_endpoints.&lt;/SPAN&gt;&lt;SPAN&gt;get_open_ai_client&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;response &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;client.responses.&lt;/SPAN&gt;&lt;SPAN&gt;create&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;model&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;tool_config[&lt;/SPAN&gt;&lt;SPAN&gt;'endpoint_name'&lt;/SPAN&gt;&lt;SPAN&gt;],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;input&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;request.&lt;/SPAN&gt;&lt;SPAN&gt;get&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"input"&lt;/SPAN&gt;&lt;SPAN&gt;, []),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;stream&lt;/SPAN&gt;&lt;SPAN&gt;=False&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;extra_body&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"user"&lt;/SPAN&gt;&lt;SPAN&gt;: request.&lt;/SPAN&gt;&lt;SPAN&gt;get&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"user"&lt;/SPAN&gt;&lt;SPAN&gt;, []),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"databricks_options"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;dict&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;return_trace&lt;/SPAN&gt;&lt;SPAN&gt;=False&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;```&lt;BR /&gt;I noticed that after more than 13 days without any updates of both endpoints. I got the access deny from the other endpoint. If I stop and then start my endpoint, it works again. May someone explain the token lifetime to me? Or on how does this happen? Thank you very much.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2026 00:09:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156515#M11759</guid>
      <dc:creator>pikachu89</dc:creator>
      <dc:date>2026-05-11T00:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is the databricks token expired?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156537#M11760</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/229708"&gt;@pikachu89&lt;/a&gt;,&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;From what I can see, this does not appear to be the expected 13-day bearer token lifetime. In Model Serving, the SDK is designed to resolve auth on each request, and in the serving runtime, the injected token is read from the mounted credentials file and only cached for 300 seconds before being reread. Given that restarting the endpoint restores functionality, this points more to stale runtime auth state than to an intended token expiry.&lt;/P&gt;
&lt;P data-pm-slice="1 1 []"&gt;As a practical mitigation, I’d suggest creating the WorkspaceClient inside the inference path rather than at model load time, and if possible moving to the newer databricks-openai client since get_open_ai_client() is now deprecated.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2026 08:50:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156537#M11760</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-05-11T08:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is the databricks token expired?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156550#M11761</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;Yes ! it seems so &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;WorkspaceClient() is not anonymous and your get_open_ai_client() uses the DBKS auth attached to that WorkspaceClient to query serving endpoints.&amp;nbsp; OpenAI client must be preconfigured with DBKS auth for the workspace client.&lt;/P&gt;&lt;P&gt;So if your endpoint process is long lived and the SDK/OpenAI client is created once and reused it may be holding a stale credential.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For SP or oauth , DBKS oauth access tokens are valid for 1 hour&amp;nbsp;and unified authentication should request new tokens automatically when configured correctly. If you manually generate tokens, you must refresh them yourself.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2026 09:29:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156550#M11761</guid>
      <dc:creator>amirabedhiafi</dc:creator>
      <dc:date>2026-05-11T09:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is the databricks token expired?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156621#M11763</link>
      <description>&lt;P&gt;As I described earlier, the client is loaded only during inference time, not at model loading. Still I got the auth denied problem.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2026 00:22:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156621#M11763</guid>
      <dc:creator>pikachu89</dc:creator>
      <dc:date>2026-05-12T00:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is the databricks token expired?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156663#M11769</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/229708"&gt;@pikachu89&lt;/a&gt;,&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3f3 _1ibi0s3ce _1ibi0s3e8" data-pm-slice="1 1 []"&gt;Thanks for the clarification. If the client is already being created during inference, then the usual stale-client explanation does not apply. Even then... this still does not look like an expected 13-day token lifetime. In Model Serving, the SDK resolves auth per request, and the serving runtime rereads the injected token source at a short cadence rather than holding a single token for days.&lt;/P&gt;
&lt;P&gt;Given that a stop/start immediately fixes it, this points more to a server-side token refresh or a runtime auth issue than to something obviously wrong in your code. The best path is to raise a support ticket and submit the exact timestamp of the failure, the HTTP status and response body, request IDs, and confirmation that the downstream endpoint permissions for the service account did not change.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is also worth moving off get_open_ai_client(), since that path is deprecated in favour of the newer Databricks OpenAI client.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2026 09:55:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/is-the-databricks-token-expired/m-p/156663#M11769</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-05-12T09:55:21Z</dc:date>
    </item>
  </channel>
</rss>

