Skip to content
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

Sporadic 404 errors #1817

Closed
pkaramol opened this issue Sep 17, 2021 · 4 comments
Closed

Sporadic 404 errors #1817

pkaramol opened this issue Sep 17, 2021 · 4 comments
Labels
bug Something isn't working waiting-on-response Waiting for a response from the user

Comments

@pkaramol
Copy link
Contributor

pkaramol commented Sep 17, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

Occasionally, the creation of new PRs fails with the following error

{"level":"error","ts":"2021-09-17T19:31:20.643Z","caller":"events/pull_updater.go:14","msg":"GET https://api.github.com/repos/pkaramol/atlantis-poc-v2/pulls/9/files?per_page=300: 404 Not Found []","json":{"repo":"pkaramol/atlantis-poc-v2","pull":"9"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*PullUpdater).updatePull\n\t/go/src/github.com/runatlantis/atlantis/server/events/pull_updater.go:14\ngithub.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).runAutoplan\n\t/go/src/github.com/runatlantis/atlantis/server/events/plan_command_runner.go:77\ngithub.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).Run\n\t/go/src/github.com/runatlantis/atlantis/server/events/plan_command_runner.go:221\ngithub.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunAutoplanCommand\n\t/go/src/github.com/runatlantis/atlantis/server/events/command_runner.go:162"}

The PR is there of course and atlantis does have access to the repo (created other PRs with success)

Reproduction Steps

Logs

Environment details

Additional Context

The problem may go away by restarting atlantis

Screenshot from 2021-09-17 22-36-04

@pkaramol pkaramol added the bug Something isn't working label Sep 17, 2021
@dgteixeira
Copy link

Hello,
We are facing a similar issue, but it's when we have autoplan enabled, we sometimes (it appears to be RNG) get the following error, through an Atlantis comment:
"
Plan Error

GET https://api.github.com/repos/<org_name>/<repo_name>/pulls/33/files?per_page=300: 404 Not Found []

"
It looks like that the atlantis tries to get the files faster than github actually processes the PR.
When retrying atlantis plan after a while. it works without issue.

@calexandre
Copy link

calexandre commented Sep 28, 2021

I also have this issue, and I believe that this may have something to do with GitHub API eventual consistency or caching - either on GitHub's side or on Atlantis's side.

Imho what is happening is that the webhook is being sent immediately after the PR gets created, but when Atlantis queries the API for that PR, the API returns 404 because its cache has not been invalidated yet.

If my theory confirms, this can be 'easily' fixed by adding a small delay (5 seconds for example) before querying the API for the given PR.

@AntonUspishnyi
Copy link

Duplicates #1905

@jamengual
Copy link
Contributor

is this still an issue with v0.19.8?

@jamengual jamengual added the waiting-on-response Waiting for a response from the user label Aug 26, 2022
@github-actions github-actions bot added the Stale label Oct 18, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting-on-response Waiting for a response from the user
Projects
None yet
Development

No branches or pull requests

5 participants