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]: octokit.rest.repos.downloadZipballArchive fails with unexpected 500 HTTP error #461

Open
1 task done
madebr opened this issue Aug 16, 2024 · 6 comments
Open
1 task done
Labels
Type: Bug Something isn't working as documented

Comments

@madebr
Copy link

madebr commented Aug 16, 2024

What happened?

Using ocotokit.reset.repos.downloadZipballArchive often fails with a 500 HTTP error on Linux.

I use this api in libsdl-org/setup-sdl here.

In this action workflow, the libsdl-org/setup-sdl action is used on 3 platforms (macos, Window and Linux).
It succeeds on Windows and macOS, but always fails on Linux.

Versions

@octokit/rest 21.0.1
octokit 3.2.1
node 20.13.1

Relevant log output

https://github.com/madebr/librw/actions/runs/10423418847/job/28870081646#step:5:1153


2024-08-16T16:55:09.0997439Z ##[group]Downloading and extracting libsdl-org/SDL (ba2f78a0069118a6c583f1fbf1420144ffa35bad) into /tmp/setupsdl/a0bcf6a829b2a1d3c4ab2a74ca24b902d29fbd8f62094685d963197bee25a0d5/source
2024-08-16T16:55:09.0999498Z Downloading git zip archive...
2024-08-16T16:55:09.1091030Z GET /repos/libsdl-org/SDL/zipball/ba2f78a0069118a6c583f1fbf1420144ffa35bad - 500 with id UNKNOWN in 9ms
2024-08-16T16:55:09.1092873Z ##[endgroup]
2024-08-16T16:55:09.1121756Z /home/runner/work/_actions/libsdl-org/setup-sdl/main/packed/index.js:78534
2024-08-16T16:55:09.1122872Z     const requestError = new RequestError(message, 500, {
2024-08-16T16:55:09.1123741Z                          ^
2024-08-16T16:55:09.1124192Z 
2024-08-16T16:55:09.1124461Z RequestError [HttpError]: other side closed
2024-08-16T16:55:09.1125830Z     at fetchWrapper (/home/runner/work/_actions/libsdl-org/setup-sdl/main/packed/index.js:78534:26) {
2024-08-16T16:55:09.1126957Z   status: 500,
2024-08-16T16:55:09.1127491Z   request: {
2024-08-16T16:55:09.1128045Z     method: 'GET',
2024-08-16T16:55:09.1129260Z     url: 'https://api.github.com/repos/libsdl-org/SDL/zipball/ba2f78a0069118a6c583f1fbf1420144ffa35bad',
2024-08-16T16:55:09.1130432Z     headers: {
2024-08-16T16:55:09.1131058Z       accept: 'application/vnd.github.v3+json',
2024-08-16T16:55:09.1132956Z       'user-agent': 'octokit-rest.js/21.0.1 octokit-core.js/6.1.2 Node.js/20.13.1 (linux; x64)',
2024-08-16T16:55:09.1133906Z       authorization: 'token [REDACTED]'
2024-08-16T16:55:09.1134290Z     },
2024-08-16T16:55:09.1134766Z     request: { hook: [Function: bound bound register] }
2024-08-16T16:55:09.1135245Z   },
2024-08-16T16:55:09.1135538Z   response: undefined,
2024-08-16T16:55:09.1135996Z   cause: TypeError: fetch failed
2024-08-16T16:55:09.1136445Z       at node:internal/deps/undici/undici:12502:13
2024-08-16T16:55:09.1137256Z       at async fetchWrapper (/home/runner/work/_actions/libsdl-org/setup-sdl/main/packed/index.js:78508:21) {
2024-08-16T16:55:09.1138077Z     [cause]: SocketError: other side closed
2024-08-16T16:55:09.1138896Z         at TLSSocket.onSocketEnd (/home/runner/work/_actions/libsdl-org/setup-sdl/main/packed/index.js:48893:22)
2024-08-16T16:55:09.1139912Z         at TLSSocket.emit (node:events:531:35)
2024-08-16T16:55:09.1140900Z         at endReadableNT (node:internal/streams/readable:1696:12)
2024-08-16T16:55:09.1142067Z         at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
2024-08-16T16:55:09.1143407Z       code: 'UND_ERR_SOCKET',
2024-08-16T16:55:09.1143968Z       socket: {
2024-08-16T16:55:09.1144552Z         localAddress: '10.1.0.10',
2024-08-16T16:55:09.1145300Z         localPort: 39244,
2024-08-16T16:55:09.1145919Z         remoteAddress: '140.82.113.6',
2024-08-16T16:55:09.1146560Z         remotePort: 443,
2024-08-16T16:55:09.1147287Z         remoteFamily: 'IPv4',
2024-08-16T16:55:09.1147842Z         timeout: undefined,
2024-08-16T16:55:09.1148444Z         bytesWritten: 1152,
2024-08-16T16:55:09.1149122Z         bytesRead: 6213
2024-08-16T16:55:09.1149594Z       }
2024-08-16T16:55:09.1150016Z     }
2024-08-16T16:55:09.1150410Z   }
2024-08-16T16:55:09.1150911Z }
2024-08-16T16:55:09.1151124Z 

Code of Conduct

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

👋 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
Copy link
Member

Unfortunately that error doesn't give any information... All it says is that the socket was closed unexpectedly

I would suggest using streams instead, see example here: #12 (comment)

It shouldn't matter what platform it's running on at least for this kind of code. I can't help you on that one

@madebr
Copy link
Author

madebr commented Aug 16, 2024

Thanks for the suggestion.
I applied it to my setup-sdl fork, but alas the error remains the same.
Perhaps you're seeing a flaw in my implementation? I'm a relative typescript noob.

@wolfy1339
Copy link
Member

I have no idea why you're getting HTTP 500 errors only on Linux

@madebr
Copy link
Author

madebr commented Aug 16, 2024

I have no idea why you're getting HTTP 500 errors only on Linux

It's very weird.
We're using this github action in other SDL repos, such as SDL_image without issue. recent job
I created a test repo madebr/setup-sdl-test to test the SDL action.
It succeeds when using a fedora docker container, but fails when using a ubuntu docker container.

@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Aug 16, 2024
@kfcampbell kfcampbell removed the Status: Triage This is being looked at and prioritized label Aug 16, 2024
@godinja
Copy link

godinja commented Nov 14, 2024

I'm also seeing this error when making a repos.getContent call:

const file = await octokit.rest.repos.getContent({
    owner,
    repo,
    ref,
    path,
    mediaType: { format: "raw" },
  });
RequestError [HttpError]: other side closed
    at /usr/src/app/node_modules/@octokit/request/dist-node/index.js:157:11 {
  status: 500,
  request: {
    method: 'GET',
    url: [REDACTED],
    headers: {
      accept: 'application/vnd.github.v3.raw',
      'user-agent': 'octokit-rest.js/20.1.1 octokit-core.js/5.2.0 Node.js/23',
      authorization: 'token [REDACTED]'
    },
    request: { hook: [Function: bound bound register] }
  }
}

This is running inside the node:slim image inside an EKS cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

4 participants