Skip to content

fix(install): fail early when docker cannot create networks - #4628

Closed
sojay wants to merge 1 commit into
masterfrom
fix/network-pool-precheck
Closed

sojay wants to merge 1 commit into
masterfrom
fix/network-pool-precheck

Conversation

@sojay

@sojay sojay commented Nov 22, 2026

Copy link
Copy Markdown

Why

When Docker's address pools are exhausted, install.sh pulls every image and only then fails at the relay credentials step with "all predefined address pools have been fully subnetted". The install can't fix the exhaustion, but it can catch it up front with a clear message. Fixes #4576.

What changed

  • install/check-minimum-requirements.sh: after the RAM check, create and remove a throwaway network (sentry-network-check). If creation fails, exit with a message that points to docker network prune and default-address-pools in /etc/docker/daemon.json.

Testing

Tested locally on Colima (arm64, Docker 29.5.2, Compose 5.5.0) with default-address-pools set to 10.99.0.0/22, size 24:

  • Reproduced the original failure first: with the pool full, docker-compose run --rm --no-deps relay --version fails with failed to create network sentry-self-hosted_default: ... all predefined address pools have been fully subnetted.
  • Pool full: install.sh fails with the new message right after the minimum requirements check, before any images are pulled.
  • One subnet freed: the check passes and the install continues to the image pull.
  • No sentry-network-check network is left behind in either case.

Not covered by _unit-test/, since check-minimum-requirements.sh has no existing tests.

@sojay sojay changed the title fix(install): Fail early when Docker cannot create networks fix(install): fail early when docker cannot create networks Nov 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b65ebc0. Configure here.

echo "Remove unused networks ($CONTAINER_ENGINE network prune) or increase default-address-pools in /etc/docker/daemon.json."
exit 1
fi
$CONTAINER_ENGINE network rm sentry-network-check >/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probe requires extra free subnet

Medium Severity

The probe always tries to create an extra network while sentry-self-hosted_default may still exist. A later compose down frees that subnet, and --minimize-downtime reuses the existing network, so an upgrade can fail this check even though install never needs another pool slot.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b65ebc0. Configure here.

echo "Remove unused networks ($CONTAINER_ENGINE network prune) or increase default-address-pools in /etc/docker/daemon.json."
exit 1
fi
$CONTAINER_ENGINE network rm sentry-network-check >/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collision mistaken for pool exhaustion

Low Severity

Create uses the fixed name sentry-network-check and discards daemon stderr, so a leftover or colliding network is reported as address-pool exhaustion. The install trap does not remove this network, so an interrupted run can block later installs with a misleading FAIL.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b65ebc0. Configure here.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Coverage Results 📊

✅ 22 passed | Total: 22 | Pass Rate: 100% | Execution Time: 11m 23s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 50%).
Project statement coverage is 95.58% (unchanged from base (1baa2d6) to head (b65ebc0)).

Coverage diff
@@            Coverage Diff             @@
##        master     #4628       +/-##
==========================================
  Coverage    95.58%    95.58%        —%
==========================================
  Files            5         5         —
  Tracked lines       339       339         —
  Branches         0         0         —
==========================================
  Hits           324       324         —
  Misses          15        15         —
  Partials         0         0         —

Generated by Coverage Action

@aminvakil

Copy link
Copy Markdown
Collaborator

Wrong, unnecessary.

@aminvakil aminvakil closed this Nov 22, 2026
@sojay

sojay commented Nov 22, 2026

Copy link
Copy Markdown
Author

Fair, the upgrade could hit a false failure. Thanks for the look.

@sojay
sojay deleted the fix/network-pool-precheck branch November 22, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Error when Docker cannot create more networks

2 participants