Closed DnPlas closed 1 year ago
I'm not sure this is necessarily intended behaviour, but I can at least tell you what's causing it and how to work around it ITMT — it's occurring because multiple charmcraft instances are being run in parallel and started nearly simultaneously, leading to a race condition in craft-providers.
In the log output above, the race is occurring when multiple instances of charmcraft try to create the charmcraft
project simultaneously (running LXC.project_create
). You should be able to work around that by creating an lxc project called charmcraft
before trying to run any charmcraft instances.
However, from the linked action step, it's failing at a different point — specifically, when creating a base instance.
To get your CI working without destructive mode, the most stable workaround is probably to run only one instance of charmcraft at a time. If the charms all build on the same base (which it looks like they do), you might be able to build one charm on its own and then build the rest simultaneously.
I'm going to mark this as a duplicate of #1132. Once the issue is solved in craft-providers we can release a charmcraft update that resolves it.
This was not solved by #1132
We will create a test reproducer for this first to run in Spread and verify the failure, then updated craft providers with the fix from https://github.com/canonical/craft-providers/issues/341 and thus fix the issue
Bug Description
The Charmed Kubeflow team has a repository with 7 charms (canonical/kfp-operators), in which the CI runs to build and deploy the seven of them. Having this many charms may be causing an issue as we are getting the following error when calling
built_charms = await ops_test.build_charms(*charms_to_build.values())
:For more details go here
It sometimes fails with:
Same as #1132
For more details go here
Workaround
For me using
destructive-mode
works, of course, but it is far from ideal.To Reproduce
I haven't been able to reproduce in my local dev machine, but happens on GH runners:
Apply this patch
Environment
charmcraft.yaml
Relevant log output