-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unable to check user permissions: struct field for “__schema” doesn’t exist in any of 1 places to unmarshal #2090
Comments
Hi @jeff-clearcover if you leave this as |
@raymondchen625 do you think this could be related to the GraphQl queries? |
Yes, I found the reason is the v4MutateClient is actually from |
Amazing thanks @raymondchen625 |
* Fix unmarshall error in GraphQL call #2090 * Add unit tests for GetTeamNamesForUser * Fix lint error
Just made a new release 0.19.2, let me know if the issue still happens, thanks! |
fixed in 0.19.2 release, thanks. |
I don't think it is fixed, this has turned into the following {"level":"error","ts":"2022-03-11T17:39:13.568Z","caller":"events/command_runner.go:219","msg":"Unable to check user permissions: Your token has not been granted the required scopes to execute this query. The 'name' field requires one of the following scopes: ['read:org', 'read:discussion'], but your token has only been granted the: ['repo'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\t/home/runner/work/atlantis/atlantis/server/events/command_runner.go:219"} |
@pantelis-karamolegkos Atlantis needs access to the org and comments to use this feature, update the permission and see how it goes |
but this works with |
yes, we needed to change libraries due to a security risk on the previous one, that is why this changed. |
We are testing these changes again since we have discovered that there were changes to the golang Github client that seems to have changed the result of the queries. I will give an update in the next few days. |
I tested release v0.19.2 with the 'read:org', 'read:discussion' scopes granted. It works well. But I found the latest docker base image |
@chenrui333 do we have test for the images when they get created? is it possible that is missing something? @raymondchen625 when you get that error is when is trying to run atlantis binary? |
The binary is fine. Our docker image uses ghcr.io/runatlantis/atlantis-base as base. The latest 2022.03.07 doesn't work. It exits with a file/directory not found error on startup. The 2022.02.03 image works well. |
Just verified the base image |
I still see the issue with the latest release #2187
A restart of the pod fixes it, but it breaks again after some time. |
randomly as in it was working and all of the sudden it just does not work?
…On Fri., Apr. 29, 2022, 6:07 a.m. Alen Komljen, ***@***.***> wrote:
I still see the issue with the latest release #2187
<#2187>
Atlantis randomly stops working with the following error when running the
plan:
{"level":"error","ts":"2022-04-05T15:33:04.300Z","caller":"events/command_runner.go:219","msg":"Unable to check user permissions: non-200 OK status code: 401 Unauthorized body: \"{\\\"message\\\":\\\"Bad credentials\\\",\\\"documentation_url\\\":\\\"https://docs.github.com/graphql\\\"}\"","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\tgithub.com/runatlantis/atlantis/server/events/command_runner.go:219 <http://github.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand%5Cn%5Ctgithub.com/runatlantis/atlantis/server/events/command_runner.go:219>"}
—
Reply to this email directly, view it on GitHub
<#2090 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ3ERAVRP2OEDKBDCEBB2TVHPNI5ANCNFSM5PSLLZHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Works at pod start for some time, then it starts throwing the error. After that, I have to restart the pod again, and so on. |
We have been running on Atlantis v0.19.2 since Mar 14, 2022. Never had
such problems. We are on ECS instead of K8s but I don’t think that matters.
Since the error is on permission, do you rotate your credentials? How are
the credentials injected to the environment?
…On Fri, Apr 29, 2022 at 12:22 Alen Komljen ***@***.***> wrote:
Works at pod start for some time, then it starts throwing the error. After
that, I have to restart the pod again, and so on.
—
Reply to this email directly, view it on GitHub
<#2090 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACXY4USFDY47GMOF7DCZFLVHQEF3ANCNFSM5PSLLZHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yeah, I don't think env matters much. We don't rotate credentials. This is our config:
Every part of Atlantis works fine, except when we add add |
@komljen does the atlantis user have read:org permissions? |
Do you mean on the Atlantis GitHub app? I had to add read permissions to organization members. Also tried to add read to the whole organization, but didn't make any difference. |
yes, the wide org:read permission. it is weird that works and then dies randomly, we have not seen reports of that in particular. can you open a new issue about this with this error? this issue is supposed to be closed because it was fixed with Raymond's changes, and the other issue you reported is related to the same fix. the new issue is : |
I experienced the same problem: it works right after pod restart, and stop working after an hour or so with the same permission error. Is there a new issue for this already? |
Thanks. Rate limit is less likely the cause for us because we are still testing atlantis and GitHub. There isn't really much API calls. |
* Fix unmarshall error in GraphQL call runatlantis#2090 * Add unit tests for GetTeamNamesForUser * Fix lint error
Community Note
Overview of the Issue
Atlantis plan and apply comments stopped working after updating to latest image
Reproduction Steps
Deploy with latest image and try to atlantis plan or apply from comments.
Atlantis will have a similar error in logs:
Logs
Logs
Environment details
If not already included, please provide the following:
Atlantis server-side config file:
Repo
atlantis.yaml
file:Any other information you can provide about the environment/deployment
Using terraform-aws-modules/atlantis/aws
Additional Context
We pinned to v0.18.2 and everything works as expected
The text was updated successfully, but these errors were encountered: