Stumped ! - [Errno 13] Permission denied when adding boot-resources

New to MAAS and have set up development / test server. All is working for Ubunut cloud images in both VM and Physical deployments - so I’m happy with that.

Of course, we also live in a Windows world, so I’ve worked to get my head around the cloudbase-init image builder scripts and put together a shiny new image that I’d like to import into MAAS for testing.

Unfortunately, I just cannot get MAAS to resource the image, and can’t find any meaningful logs to help. For this case, I have a user - account name: the-techdude, and the following has taken place:

  • In MAAS, thre is a user (the-techdude) who has been assigned the role of Admin (via web GUI)

  • SSH into the server (for this case, also with an account ID of the-techdude)

  • API key has been generated:

    sudo maas apikey --username=the-techdude > ~/api-key-file  
  • Log in:
sudo maas login the-techdude http://localhost:5240/MAAS/api/2.0/ $(head -1 ~/api-key-file)
  • New image has been uploaded and is compressed to .tgz. I’ve tested to make sure there were no issues with the upload, and tar can list the contents just fine. Ownership / permissions are as follows and the file has been placed in the home directory:
-rw-rw-r-- 1 the-techdude the-techdude 11962309926 Jul 25 17:40 Win10_22H2_English_x64v1_custom.tgz
  • I then attempt to create a new boot resource:
sudo maas the-techdude boot-resources create name='custom/customwin10' title='Windows 10 22H2 (cloud)' architecture='amd64/generic' filetype='tgz' content@=~/Win10_22H2_English_x64v1_custom.tgz
  • I’m then presented with:
[Errno 13] Permission denied: : 'Win10_22H2_English_x64v1_custom.tgz'
  • I’m hardly a 'nix expert here, but I’ve checked what logs I can find in both system and MAAS itself and there’s nothing that gives the game away.

  • If I rerun the command with create -d, the following is reported:

Traceback (most recent call last):
  File "/snap/maas/36280/bin/maas", line 8, in <module>
    sys.exit(main())
  File "/snap/maas/36280/lib/python3.10/site-packages/maascli/__init__.py", line 39, in main
    options.execute(options)
  File "/snap/maas/36280/lib/python3.10/site-packages/maascli/actions/boot_resources_create.py", line 39, in __call__
    content = self.initial_request(uri, options)
  File "/snap/maas/36280/lib/python3.10/site-packages/maascli/actions/boot_resources_create.py", line 61, in initial_request
    body, headers = self.prepare_initial_payload(options.data)
  File "/snap/maas/36280/lib/python3.10/site-packages/maascli/actions/boot_resources_create.py", line 109, in prepare_initial_payload
    size, sha256 = self.calculate_size_and_sha256(content)
  File "/snap/maas/36280/lib/python3.10/site-packages/maascli/actions/boot_resources_create.py", line 122, in calculate_size_and_sha256
    with content() as fd:

It really does look as though MAAS cannot get a hold on this file and I’m really not sure where to go with it from here.

I have a feeling this might be a simple one, but my ignorance is in play … so any help would be most appreciated!

don’t run the MAAS CLI with sudo, it’s not required (with exception to a few commands) and it doesn’t work when you try to access any file in your disk.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.