Fetching the UI can result in a timeout when there are many images
When an Antora project has many images (e.g., 80,000), Antora can complain about a request timeout for downloading the UI. The UI itself can be downloaded easily. The number of images seems to affect the UI fetch handling even though these are not directly related.
An example error:
$ npx antora --stacktrace --fetch antora-playbook.yml
[10:09:46.133] FATAL (antora): Failed to download UI bundle: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
Cause: Error
at /Users/eskwayrd/repos/antora-fetch-ui-timeout/node_modules/@antora/ui-loader/lib/load-ui.js:196:24
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at async GeneratorContext.loadUi (/Users/eskwayrd/repos/antora-fetch-ui-timeout/node_modules/@antora/ui-loader/lib/load-ui.js:101:17)
at async Promise.all (index 1)
at async generateSite (/Users/eskwayrd/repos/antora-fetch-ui-timeout/node_modules/@antora/site-generator/lib/generate-site.js:17:5)
at async Command.parseAsync (/Users/eskwayrd/repos/antora-fetch-ui-timeout/node_modules/commander/lib/command.js:935:5)
Caused by: Error: Request timed out
at ClientRequest.<anonymous> (/Users/eskwayrd/repos/antora-fetch-ui-timeout/node_modules/simple-get/index.js:76:8)
at ClientRequest.emit (node:events:514:28)
at TLSSocket.emitRequestTimeout (node:_http_client:840:9)
at Object.onceWrapper (node:events:628:28)
at TLSSocket.emit (node:events:526:35)
at Socket._onTimeout (node:net:589:8)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
An example repo containing the elements required to reproduce the error exists here: https://github.com/eskwayrd/antora-fetch-ui-timeout
After cloning the repo and entering the repo root, run node generate_images.js
to produce 80,000 copies of the one provided image. Then run Antora just like the example above. The script removes any existing image copies so you should always have the specified number of copies after each run.
I've witnessed different behavior between two different laptops. With a MacBook Pro with M1 Max and 32GB of memory, the error appears after ~30 seconds. With a MacBook Pro with a Core i7 and 16GB of memory, the error appears after ~5 minutes. With the M1 Max laptop, as few as 15,000 images can reliably produce the error. With the Core i7 laptop, more than 50,000 images are required.
In both cases: Antora 3.1.4. The problem exists with Node.js versions 17.8.0, 20.2.0, and 20.9.0.