Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to initialize maas-region on machines that maas-agent pre-exists or is initialized faster #316

Open
skatsaounis opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@skatsaounis
Copy link
Collaborator

Steps to reproduce

juju deploy postgresql --channel 14/candidate --revision 553 --to 7 --config experimental_max_connections=250 --config plugin_audit_enable=false
juju deploy maas-region --channel 3.5/edge --to 8
juju integrate postgresql maas-region
juju add-unit maas-region -n 2 --to 9,10
juju deploy maas-agent --channel 3.5/edge -n 3 --to 8,9,10
juju integrate maas-agent maas-region

Expected behavior

Splitting the installation of maas-region to two phases to overcome #315 , I would expect that a 3 node MAAS region+rack cluster is initialized successfully.

Actual behavior

It seems that if maas-agent is installed first, it binds the ports before maas-region. As a result, the initialization of the MAAS cluster is incomplete.

Versions

Operating system: Jammy 22.04

Juju CLI: 3.6.2-genericlinux-amd64

Juju agent: 3.6.2

Charm revision:
maas-region: 74
maas-agent: 12

Log output

2025-01-29 14:44:36 ERROR unit.maas-region/4.juju-log server.go:326 failed to open service ports
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-maas-region-4/charm/venv/ops/model.py", line 3319, in _run
    result = subprocess.run(args, **kwargs)  # type: ignore
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('/var/lib/juju/tools/unit-maas-region-4/open-port', '53/udp')' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-maas-region-4/charm/./src/charm.py", line 227, in _setup_network
    self.unit.set_ports(*MAAS_REGION_PORTS)
  File "/var/lib/juju/agents/unit-maas-region-4/charm/venv/ops/model.py", line 803, in set_ports
    self._backend.open_port(protocol, port)
  File "/var/lib/juju/agents/unit-maas-region-4/charm/venv/ops/model.py", line 3802, in open_port
    self._run('open-port', arg)
  File "/var/lib/juju/agents/unit-maas-region-4/charm/venv/ops/model.py", line 3321, in _run
    raise ModelError(e.stderr) from e
ops.model.ModelError: ERROR cannot open 53/udp (unit "maas-region/4"): port range conflicts with 53/udp (unit "maas-agent/4")

2025-01-29 14:44:37 INFO juju.worker.uniter.operation runhook.go:186 ran "start" hook (via hook dispatching script: dispatch)

Additional context

Image

@skatsaounis skatsaounis added the bug Something isn't working label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant