question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should we add some logic to retry 502 Server errors of the GitHub API?

See original GitHub issue

I think one of the first occurrence of this error is on October 20th https://github.com/prisma/prisma/actions/runs/3288801017/jobs/5419574155

And since then it happens for all Pull Requests 😢

The API call which errors is https://api.github.com/repos/prisma/prisma/actions/workflows/2176058/runs?per_page=100 Screenshot 2022-10-24 at 12 07 48

So this is not an issue about this action but an issue with GitHub API here (I just reported it on https://support.github.com/contact/bug-report - Private ticket is https://support.github.com/ticket/personal/0/1845305)

Examples https://github.com/prisma/prisma/actions/runs/3288801017/jobs/5419574155 https://github.com/prisma/prisma/actions/runs/3311618156/jobs/5467280417 https://github.com/prisma/prisma/actions/runs/3300486832/jobs/5445032786

https://github.com/prisma/prisma/actions/runs/3311727554/jobs/5467525141#step:2:15 copy pasted below:

/home/runner/work/_actions/fkirc/skip-duplicate-actions/v5/dist/index.js:4784
      const error = new requestError.RequestError(toErrorMessage(data), status, {
                    ^

RequestError [HttpError]: Server Error
    at /home/runner/work/_actions/fkirc/skip-duplicate-actions/v5/dist/index.js:4784:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  status: 502,
  response: {
    url: 'https://api.github.com/repos/prisma/prisma/actions/workflows/2176058/runs?per_page=100',
    status: 502,
    headers: {
      connection: 'close',
      'content-length': '32',
      'content-type': 'application/json',
      date: 'Mon, 24 Oct 2022 09:53:59 GMT',
      etag: '"63565dfc-20"',
      server: 'GitHub.com',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-github-request-id': '0682:4473:81E091B:10A5941C:635660AC'
    },
    data: { message: 'Server Error' }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/prisma/prisma/actions/workflows/2176058/runs?per_page=100',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/3.6.0 Node.js/16.13.0 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: {
      agent: Agent {
        _events: [Object: null prototype] {
          free: [Function (anonymous)],
          newListener: [Function: maybeEnableKeylog]
        },
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object: null prototype] { path: null },
        requests: [Object: null prototype] {},
        sockets: [Object: null prototype] {
          'api.github.com:443:::::::::::::::::::::': [ [TLSSocket] ]
        },
        freeSockets: [Object: null prototype] {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 256,
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 1,
        maxCachedSessions: 100,
        _sessionCache: {
          map: {
            'api.github.com:443:::::::::::::::::::::': [Buffer [Uint8Array]]
          },
          list: [ 'api.github.com:443:::::::::::::::::::::' ]
        },
        [Symbol(kCapture)]: false
      },
      hook: [Function: bound bound register]
    }
  }
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
weaintplasticcommented, Oct 31, 2022

I can confirm it’s working for us again as well. Thanks for looking into this.

2reactions
paescujcommented, Oct 31, 2022

Thank you very much for your feedback! Great to hear that it is working again! 🎉 Nevertheless, I’ve still implemented a simple request retrying (using plugin-retry.js) to increase reliability in case that such problems happen again in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatically retry requests on server errors (502) #52 - GitHub
I've been recently experiencing 502 server errors from GitHub while using this library. I'm planning to add some retry logic on my ...
Read more >
Retry on errors 408 and 504 in RetryDecider #2633 - GitHub
Add retry support for 408 and 504 codes per best practices. API documentation suggests retry logic to handle errors, and indicates the following ......
Read more >
GitHub: Specially handle 502 response for graphql · Issue ...
I researched the graphql code to understand how exactly it handles error 502, and it seems that it already handles it correctly -...
Read more >
Provide an option to retry forever on 503 and 504 responses #78
I think it's generally best to include exception handling and retry logic in your own application code. It doesn't end up being that...
Read more >
Automatically retry GET requests with a response of 502/503 a ...
I'm looking to add in some auto retry logic for all my GET requests. It looks like I could almost implement this in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found