<?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: GCS Error getting access token from metadata server at: http://169.254.169.254/computeMetadata/v in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/gcs-error-getting-access-token-from-metadata-server-at-http-169/m-p/115478#M45090</link>
    <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/122107"&gt;@KristiLogos&lt;/a&gt;&amp;nbsp;, can you please suggest in what format key was stored in&amp;nbsp;&lt;SPAN&gt;gsa_private_key.Actually we are using key vault based scope&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Apr 2025 08:05:35 GMT</pubDate>
    <dc:creator>ShivangiB</dc:creator>
    <dc:date>2025-04-15T08:05:35Z</dc:date>
    <item>
      <title>GCS Error getting access token from metadata server at: http://169.254.169.254/computeMetadata/v1/in</title>
      <link>https://community.databricks.com/t5/data-engineering/gcs-error-getting-access-token-from-metadata-server-at-http-169/m-p/110025#M43464</link>
      <description>&lt;P&gt;I’m running Databricks on Azure and trying to read a CSV file from Google Cloud Storage (GCS) bucket using Spark. However, despite configuring Spark with a Google service account key, I’m encountering the following error:&lt;/P&gt;&lt;P&gt;Error getting access token from metadata server at:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token" target="_blank" rel="nofollow noopener noreferrer"&gt;http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I’ve configured Spark with these settings to ensure it uses the service account for authentication following this document:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/connect/storage/gcs.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.databricks.com/en/connect/storage/gcs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I’ve configured Spark with these settings to ensure it uses the service account for authentication following this document:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/connect/storage/gcs.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.databricks.com/en/connect/storage/gcs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;spark.conf.&lt;SPAN class=""&gt;set&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"spark.hadoop.google.cloud.auth.service.account.enable"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"true"&lt;/SPAN&gt;) spark.conf.&lt;SPAN class=""&gt;set&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"spark.hadoop.fs.gs.auth.service.account.email"&lt;/SPAN&gt;, client_email) spark.conf.&lt;SPAN class=""&gt;set&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"spark.hadoop.fs.gs.project.id"&lt;/SPAN&gt;, project_id) spark.conf.&lt;SPAN class=""&gt;set&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"spark.hadoop.fs.gs.auth.service.account.private.key"&lt;/SPAN&gt;, private_key) spark.conf.&lt;SPAN class=""&gt;set&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"spark.hadoop.fs.gs.impl"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem"&lt;/SPAN&gt;) spark.conf.&lt;SPAN class=""&gt;set&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"spark.hadoop.fs.AbstractFileSystem.gs.impl"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"com.google.cloud.hadoop.fs.gcs.GoogleHadoopFS"&lt;/SPAN&gt;)spark.conf.&lt;SPAN class=""&gt;set&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"spark.hadoop.fs.gs.auth.service.account.private.key.id"&lt;/SPAN&gt;, private_key_id)&lt;/P&gt;&lt;P&gt;Attempting to read the test csv file from my GCS bucket:&lt;/P&gt;&lt;P&gt;gcs_path = "gs://ddfsdfts/events/31dfsdfs4_2025_02_01_000000000000.csv"&lt;/P&gt;&lt;PRE&gt;df = spark.read.&lt;SPAN class=""&gt;format&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"csv"&lt;/SPAN&gt;) \
    .option(&lt;SPAN class=""&gt;"header"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"true"&lt;/SPAN&gt;) \
    .option(&lt;SPAN class=""&gt;"inferSchema"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"true"&lt;/SPAN&gt;) \
    .load(gcs_path)

df.show()&lt;/PRE&gt;&lt;P&gt;The error happens when trying df.show()&lt;/P&gt;&lt;P&gt;I've seen a few other questions like this but no straight forward answers. Why is it trying to get to the metadata server token?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 17:29:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/gcs-error-getting-access-token-from-metadata-server-at-http-169/m-p/110025#M43464</guid>
      <dc:creator>KristiLogos</dc:creator>
      <dc:date>2025-02-12T17:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: GCS Error getting access token from metadata server at: http://169.254.169.254/computeMetadata/v</title>
      <link>https://community.databricks.com/t5/data-engineering/gcs-error-getting-access-token-from-metadata-server-at-http-169/m-p/110033#M43467</link>
      <description>&lt;P&gt;I figured it out! I hope this helps someone else, I had to update the spark configuration in the cluster I was using, update with this:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/connect/storage/gcs.html#global-configuration" target="_blank"&gt;https://docs.databricks.com/en/connect/storage/gcs.html#global-configuration&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 18:36:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/gcs-error-getting-access-token-from-metadata-server-at-http-169/m-p/110033#M43467</guid>
      <dc:creator>KristiLogos</dc:creator>
      <dc:date>2025-02-12T18:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: GCS Error getting access token from metadata server at: http://169.254.169.254/computeMetadata/v</title>
      <link>https://community.databricks.com/t5/data-engineering/gcs-error-getting-access-token-from-metadata-server-at-http-169/m-p/115478#M45090</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/122107"&gt;@KristiLogos&lt;/a&gt;&amp;nbsp;, can you please suggest in what format key was stored in&amp;nbsp;&lt;SPAN&gt;gsa_private_key.Actually we are using key vault based scope&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 08:05:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/gcs-error-getting-access-token-from-metadata-server-at-http-169/m-p/115478#M45090</guid>
      <dc:creator>ShivangiB</dc:creator>
      <dc:date>2025-04-15T08:05:35Z</dc:date>
    </item>
  </channel>
</rss>

