<?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 Terraform Failed to get oauth access token. Please retry after logout and login again. with GCP in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/83330#M1585</link>
    <description>&lt;P&gt;Hi I'm having trouble creating a databricks_mws_vpc_endpoint with Terraform.&lt;BR /&gt;&lt;BR /&gt;I already created 2 Private Service Connect (PSC) and I'm trying to create the vpc endpoint for Databricks but I'm getting this error:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#FF0000"&gt;BAD_REQUEST: Failed to get oauth access token. Please retry after logout and login again.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;This is my terraform:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;provider "databricks" {
    alias = "accounts"
    profile = "DEFAULT"
}

resource "databricks_mws_vpc_endpoint" "backend_rest_vpce" {
    provider = databricks.accounts
    account_id = var.databricks_account_id
    vpc_endpoint_name = "vpce-backend-rest-ven"
    gcp_vpc_endpoint_info {
        project_id = var.network_project_id
        psc_endpoint_name = var.backend_rest_psce
        endpoint_region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Configure my credentials inside the .databrickscfg and I'm using a service principal to create databricks resources. Also I tested my credentials with the databricks CLI and the work perfectly.&lt;BR /&gt;&lt;BR /&gt;If I created manually they are working fine as well.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sat, 17 Aug 2024 21:54:48 GMT</pubDate>
    <dc:creator>NelsonE</dc:creator>
    <dc:date>2024-08-17T21:54:48Z</dc:date>
    <item>
      <title>Terraform Failed to get oauth access token. Please retry after logout and login again. with GCP</title>
      <link>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/83330#M1585</link>
      <description>&lt;P&gt;Hi I'm having trouble creating a databricks_mws_vpc_endpoint with Terraform.&lt;BR /&gt;&lt;BR /&gt;I already created 2 Private Service Connect (PSC) and I'm trying to create the vpc endpoint for Databricks but I'm getting this error:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT color="#FF0000"&gt;BAD_REQUEST: Failed to get oauth access token. Please retry after logout and login again.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;This is my terraform:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;provider "databricks" {
    alias = "accounts"
    profile = "DEFAULT"
}

resource "databricks_mws_vpc_endpoint" "backend_rest_vpce" {
    provider = databricks.accounts
    account_id = var.databricks_account_id
    vpc_endpoint_name = "vpce-backend-rest-ven"
    gcp_vpc_endpoint_info {
        project_id = var.network_project_id
        psc_endpoint_name = var.backend_rest_psce
        endpoint_region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Configure my credentials inside the .databrickscfg and I'm using a service principal to create databricks resources. Also I tested my credentials with the databricks CLI and the work perfectly.&lt;BR /&gt;&lt;BR /&gt;If I created manually they are working fine as well.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 17 Aug 2024 21:54:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/83330#M1585</guid>
      <dc:creator>NelsonE</dc:creator>
      <dc:date>2024-08-17T21:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform Failed to get oauth access token. Please retry after logout and login again. with GCP</title>
      <link>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/83447#M1596</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/116426"&gt;@NelsonE&lt;/a&gt;, Please&amp;nbsp;try&amp;nbsp;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;databricks auth login&lt;/CODE&gt;&amp;nbsp;again. Also, could you please share some error stacks?&lt;BR /&gt;Additionally, please share the workspace ID (send an email to &lt;A href="mailto:community@databricks.com" target="_blank"&gt;community@databricks.com&lt;/A&gt;)&amp;nbsp;/ GCP region so that we can investigate on it further.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 13:24:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/83447#M1596</guid>
      <dc:creator>Retired_mod</dc:creator>
      <dc:date>2024-08-19T13:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform Failed to get oauth access token. Please retry after logout and login again. with GCP</title>
      <link>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/84439#M1651</link>
      <description>&lt;P&gt;The solution was the type of auth type that I was using with Databricks. It start working when I created a service account in my GCP project, then I changed that I could make request on behalf of that user and I added the user into Databricks account.&lt;BR /&gt;&lt;BR /&gt;That worked for me. Now the auth_type in the provider is something like:&lt;BR /&gt;auth_type = "google-id"&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 15:16:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/84439#M1651</guid>
      <dc:creator>NelsonE</dc:creator>
      <dc:date>2024-08-27T15:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Terraform Failed to get oauth access token. Please retry after logout and login again. with GCP</title>
      <link>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/99074#M2319</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/116426"&gt;@NelsonE&lt;/a&gt;&amp;nbsp;! This helped me as well. Tried messing around with all kinds of authentication methods but this was what worked.&lt;BR /&gt;&lt;BR /&gt;For the record, I am also using service account impersonation to register VPC endpoints on Terraform / GCP for Databricks. My .databrickscfg profile looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[GCP_ID_ACCOUNT]
host                    = https://accounts.gcp.databricks.com
account_id              = &amp;lt;acc-id&amp;gt;
google_service_account  = &amp;lt;service-account-email&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Nov 2024 06:26:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/terraform-failed-to-get-oauth-access-token-please-retry-after/m-p/99074#M2319</guid>
      <dc:creator>wlam1</dc:creator>
      <dc:date>2024-11-18T06:26:40Z</dc:date>
    </item>
  </channel>
</rss>

