Wrong path to .gpg file

Bug #2007854 reported by Kyrylo Sypko
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Status tracked in 3.6
3.3
Won't Fix
Low
Unassigned
3.4
Won't Fix
Low
Unassigned
3.5
Won't Fix
Low
Unassigned
3.6
Triaged
Low
Unassigned

Bug Description

I'm using Package version/build 3.1.0-10901-g.f1f8f1505

I try to sync images from maas.io but get an error:

 maasserver.bootresources: [critical] Importing boot resources failed.
        Traceback (most recent call last):
          File "/usr/lib/python3.8/threading.py", line 870, in run
            self._target(*self._args, **self._kwargs)
          File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 835, in worker
            return target()
          File "/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
            task()
          File "/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
            task()
        ...
 File "/usr/lib/python3/dist-packages/maasserver/models/bootsource.py", line 68, in to_dict_without_selections
            with open(self.keyring_filename, "rb") as keyring_file:
        builtins.FileNotFoundError: [Errno 2] No such file or directory: '/snap/maas/current/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg'

It looks like wrong path for Package version of maas.

To workaround it I just created dir /snap/maas/current/usr/share/keyrings/ and copy /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg there.

Bill Wear (billwear)
Changed in maas:
status: New → Triaged
importance: Undecided → Low
Bill Wear (billwear)
Changed in maas:
milestone: none → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
Changed in maas:
milestone: 3.4.x → 3.5.x
no longer affects: maas/3.3
Revision history for this message
Anton Troyanov (troyanov) wrote :

Hi Kyrylo,

May I ask you to check if this bug is still reproducible in newer MAAS versions (3.4, 3.5)

It seems that default location is `/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg` if MAAS_IMAGES_KEYRING_FILEPATH is not set. Could it be that you had this ENV set to some value?

# Default images keyring filepath can be overridden by the environment.
DEFAULT_KEYRINGS_PATH = os.getenv(
    "MAAS_IMAGES_KEYRING_FILEPATH",
    "/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg",
)

Revision history for this message
Felipe Alencastro (falencastro) wrote :

I installed 3 new .deb maas 3.5 region+rack controllers and removed my 3 older snap ones and faced this.

Workaround:
maas-region dbshell
UPDATE maasserver_bootsource SET keyring_filename='/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg' WHERE id=1;

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.