Comment
I'm writing a fullstack Node app that requires access to the Codeberg API, however the API returns a timeout specifically for Node clients since Tuesday - regardless of IP, user-agent or even library. I have tested this with Python requests (as an example of a working client), Node undici, ofetch and axios.
I have ruled out issues with IPs / ratelimiting, as this is reproducible over multiple networks, and I have also ruled out browsers and cURL.
An example of this is below.
Working client:
import requests
get_response = requests.get("https://codeberg.org/api/v1/repos/codeberg/community/git/trees/7d55578694c587995e8ac43b7e7e236ecda4e00a?recursive=true")
print(get_response.content)
Failing client (uses undici):
async function main() {
const response = await fetch('https://codeberg.org/api/v1/repos/codeberg/community/git/trees/7d55578694c587995e8ac43b7e7e236ecda4e00a?recursive=true');
const data = await response.json();
console.log(data);
}
main().catch(console.error);
Error:
TypeError: fetch failed
at node:internal/deps/undici/undici:13502:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async main (/path/to/location/test.js:2:20) {
[cause]: AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1739:5)
at listOnTimeout (node:internal/timers:596:11)
at process.processTimers (node:internal/timers:529:7) {
code: 'ETIMEDOUT',
[errors]: [ [Error], [Error] ]
}
}