Different version of snapcraft used

I have a problem with one of the snapcraft updates 7.5.4, so I temporarilly tried to revert back of a snap refresh to 7.5.3, and somehow it looks like even though reverted back the old version it reports it uses 7.5.4 internally?

Starting Snapcraft 7.5.3
Logging execution to '/home/phr34k/.local/state/snapcraft/log/snapcraft-20231203-220445.143454.log'
Running on amd64 for amd64
Launching instance...
Checking for instance 'snapcraft-liquid-pos-on-amd64-for-amd64-101617' in project 'snapcraft' in remote 'local'
Instance exists and is not running. Starting instance.
Starting Snapcraft 7.5.4
Logging execution to '/tmp/snapcraft.log'
Running on amd64 for amd64
Initializing parts lifecycle
Executing parts lifecycle...
Executing parts lifecycle: pull source
Executing action
Failed to refresh package list: failed to run apt update.
Failed to execute build in instance.
Full execution log: '/home/phr34k/.local/state/snapcraft/log/snapcraft-20231203-220445.143454.log'
Starting Snapcraft 7.5.4
Logging execution to '/home/phr34k/.local/state/snapcraft/log/snapcraft-20231203-220910.873813.log'
Running on amd64 for amd64
Launching instance...
Deprecated: Parameter 'build_base' is deprecated and should not be used. The build base now comes from the base_configuration's alias.

Starting instance
craft-providers error: Instance setup failed. Check LXD logs for more details.
Full execution log: '/home/phr34k/.local/state/snapcraft/log/snapcraft-20231203-220910.873813.log'

What if you snapcraft clean? Does it go back to 7.5.3 then?

I first tried snapcraft clean, then I proceeded and check for snap changes confirming a version update which I proceeded to rollback, and after that I even uninstalled lxd and snapcraft (--purge) and reinitialize it without luck.

The new version keeps erroring on snapcraft craftproviders and I have zero clue what it actually trying to do, and I cannot find anything out of the ordinary in the lxd logs. Just a single error about /dev/kvm being unavailable, but spinning up lxc launch ubuntu:focal my-test manually works fine.

The old version that I know was safe, started to give errors with apt-get from [build-packages, stage-packages] related instructions, and basically apt-get fails because it cannot access the release files on the package repositories – this is likely it ends up not using the http proxy that I pass in through --http-proxy= and rely on.

What is stroke me as odd though is that clearly on the host system I revert back to snapcraft 7.5.3 for a good reason, and I wonder why when I explicitly revert back everything is still broken from clearly an app-update. Neither the old version is working, nor the new version, just everything is broken, and I suspect the reason for that is the second 7.5.4 version thats probably inside of the core22 image.

Hey @phr34k,

Can you post the full execution logs where snapcraft 7.5.3 is using 7.5.4 inside the LXD instance?

The problem with LXD instances not launching and failing on apt update is unfortunate. 7.5.4 has an issue where LXD instances will not launch if the first instance fails to be fully setup. We have a fixed queued here, but for now you can workaround this by cleaning out your LXD snapcraft instances (lxc list --project snapcraft -fcsv -cn | xargs lxc delete --project snapcraft --force). If the apt update problem still occurs after this, can you post those full execution logs as well?


Instead of that workaround, can you install the version of snapcraft from that branch (snap refresh snapcraft --channel=latest/edge/pr-4462)?

@mr_cal I installed the version from that branch and that seems to be working for me. I am happy with the fix but I do wonder though, why downgrading through snap revert didn’t just solve my problem.

It’s a bit concerning that an single update can also cause a persistant effect on older versions from working properly and I think these sort of scenarios should be prevented.

Glad that version worked for you!

I’m not sure why downgrading from 7.5.4 to 7.5.3 didn’t change the version of snapcraft inside the LXD container. I haven’t seen that before and haven’t been able to reproduce it yet. If it occurs again, full execution logs would be very useful!