Snapcraft Docker images broken again?


Since a week or two ago we have been getting the following error when trying to use snapcraft in Docker:

/snap/bin/snapcraft: 3: exec: /snap/snapcraft/current/usr/bin/python3: not found

Testing inside the container:

root@xxxxxxxx:/# ls -la /snap/snapcraft/current/usr/bin/python3
lrwxrwxrwx 1 root root 9 Mar 13  2020 /snap/snapcraft/current/usr/bin/python3 -> python3.8
root@xxxxxxxx:/# ls -la /snap/snapcraft/current/usr/bin/python3.8
-rwxr-xr-x 1 root root 5494584 Oct 27 01:22 /snap/snapcraft/current/usr/bin/python3.8
root@xxxxxxxx:/# /snap/snapcraft/current/usr/bin/python3.8 --version
bash: /snap/snapcraft/current/usr/bin/python3.8: No such file or directory

It seems that Python3 is being problematic. Any idea as to what exactly is going on here?

The Docker image we’re using is built from essentially the same Dockerfile as, and was working just fine until recently.

I saw another topic on this forum about this from ~2 years ago, and while the error shown is the same, I’m not sure if the underlying issue is the same, considering that the PR linked in that topic was already merged long ago, and things were working fine until recently and now seem to be broken again.

EDIT: Oops, Snapcraft failed in container and Snapcraft (Python) segfault on Ampere A1 aarch64 + Oracle Linux 8 seem to be about this; sorry for the potential duplicate. Though the suggested temporary workaround in the former thread appears to work, I’ll leave this thread open for the time being until the issue is properly resolved.