We are using the latest MAAS and tried to build using make snap and sync-dev-snap, both commands failed with the below error.
Failed to generate snap metadata: The specified command ‘bin/maas-power’ defined in the app ‘power’ does not exist. Ensure that ‘bin/maas-power’ is installed with the correct path.
We could see the power app mentioned under the apps section in snapcraft.yaml file
power:
command: bin/maas-power
plugs:
- network
Could you please check and let us know the reason for the failure and provide a solution or workaround?
Thanks for the reply. Please find the answers below.
what is the Ubuntu version in the host you are building MAAS? (must be Focal for 3.1) rkarna@ubuntu2004:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal
did you installed the dependencies first? (make install-dependencies) Yes
I am collecting the build logs, will post the errors.
I executed make snap and found only the below error at two places ERROR: launchpadlib 1.10.13 requires testresources, which is not installed.
But the build did not stop there and failed at Failed to generate snap metadata: The specified command ‘bin/maas-power’ defined in the app ‘power’ does not exist.
If I am not wrong the launchpadlib was expecting testresources already installed in the snap image.
Is the build failed because of the above error?
I want to provide the complete build log, but I don’t see any option to add attachments.
I have pasted the complete build log in the below link. Could you please have a look and let me know if anything more is required. https://paste.ubuntu.com/p/PWD2Xqkrpp/
I have reverted to the previous snapcraft version but still encountered the same error.
I have pasted the complete build log in the below link. https://paste.ubuntu.com/p/SPyBw3Hs3M/
Could you please provide the git repository link which has the fix, I’ll install it and try to build MAAS with snap.
I am using master branch, i did git pull before the build, Just now i cross verified and the fix is present in the snapcraft.yaml file. I will delete and download the code and build again.
I have the latest code with the fix unfortunately still got the same error.
Could you please confirm if you are able to build?
I tried a change in the snapcrat.yaml file and I am able to build and install.
Here is the change, I commented the PYTHONPATH # - PYTHONPATH: $SNAP/usr/lib/python3/dist-packages:$SNAP/usr/lib/python3.8/dist-packages
I’m still looking at this. I have found that it fails when PYTHONPATH is defined AND the python3-pip package is installed. In this case pip is not installed in the virtualenv and snapcraft uses the host binary, which installs modules in the wrong path.
I’m discussing with the team what is the best fix for this (removing the path or correcting its definition).
I am having the exact same problem.
Any update on this thread?
I commented out the PYTHONPATH bits and make still fails with the same error:
Failed to generate snap metadata: The specified command ‘bin/maas-power’ defined in the app ‘power’ does not exist.
Ensure that ‘bin/maas-power’ is installed with the correct path.
make: *** [Makefile:406: snap] Error 2