https://www.runatlantis.io/ logo
Title
i

Ilia Kovalev

04/04/2023, 1:15 PM
Hi guys! Noticed a strange thing:
successfully ran \"terragrunt plan...
Unable to update status error: POST <https://api.github.com/repos/org/repo/statuses/master>: 403 Resource not accessible by integration
github api docs say that
/repos/{owner}/{repo}/statuses/{sha}
is the right endpoint, but atlantis is trying to hit
/repos/{owner}/{repo}/statuses/{branch}
The full stacktrace:
403 Resource not accessible by integration [])","json":{},"stacktrace":"<http://github.com/runatlantis/atlantis/server/events.(*ProjectOutputWrapper).updateProjectPRStatus|github.com/runatlantis/atlantis/server/events.(*ProjectOutputWrapper).updateProjectPRStatus>\n\tgithub.com/runatlantis/atlantis/server/events/project_command_runner.go:186\ngithub.com/runatlantis/atlantis/server/events.(*ProjectOutputWrapper).Plan\n\tgithub.com/runatlantis/atlantis/server/events/project_command_runner.go:155\ngithub.com/runatlantis/atlantis/server/events.RunAndEmitStats\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:68\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandRunner).Plan\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:37\ngithub.com/runatlantis/atlantis/server/controllers.(*APIController).apiPlan\n\tgithub.com/runatlantis/atlantis/server/controllers/api_controller.go:152\ngithub.com/runatlantis/atlantis/server/controllers.(*APIController).Plan\n\tgithub.com/runatlantis/atlantis/server/controllers/api_controller.go:90\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2109\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/mux@v1.8.0/mux.go:210\ngithub.com/urfave/negroni/v3.Wrap.func1\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:59\ngithub.com/urfave/negroni/v3.HandlerFunc.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:33\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:51\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\tgithub.com/runatlantis/atlantis/server/middleware.go:70\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Recovery).ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/recovery.go:210\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Negroni).ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:111\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2947\nnet/http.(*conn).serve\n\tnet/http/server.go:1991"}
That causes some troubles: 1.
the workspace <workspace> is currently locked by...
2. unable to use pre-workflow-hooks 3. unable to use this project, it fails after hitting /api/plan with a timeout error What should i do in this case? Thank you
t

tpol

04/04/2023, 2:31 PM
403 Resource not accessible by integration
usually means that your access token doesn't have enough permissions granted
or your github app, depends on what you're using
i

Ilia Kovalev

04/04/2023, 3:17 PM
I think in the case of lack of permissions there would be forbidden access, here Atlantis hits a not supported method according to GitHub docs
My GitHub app has read write access to commit statuses
p

PePe Amengual

04/04/2023, 4:05 PM
from github you get 403 or 404 for lack of permissions, is all over the place
it could lack of Org read access too
p

pomcho555

04/05/2023, 3:18 AM
JFYI: I made an issue for this problem. https://github.com/runatlantis/atlantis/issues/3285
🎉 2
i

Ilia Kovalev

04/05/2023, 2:17 PM
but Atlantis wants to update statuses and has full permissions for it, i tried to give even more permissions but the error still occurs
r

RB

04/05/2023, 9:51 PM
I added a comment where the code may need to be updated. Thank you for creating the issue. Looking forward to a pr that works for both github app and github non app
👀 1