init rack can't find secrets

Bug #1976194 reported by Huw Wilkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Alberto Donato
3.2
Fix Released
Critical
Alberto Donato
3.3
Fix Released
High
Alberto Donato

Bug Description

The edge snap fails to add a controller with a secrets file error.

I installed MAAS in an LXC container with:

snap install maas --channel=latest/edge

Then tried:

sudo maas init rack --maas-url ... --secret ...

Which gave the following error:

Traceback (most recent call last):
  File "/snap/maas/21248/bin/maas", line 8, in <module>
    sys.exit(main())
  File "/snap/maas/21248/lib/python3.8/site-packages/maascli/__init__.py", line 39, in main
    options.execute(options)
  File "/snap/maas/21248/lib/python3.8/site-packages/maascli/snap.py", line 448, in __call__
    raise exc
  File "/snap/maas/21248/lib/python3.8/site-packages/maascli/snap.py", line 445, in __call__
    self.handle(options)
  File "/snap/maas/21248/lib/python3.8/site-packages/maascli/snap.py", line 646, in handle
    set_rpc_secret(rpc_secret)
  File "/snap/maas/21248/lib/python3.8/site-packages/maascli/snap.py", line 262, in set_rpc_secret
    secret_path.write_text(secret)
  File "/usr/lib/python3.8/pathlib.py", line 1255, in write_text
    with self.open(mode='w', encoding=encoding, errors=errors) as f:
  File "/usr/lib/python3.8/pathlib.py", line 1222, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/usr/lib/python3.8/pathlib.py", line 1078, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/var/snap/maas/common/maas/secret'

I also tried in a fresh lxc container using the 3.1 snap and it worked fine.

This looks like the same error that was resolved in 2.8: https://bugs.launchpad.net/maas/+bug/1885005

Related branches

Alberto Donato (ack)
Changed in maas:
milestone: none → 3.2.0
importance: Undecided → Critical
status: New → Triaged
Alberto Donato (ack)
Changed in maas:
status: Triaged → In Progress
assignee: nobody → Alberto Donato (ack)
Alberto Donato (ack)
Changed in maas:
milestone: 3.2.0 → none
no longer affects: maas/3.2
Changed in maas:
milestone: none → 3.3.0
Changed in maas:
milestone: 3.2.0 → 3.2.0-beta6
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.