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

[BUG]: 404 being retried #576

Open
1 task done
steveoh opened this issue Sep 12, 2024 · 5 comments
Open
1 task done

[BUG]: 404 being retried #576

steveoh opened this issue Sep 12, 2024 · 5 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@steveoh
Copy link

steveoh commented Sep 12, 2024

What happened?

a 404 response code is being retried even though the docs say it shouldn't be.

Retries requests for server 4xx/5xx responses except 400, 401, 403, 404, 422, and 451.

this is how i create the client

import { Octokit } from '@octokit/rest';
import { retry } from '@octokit/plugin-retry';

const EnhancedOctokit = Octokit.plugin(retry);
const octokit = new EnhancedOctokit({
  auth: GITHUB_TOKEN,
  request: { retries: 9 },
});

I've tried adding the codes specifically but that doesn't affect anything

retry: {
    doNotRetry: [400, 401, 403, 404, 422, 451],
  },

Making any of those a string value makes the script run really slow which may be another issue.

This is the function call that 404's and retries 9 times.

const { data } = await octokit.rest.repos.getContent({ owner, repo, path });

Am I doing something wrong?

Versions

npmPackages:
@octokit/plugin-retry: ^7.1.1 => 7.1.1
@octokit/plugin-throttling: ^9.3.1 => 9.3.1
@octokit/rest: ^21.0.2 => 21.0.2
prettier: ^3.3.3 => 3.3.3
Binaries:
Node: 20.12.2 - ~/.local/state/fnm_multishells/1026_1726157267087/bin/node
npm: 10.8.2 - ~/.local/state/fnm_multishells/1026_1726157267087/bin/npm

Relevant log output

GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F268C:3F522F4:66E37921 in 174ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F2709:3F523DB:66E37923 in 162ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F2777:3F524C2:66E37923 in 167ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F27EE:3F5258D:66E37923 in 169ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F286F:3F52686:66E37923 in 225ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F2911:3F527A8:66E37923 in 173ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F2989:3F52881:66E37924 in 307ms
GET /orgs/agrc/actions/permissions/selected-actions - 409 with id B0C6:8B43D:E2219C:1AF6512:66E37920 in 155ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F2A66:3F52A37:66E37924 in 169ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F2AEB:3F52B2B:66E37924 in 181ms
GET /repos/agrc/.github/contents/.github%2Fworkflows - 404 with id 3A06:1D462A:20F2B77:3F52C23:66E37924 in 151ms

Code of Conduct

  • I agree to follow this project's Code of Conduct
@steveoh steveoh added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Sep 12, 2024
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Sep 13, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Sep 13, 2024
@wolfy1339
Copy link
Member

Can you share details on your environment?

We've seen reports of some implementations not following the specifications, and returning the status code as a string instead of a number

@steveoh
Copy link
Author

steveoh commented Sep 15, 2024

What do you mean by my environment?

@wolfy1339
Copy link
Member

What OS?
Are you using a serverless platform like GCF or AWS?

@steveoh
Copy link
Author

steveoh commented Sep 15, 2024

This is MacOS running locally in a terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

3 participants