-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error: failure to invoke API #113
Comments
I'm having the same issue with the 0.5.3 when using
The same code works when using a bearer |
I am encountering a 401 Unauthorized error when using client_id and client_secret to request a token via Terraform. The same request works successfully when sent using curl or Thunder Client with the payload formatted as a JSON object in the request body. However, when executed through Terraform, the request fails. After investigating, I found that the root cause seems to be in the doTokenRequest function within the /internal/sdk/internal/hooks/clientcredentials.go file. This function encodes the request body in Steps to Reproduce:
Observed Behavior: Terraform sends the client_id and client_secret in a URL-encoded format with the Expected Behavior: The request should be sent with the client_id and client_secret as a JSON object and the Content-Type header set to Potential Fix: Update the doTokenRequest function to construct a JSON payload and set the Content-Type header to Current code snippet
line 148
Suggested modification:
|
I started randomly getting this across all my sources. I make an http request in terraform to get the workspace id, so I know the credentials are correct. I think this is a misleading bug. I don't think it has to do with the creds actually be wrong. Somehow the creds are failing to load when they loaded fine before? I'm not using any secret/client key. I'm using api keys/tokens for all my sources.
|
@augustinasbutkus91 do you have a code example where you've implemented it? |
When using client_id and client_secret in the provider I get an error message, but when I use bearer_auth it works fine. Of course I'd rather not have to get the token myself.
One such error message is
│ Error: failure to invoke API
│
│ with airbyte_destination_snowflake.this["snowflake"],
│ on destinations.tf line 56, in resource "airbyte_destination_snowflake" "this":
│ 56: resource "airbyte_destination_snowflake" "this" {
│
│ failed to get token: unexpected status code: 404: {"type":"about:blank","status":404}
The text was updated successfully, but these errors were encountered: