-
Notifications
You must be signed in to change notification settings - Fork 770
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
This resource can only be used in the context of an organization, "" is a user #830
Comments
I was experiencing this behaviour when updating the remote (terraform cloud) state file from my CLI using |
Hey, I have also come across this same problem. The issue happens for me when using modules, it seems like the provider edited to add: Like @martyca, I have also found that I must have |
still happening in 4.13.0 @roobert workaround of environment variables still works, but it relies now on a deprecated functionality.
|
Encountering the same in v4.17.0. |
Yes, as @hazcod said, with v4.17.0 I faced the same problem creating a new team |
Hi, same error with v4.18.0 too. |
Same with v4.19.0... Workaround:
|
exporting |
Still needing to do |
This solution works for me with provider "github" {
token = "var.token"
owner = "my-org"
} will fail even with the provider "github" {} will work if the environment variables are set. |
+1 with v.5.7.0 |
I wonder if that's a thing we can adjust in our code or a limitation of Terraform as a whole. |
Work For me, Provider configure:
export TF_VAR_GITHUB_TOKEN={personal_token} |
I'm in the process of updating our TF code base from the 2.x version of github when I ran into this issue. It looks like this issue starts in v3.0.0. |
Hmm...here's the diff between those two tags. There's some changes in github/config.go that could potentially be at fault. |
BEWARE: this error is very misleading. We thought the Go library needed because of #1391 For us, it turns out our Personal Access Token just stopped working for some reason. We made a new token and everything started working again. Seems like this has come up a lot: https://github.com/integrations/terraform-provider-github/search?q=in+the+context+of+an+organization+is+a+user&type=issues Maybe this can be added to the README or something as a troubleshooting step? |
@thetimbecker agreed that usually the cause is an invalid PAT! Would you be interested in opening up a PR to update the docs accordingly? |
Here's another confirmation 4 months later. This workaround still works in v5.18.0. |
Clearly I never got around to this 😅 Unfortunately I can't take the time to do it well right now, especially since the issue it's fresh in my mind anymore. |
👋 Hey Friends, this issue has been automatically marked as |
Terraform Version
1.0.0
4.11.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
Debug/Trace doesn't show any new output that could specify the error.
Panic Output
N/A
Expected Behavior
Should be able to output a plan to remove
github_membership
resource belonging to an organization.Actual Behavior
Errors:
Steps to Reproduce
terraform plan --refresh=false
Important Factoids
plan
on Jenkins. There were no changes on our Jenkins configuration, and we were able to runplan
andapply
with no errors prior to this config modification.terraform plan --refresh=false
successfully create a plan. However, it is run with my own Github token, supplied in theprovider
resource. Whereas Jenkins utilizes a global token (which has been working fine until now) in envGITHUB_TOKEN
References
Possibly related to #501
The text was updated successfully, but these errors were encountered: