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]: Network Errors have statusCode 500 #713

Open
1 task done
Uzlopak opened this issue Jul 12, 2024 · 2 comments
Open
1 task done

[BUG]: Network Errors have statusCode 500 #713

Uzlopak opened this issue Jul 12, 2024 · 2 comments
Labels
Type: Breaking change Used to note any change that requires a major version bump Type: Bug Something isn't working as documented

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Jul 12, 2024

What happened?

When there are network errors, the status code is 500. I think it would be better to set the status code to 0 indicating that the request has errored not because of some dubious internal server error on the remote, but because of some network issue

I think we should then increment the version by a major.

Versions

v. 9.1.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Uzlopak Uzlopak added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jul 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! 🚀

@wolfy1339 wolfy1339 added Type: Breaking change Used to note any change that requires a major version bump and removed Status: Triage This is being looked at and prioritized labels Jul 15, 2024
@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Jul 15, 2024
@austinpray-mixpanel
Copy link

Is there a good way to tell these network 500s from legit 500s on the current version? I'm trying to debug some 500 errors that come back as: "Error: Unhandled error: HttpError: Unexpected end of JSON input". This is in a github actions environment using https://github.com/actions/github-script 7.0.1

POST /repos/mixpanel/<snip>/merges - 500 in 4122ms
RequestError [HttpError]: Unexpected end of JSON input
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:9561:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Unhandled error: HttpError: Unexpected end of JSON input
    at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:16), <anonymous>:34:25)
    at async main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:20) {
  status: 500,
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/mixpanel/<snip>/merges',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'actions/github-script octokit-core.js/5.0.1 Node.js/20.13.1 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"base":"rc-241101-austin-debug-create-release-candidate-1b90","head":"austin-debug-create-release-candidate","commit_message":"RC: austin-debug-create-release-candidate"}',
    request: {
      agent: [Agent],
      fetch: [Function: proxyFetch],
      hook: [Function: bound bound register]
    }
  }
}

This same request works just fine on curl from my dev machine. Makes me think there is some kind of network issue but the 500 error status code is throwing me for a loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking change Used to note any change that requires a major version bump Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

3 participants