Skip to content

chore: add check for baseuri reachability in update.sh script - #2601

Open
MikeMcC399 wants to merge 1 commit into
nodejs:mainfrom
MikeMcC399:update-check-dist
Open

chore: add check for baseuri reachability in update.sh script#2601
MikeMcC399 wants to merge 1 commit into
nodejs:mainfrom
MikeMcC399:update-check-dist

Conversation

@MikeMcC399

Copy link
Copy Markdown
Contributor

Description

Add a check to the update.sh script for the reachability of the baseuri server defined in the config file, waiting 15 seconds.

Output a clear and short error message then exit fatally.

Motivation and Context

If the website defined in

baseuri https://nodejs.org/dist
is not reachable, then executing ./update.sh may hang indefinitely or output multiple error messages before failing.

The scripts are written such that there can be a config file in each release line directory, although that is not used, so theoretically there can be multiple baseuri definitions. In later script rework exercises, such as needed for Alpine Tier 2 and Node 27, we may check if we need this flexibility, or if it could be simplified.

As far as https://nodejs.org/dist is concerned, there is one location for all release lines.

Testing Details

On Ubuntu 24.04.4 LTS

git clone https://github.com/nodejs/docker-node
cd docker-node
cat > config <<EOT # change to unreachable port
baseuri     https://nodejs.org:3000/dist
default_variant trixie
alpine_version  3.23
debian_versions bookworm bullseye trixie
EOT
./update.sh # previously waited indefinitely

cat > config <<EOT # change to non-running server
baseuri     https://localhost/dist
default_variant trixie
alpine_version  3.23
debian_versions bookworm bullseye trixie
EOT
./update.sh # previously output many lines of error messages

Test logs

Unreachable port

$ cat > config <<EOT # change to unreachable port
baseuri     https://nodejs.org:3000/dist
default_variant trixie
alpine_version  3.23
debian_versions bookworm bullseye trixie
EOT
./update.sh # previously waited indefinitely
curl: (28) Connection timed out after 15001 milliseconds
**********
Fatal Error: Unable to reach https://nodejs.org:3000/dist; please check network connectivity or the baseuri configuration.
**********

Non-running server

$ cat > config <<EOT # change to non-running server
baseuri     https://localhost/dist
default_variant trixie
alpine_version  3.23
debian_versions bookworm bullseye trixie
EOT
./update.sh # previously output many lines of error messages
curl: (7) Failed to connect to localhost port 443 after 0 ms: Couldn't connect to server
**********
Fatal Error: Unable to reach https://localhost/dist; please check network connectivity or the baseuri configuration.
**********

Types of changes

  • Documentation
  • Version change (Update, remove or add more Node.js versions)
  • Variant change (Update, remove or add more variants, or versions of variants)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (none of the above)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • All new and existing tests passed.

Exit fatally after 15 seconds if not reachable
@MikeMcC399 MikeMcC399 self-assigned this Aug 7, 2026
@MikeMcC399
MikeMcC399 marked this pull request as ready for review August 7, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant