Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot apply any changes due to Authorization header error #149

Open
enbeec opened this issue Sep 4, 2024 · 1 comment
Open

Cannot apply any changes due to Authorization header error #149

enbeec opened this issue Sep 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@enbeec
Copy link

enbeec commented Sep 4, 2024

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

  • OS: macOS on arm64
  • Installed Terraform via brew and used terraform init to pull in the provider according to the tutorial

Additional context

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

@enbeec enbeec added the bug Something isn't working label Sep 4, 2024
@enbeec
Copy link
Author

enbeec commented Sep 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant