Closed jamesbeedy closed 2 years ago
The first snippet says For a supported user experience, please use the Charmcraft snap.
are you sure you are using the new snapcraft from the snap instead of a pip installation?
Ahh yes, I am on my local setup and I get the same error. I don't think the warning is related.
I can't reproduce this on my machine. The same command runs on the CI as well and I can't see any failures on it.
Can you confirm the charmcraft version?
$ charmcraft version
$ which charmcraft
$ snap info charmcraft
hitting this again
$ make charms
Packing charm 'slurmd_ubuntu-20.04-amd64_centos-7-amd64.charm'...
Created 'slurmd_ubuntu-20.04-amd64_centos-7-amd64.charm'.
Packing charm 'slurmdbd_ubuntu-20.04-amd64_centos-7-amd64.charm'...
Created 'slurmdbd_ubuntu-20.04-amd64_centos-7-amd64.charm'.
Packing charm 'slurmctld_ubuntu-20.04-amd64_centos-7-amd64.charm'...
charmcraft internal error! BaseConfigurationError: Failed to setup snapd.
* Command that failed: 'lxc --project charmcraft exec local:charmcraft-slurmctld-16777867-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 systemctl restart snapd.service'
* Command exit code: 1
* Command standard error output: b'Job for snapd.service canceled.\n' (full execution logs in /home/bdx/snap/charmcraft/common/charmcraft-log-r3pk10zj)
cp: cannot stat 'slurmctld_ubuntu-20.04-amd64_centos-7-amd64.charm': No such file or directory
make: *** [Makefile:43: slurmctld] Error 1
$ charmcraft version
1.2+26.g81a8719
bdx@raton00:~/allcode/github/omnivector/slurm-charms$ which charmcraft
/snap/bin/charmcraft
bdx@raton00:~/allcode/github/omnivector/slurm-charms$ snap info charmcraft
name: charmcraft
summary: The charming tool
publisher: Canonical✓
store-url: https://snapcraft.io/charmcraft
license: Apache-2.0
description: |
Charmcraft enables charm creators to build, publish, and manage charmed operators for Kubernetes,
metal and virtual machines.
commands:
- charmcraft
snap-id: gcqfpVCOUvmDuYT0Dh5PjdeGypSEzNdV
tracking: latest/edge
refresh-date: yesterday at 08:45 UTC
channels:
latest/stable: 1.1.1 2021-07-15 (513) 51MB classic
latest/candidate: 1.2.0 2021-08-03 (573) 55MB classic
latest/beta: ↑
latest/edge: 1.2+26.g81a8719 2021-08-11 (595) 55MB classic
installed: 1.2+26.g81a8719 (595) 55MB classic
I think we need a sleep in there....
charmcraft internal error
looks like something outside of our code.
This is in part due to https://github.com/canonical/charmcraft/issues/478, an internal Charmcraft error is returning 0
. This way, make
thinks Charmcraft succeeded and continues to the next task.
I do have the same issue. Is this problem having a solution?
I think it may be as simple as adding a sleep 1 after calling ‘charmcraft build’ in each of the slurm charm component build commands in the makefile.
This is a charmcraft bug: if an internat command fails, charmcraft crashes but exits with 0
, the charm is never built but the Makefile does not know that and proceeds to the next command.
Adding a sleep 1
would not fix it.
Is this problem still hitting you @mmrezaie?
Closing this as it was fixed in recent versions of Charmcraft.
Describe the bug Oftentimes when I build the charms I get an error that tells me that the produced charm file is not available. I need to re-run the
make charms
command, which sometimes fails again on another file.When running
make charms
, after the pack command finishes and the.charm
is produced, the built charm is transferred from the lxd container build environment to the local filesystem. We immediately follow thecharmcraft pack
command with acp
command that copies the built charm file to a new filename<slurm-component>.charm
. I have a feeling that the produced.charm
artifact file needs a moment to finish transferring from the container before we try to access it.To Reproduce
Expected behavior I expect the
make charms
command to successfully create the charms.Additional context