supabase / terraform-provider-supabase

Mozilla Public License 2.0
24 stars 7 forks source link

Cannot apply any changes due to Authorization header error #149

Open enbeec opened 2 months ago

enbeec commented 2 months ago

Describe the bug

When trying to use this Terraform plugin I cannot actually seem to communicate with Supabase. I get an error from the Go runtime like this whenever I try to apply:

Unable to create project, got error: Post "https://api.supabase.com/v1/projects": net/http: invalid header field value for "Authorization"

To Reproduce

I followed the official guide: https://supabase.com/docs/guides/platform/terraform/tutorial

I have verified that my providers are correct (including my Supabase token in a resolvable file with no extra spaces/newlines) and terraform plan is showing everything is good to go.

Expected behavior

I should be able to run terraform apply and have my project resource be created.

Screenshots

Here is the relevant portion of the output from terraform apply:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # supabase_project.demo_base will be created
  + resource "supabase_project" "my_app" {
      + database_password = (sensitive value)
      + id                = (known after apply)
      + name              = "my_app"
      + organization_id   = "vcblfrlrbmhqgtguaxhj"
      + region            = "us-east-2"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

supabase_project.demo_base: Creating...
╷
│ Error: Client Error
│
│   with supabase_project.demo_base,
│   on main.tf line 1, in resource "supabase_project" "demo_base":
│    1: resource "supabase_project" "demo_base" {
│
│ Unable to create project, got error: Post "https://api.supabase.com/v1/projects": net/http: invalid header field value for "Authorization"

System information

Additional context

I've fiddled with regenerating tokens and gone hunting for other solutions online. Any help is greatly appreciated.

enbeec commented 1 month ago

It worked today -- I didn't change anything, just walked away for a bit.