microk8s installation fails with "cannot execute: required file not found" error
Description: When attempting to install MicroK8s using Snap on a Linux machine, the installation fails during the install hook with the following error:
bash Copy code $ sudo snap install microk8s --classic error: cannot perform the following tasks:
- Run install hook of "microk8s" snap if present (run hook "install":
- source /snap/microk8s/7232/actions/common/utils.sh ...
- mkdir -p /var/snap/microk8s/common/run /snap/microk8s/7232/actions/common/utils.sh: line 1392: /snap/microk8s/7232/bin/mkdir: cannot execute: required file not found
) Steps to Reproduce: Run the following command on a Linux machine: bash Copy code sudo snap install microk8s --classic Observe the error message during installation. Expected Behavior: The MicroK8s snap should install successfully without errors.
Actual Behavior: The installation fails with the following error message:
bash Copy code /snap/microk8s/7232/actions/common/utils.sh: line 1392: /snap/microk8s/7232/bin/mkdir: cannot execute: required file not found Environment: OS: (Linux Mint 22 (Ubuntu 22.04 LTS)) Snap Version: snap --version 2.65.3+24.04 Snapd Version: snapd --version 2.65.3+24.04 MicroK8s Version: (Attempted with the version from the stable channel) Shell: (e.g., Bash) Troubleshooting Steps Tried: Reinstall Snapd: bash Copy code sudo apt update && sudo apt install --reinstall snapd Ensure Snapd Services Are Running: bash Copy code sudo systemctl restart snapd sudo systemctl status snapd Check Permissions: Verified permissions for /var/snap/microk8s. Switch to Another Channel: Tried different versions using: bash Copy code sudo snap install microk8s --classic --channel=latest/stable snap install microk8s --classic --channel=1.31/stable Possible Cause: It seems the install hook script is trying to call the mkdir binary from within the MicroK8s snap at /snap/microk8s/7232/bin/mkdir, but this file is either missing or not executable. This might indicate:
A corrupted or incomplete snap package. A broken link or missing dependency in the snap package. Request for Assistance: Could this be a packaging issue with the current MicroK8s release? Are there any known workarounds to resolve the issue? Any suggestions on how to manually debug and fix the missing binary issue? Logs & Diagnostics: bash Copy code $ snap --version snap 2.65.3+24.04 snapd 2.65.3+24.04 series 16 bash Copy code $ sudo systemctl status snapd ● snapd.service - Snap Daemon Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2024-10-20 12:18:48 EDT; 4min 41s ago Thank you for your assistance in resolving this issue. Please let me know if any additional information or logs are required.
Issue Labels: microk8s, snap, installation-error, bug
Hi @sibman can you reproduce this on your end? It seems like a snap package corruption but even the revision you requested seems fine:
$ sudo snap install microk8s --classic --revision 7232
microk8s (1.30/stable) v1.30.5 from Canonical✓ installed
seeing same error with install
sudo snap install microk8s --channel=1.33 --classic
error: cannot perform the following tasks:
- Run install hook of "microk8s" snap if present (run hook "install":
-----
+ source /snap/microk8s/8507/actions/common/utils.sh
++ [[ /snap/microk8s/8507/meta/hooks/install == \/\s\n\a\p\/\m\i\c\r\o\k\8\s\/\8\5\0\7\/\a\c\t\i\o\n\s\/\c\o\m\m\o\n\/\u\t\i\l\s\.\s\h ]]
+ '[' -f /var/snap/microk8s/8507/var/lock/installed.lock ']'
+ use_snap_env
+ export PATH=/snap/microk8s/8507/usr/bin:/snap/microk8s/8507/bin:/snap/microk8s/8507/usr/sbin:/snap/microk8s/8507/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
+ PATH=/snap/microk8s/8507/usr/bin:/snap/microk8s/8507/bin:/snap/microk8s/8507/usr/sbin:/snap/microk8s/8507/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
+ export LD_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void:/snap/microk8s/8507/lib:/snap/microk8s/8507/usr/lib:/snap/microk8s/8507/lib/x86_64-linux-gnu:/snap/microk8s/8507/usr/lib/x86_64-linux-gnu:/snap/microk8s/8507/usr/lib/x86_64-linux-gnu/ceph:
+ LD_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void:/snap/microk8s/8507/lib:/snap/microk8s/8507/usr/lib:/snap/microk8s/8507/lib/x86_64-linux-gnu:/snap/microk8s/8507/usr/lib/x86_64-linux-gnu:/snap/microk8s/8507/usr/lib/x86_64-linux-gnu/ceph:
+ export PYTHONPATH=/snap/microk8s/8507/usr/lib/python3.8:/snap/microk8s/8507/lib/python3.8/site-packages:/snap/microk8s/8507/usr/lib/python3/dist-packages
+ PYTHONPATH=/snap/microk8s/8507/usr/lib/python3.8:/snap/microk8s/8507/lib/python3.8/site-packages:/snap/microk8s/8507/usr/lib/python3/dist-packages
+ export PYTHONNOUSERSITE=false
+ PYTHONNOUSERSITE=false
+ for locale in C.UTF-8 en_US.UTF-8 en_US.utf8
++ export LC_ALL=C.UTF-8
+ '[' -z '++ LC_ALL=C.UTF-8' ']'
+ for locale in C.UTF-8 en_US.UTF-8 en_US.utf8
++ export LC_ALL=en_US.UTF-8
+ '[' -z '++ LC_ALL=en_US.UTF-8' ']'
+ for locale in C.UTF-8 en_US.UTF-8 en_US.utf8
++ export LC_ALL=en_US.utf8
+ '[' -z '++ LC_ALL=en_US.utf8' ']'
+ export XDG_RUNTIME_DIR=/var/snap/microk8s/common/run
+ XDG_RUNTIME_DIR=/var/snap/microk8s/common/run
+ mkdir -p /var/snap/microk8s/common/run
/snap/microk8s/8507/actions/common/utils.sh: line 1394: /snap/microk8s/8507/bin/mkdir: cannot execute: required file not found