Repository navigation
Conversation
…b is missing
`sunbeam enable instance-recovery` on MAAS crashes with a RecursionError
when the storage space is shared with the management space. In that
layout no consul-storage server is deployed, so the consul-storage-lb
service does not exist. The consul storage patch steps passed
"consul-storage-lb" to _get_service(), which appended "-lb", got a 404,
fell back to "consul-storage-lb", got a 404 again and, because that name
ends in "-lb", called itself with find_lb=False until the stack ran out.
Replace the two copies of the recursive _get_service() in
PatchLoadBalancerServicesIP{,Pool}Step with a single non-recursive
_get_lb_service() helper. It tries "<name>-lb" and then "<name>" (or only
"<name>" with find_lb=False) and raises the last 404.
Make PatchLoadBalancerServicesIPStep.run() honour ignore_errors for a
missing service, as is_skip() and the Pool step's run() already do. In
both steps, run() now returns SKIPPED, like is_skip(), when every service
was skipped under ignore_errors, instead of reporting COMPLETED for a
step that patched nothing.
Use the base name "consul-storage" (CONSUL_STORAGE_SERVICE), like the
bind and traefik steps. When storage shares the management space, the
consul storage patch steps still run and now report SKIPPED.
Assisted-By: Claude Code (Claude Opus 5.5)
Closes-Bug: #2168498
Signed-off-by: Vítor Zeni <vitor.zeni@bairesdev.com>
(cherry picked from commit b3e8793)
vsz-work
marked this pull request as ready for review
November 25, 2026 19:57
vsz-work
marked this pull request as draft
November 25, 2026 19:57
Author
|
Heads-up if you test this on 2025.1: bootstrapping from The candidate manifest has no Workaround: bootstrap with a manifest that adds the entry. cp /snap/openstack/current/etc/manifests/2025.1/candidate.yml ~/bootstrap.yml
yq -y '.core.software.charms["epa-orchestrator"] = {"channel": "2025.1/candidate", "config": {"snap-channel": "2025.1/candidate"}}' \
~/bootstrap.yml > ~/bootstrap-epa.yml
sunbeam cluster bootstrap --manifest ~/bootstrap-epa.yml --role control,compute --accept-defaultsUse a fresh machine: rerunning a failed bootstrap isn't reliable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(instance-recovery): stop infinite recursion when consul-storage-lb is missingb3e87938(#1015)_get_lb_service()lookup;ignore_errorshonoured inPatchLoadBalancerServicesIPStep.run();run()returns SKIPPED when every service was skipped; consul storage service name is now the base nameconsul-storageThe bug was reported on 2024.1 (
2024.1/stable, rev 1101), and 2025.1 has the same code:sunbeam enable instance-recoveryon MAAS crashes withRecursionError: maximum recursion depth exceededwhen the storage space is the same as the management space. See #1015 for the full root cause.Adaptations for 2025.1
None. The commit cherry-picked cleanly onto
stable/2025.1(cherry-pick -x). The code it touches is the same as on main:OpenStackPatchLoadBalancerServicesIPStepcan also addovn-relay, which is a base name too.ignore_errors=True, so the new SKIPPED result only changes their outcome. The other steps behave as before.QA steps
Unit tests (from
sunbeam-python/):tox -e unit -- tests/unit/sunbeam/core/test_steps.py tox -e pep8 && tox -e mypyOn a 2025.1 MAAS deployment, with a snap built from this branch:
<deployment>-storage-ippoolrange reserved:sunbeam -v enable instance-recoveryfinishes withoutRecursionError, and both consul storage patch steps report SKIPPED.<deployment>-storage-ippoolrange:consul-storage-lbgets the storage pool annotation and an IP from that pool.Tested
stable/2025.1+ this branchruff format,ruff checkandmypy sunbeamare cleanThe behaviour was tested on MAAS on main in #1015.
Links
Jira card: OPEN-XXXX