-
Notifications
You must be signed in to change notification settings - Fork 19
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: Unable to login to DBT Cloud #39
Comments
Hey, thanks for spotting this! I've been trying to replicate but haven't quite pinned it yet, but a few things that seemed to set this off for me (bad error handling by me somewhere 😬 ) Just to check, is it the same behaviour if you pass the project_id directly rather than through a var? I'm not sure if it makes a difference being a personal API token vs a service token from DBT Cloud's auth side of things, but I'll try both later today Thanks again for spotting! |
@GtheSheep Thanks for the quick reply :)
|
Ahh awesome thanks for verifying! I'm still struggling to reproduce the error tbh, I've cleared all TF artifacts locally, I see from your log in the first post that plan seems to complete? So does running plan produce the correct result? Also, could you let me know what version of Terraform you're using? |
I'm using Terraform v1.0.1. I get the error whenever I try planning or applying - so if I understood your question correctly, the plan doesn't complete but throws an error before it does. |
Ahh ok, got it, will test with that version, thanks! |
Can't seem to reproduce this on Mac, so have chucked up this PR to test on Linux and still seems to be fine, not sure if cleaning your workspace/ environment may help here? I figured this branch would ensure it's nothing to do with my local setup. Sorry about this, frustratingly hard to reproduce! 😬 The only time I managed to get this to happen the other day was with some terraform files in the dir (.terraform/ and so on), but can't understand why this would cause issue with the provider itself |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 7 days since being marked as stale. |
@GtheSheep Getting back to this old issue after a while. Is there any way to get a log trace of the dbt Cloud HTTP requests? |
Hey, I've not implemented much logging yet, I guess try setting TF_LOG_LEVEL=TRACE and see what comes out? |
There's nothing related to dbt Cloud HTTP requests in the Terraform trace :( |
I also got the same error when running it on Terraform Cloud. My TF file as follows:
|
Hi, @ywan160 - thanks for this, could just check you're definitely using a dbt Cloud service token with (in this case) Account Admin permission set added? As this exact code works for me (running via the cli on Mac OS tbf) @stumelius - Is the code you're currently trying out the same as initially submitted or the newest provider version? |
Hi, @GtheSheep - Yes, I am using a service token. I had a look at this func - NewClient which is used to initialize the client and ran some tests: This is the URL for authentication in the code:
If I run curl on this URL format, the body of the web response is empty: However, if I add a '/' at the end of the url, it now returns a Json message: |
Hey @ywan160 thanks for this, I actually had this issue on my account for some of the other endpoints, let me add this and run tests, if it works I'll release a new provider version to try 🤞 |
@GtheSheep Great, thanks. Give me a yell if you need me to run more tests. |
Just released v0.0.80 if you could try it plz? |
Unfortunately, still getting the same error. :( |
You're doing this in TF Cloud, right? Does it provide any more detailed logging? |
I just used CLI this time. No, it didn't provide more detailed logging:
…On Thu, 7 Jul 2022 at 22:18, Gary James ***@***.***> wrote:
You're doing this in TF Cloud, right? Does it provide any more detailed
logging?
—
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQC6UIZRXMM3XDIIIZXNOALVS2VHJANCNFSM5GZ44DKQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Are you getting "unexpected end of JSON input" or "Unable to login to DBT Cloud"? Anything you could provide from TF_LOG=TRACE would be super helpful as I can't seem to replicate this 😬 |
Hi @GtheSheep, I ran with trace logging but couldn't find anything useful. Unfortunately, the DBT Cloud account that I use is a single-tenant deployment and the log contains some sensitive information so I can't really share it here. :( Did you try it on windows or linux cli instead of Mac to see if you can replicate this? |
Ahh that's a pain, how are you setting the account_url in the provider for the single-tenant? Are they of the format |
No problem at all. Yes, it works the same as the shared tenant ones except that you can have your own sub-domain on the URL. |
Cool, are you configuring it in the provider definition? Can't see it in the example you sent over is all |
Hi and thanks for this cool project! I'm unable to authenticate with either
DBT_CLOUD_ACCOUNT_ID
andDBT_CLOUD_TOKEN
env vars or explicitly configuring the provider as follows:I'm getting a
Error: Unable to login to DBT Cloud
when runningterraform apply
. I've verified that the account id and token work with the dbt Cloud API v2:Debug logs
The text was updated successfully, but these errors were encountered: