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

intermittent 404 Not Found on /pulls github calls #1905

Open
jacekn opened this issue Nov 19, 2021 · 9 comments · Fixed by #2002
Open

intermittent 404 Not Found on /pulls github calls #1905

jacekn opened this issue Nov 19, 2021 · 9 comments · Fixed by #2002
Labels
bug Something isn't working Stale

Comments

@jacekn
Copy link

jacekn commented Nov 19, 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

I'm experiencing intermittent 404s on PRs. Atlantis leaves the following comment in the PR:

GET https://github.com/gitapi/repos/myorg/myrepo/pulls/999/files?per_page=300: 404 Not Found []

Reproduction Steps

This happens intermittently but the steps are to:

  • open new PR
  • atlantis drops the comment with 404

Logs

Logs
{"level":"info","ts":"2021-11-19T11:50:25.342Z","caller":"events/events_controller.go:318","msg":"identified event as type \"opened\"","json":{}}
{"level":"info","ts":"2021-11-19T11:50:25.342Z","caller":"events/events_controller.go:346","msg":"executing autoplan","json":{}}
{"level":"error","ts":"2021-11-19T11:50:25.766Z","caller":"events/pull_updater.go:14","msg":"GET https://github.com/gitapi/repos/myorg/myrepo/pulls/999/files?per_page=300: 404 Not Found []","json":{"repo":"myorg/myrepo","pull":"999"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*PullUpdater).updatePull\n\t/home/circleci/project/server/events/pull_updater.go:14\ngithub.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).runAutoplan\n\t/home/circleci/project/server/events/plan_command_runner.go:77\ngithub.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).Run\n\t/home/circleci/project/server/events/plan_command_runner.go:221\ngithub.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunAutoplanCommand\n\t/home/circleci/project/server/events/command_runner.go:162"}

Environment details

Atlantis v0.17.5

Atlantis server-side config file:

    repo-allowlist: github.com/myorg/myrepo
    allow-fork-prs: true

    default-tf-version: 0.13.7

    # See https://www.runatlantis.io/docs/checkout-strategy.html#merge
    checkout-strategy: merge

    gh-user: xxx

    data-dir: /atlantis
    atlantis-url: http://yyy

Repo atlantis.yaml file (atlantis is actually disabled for the

version: 3
automerge: true
delete_source_branch_on_merge: true
projects:
- dir: mydir1
  terraform_version: v0.13.7
  autoplan:
    when_modified: ["**", "../modules/**.tf"]
    enabled: true
- dir: mydir2
  autoplan:
    enabled: false

Environment variables:

    - name: ATLANTIS_PORT
      value: "4141"

Additional Context

Similar to

@jacekn jacekn added the bug Something isn't working label Nov 19, 2021
@bmbferreira
Copy link
Contributor

bmbferreira commented Nov 19, 2021

I think this might be related with the failure on e2e tests that happened the other day after merging #1884

@kapilt
Copy link

kapilt commented Nov 19, 2021

it feels like part of the issue might be the lack of exponential backoff in the retry fix https://github.com/runatlantis/atlantis/pull/1131/files

current code
https://github.com/runatlantis/atlantis/blob/master/server/events/vcs/github_client.go#L333

it does look like its doing geometirc backoff now, but its unclear if we need to switch to exponential to resolve.

@jacekn
Copy link
Author

jacekn commented Nov 22, 2021

Maybe it's worth also adding extra logging to the section to record the fact that retries are happening?

@virgofx
Copy link

virgofx commented Nov 22, 2021

Confirmed that we are experiencing this issue as well in 0.17.5. Would love for this to get fixed ASAP.

@jamesclair
Copy link

This issue is happening in 0.17.4 as well.

@iainlane
Copy link
Contributor

Looks like something similar to #1131 is needed but in GetModifiedFiles

pageFiles, resp, err := g.client.PullRequests.ListFiles(g.ctx, repo.Owner, repo.Name, pull.Num, &opts)
if err != nil {
return files, err
}

iainlane added a commit to iainlane/atlantis that referenced this issue Jan 17, 2022
Similar to runatlantis#1131, we see this for /files/ too, resulting in a plan
error.

Closes runatlantis#1905
iainlane added a commit to iainlane/atlantis that referenced this issue Jan 17, 2022
Similar to runatlantis#1131, we see this for /files/ too, resulting in a plan
error.

Closes runatlantis#1905
chenrui333 pushed a commit that referenced this issue Jan 25, 2022
Similar to #1131, we see this for /files/ too, resulting in a plan
error.

Closes #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
@V1Ct0RHMz
Copy link

It's happening with me on v0.20.1

@nitrocode nitrocode removed the waiting-on-response Waiting for a response from the user label Nov 9, 2022
@nitrocode nitrocode reopened this Nov 9, 2022
krrrr38 pushed a commit to krrrr38/atlantis that referenced this issue Dec 16, 2022
Similar to runatlantis#1131, we see this for /files/ too, resulting in a plan
error.

Closes runatlantis#1905
@darkside720
Copy link

its happening on 0.22 as well

@dosubot dosubot bot added the Stale label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants