Snapd runtime error in AL2023

Bug #2045264 reported by Milos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Medium
Unassigned

Bug Description

Hi, I'm having difficulties installing snaps in AL2023 OS.

I've tried in two different ways:

Boot an amazon linux machine (AL2023)

#uname -a
```
Linux ip-172-31-46-147.ec2.internal 6.1.61-85.141.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 8 00:39:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```

Enable `squashfs` module (and add it to /etc/modules)

Squashfs config:
```
CONFIG_SQUASHFS=m
CONFIG_SQUASHFS_FILE_CACHE=y
# CONFIG_SQUASHFS_FILE_DIRECT is not set
CONFIG_SQUASHFS_DECOMP_SINGLE=y
# CONFIG_SQUASHFS_DECOMP_MULTI is not set
# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set
CONFIG_SQUASHFS_XATTR=y
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZ4=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
```

Restart the VM, and make sure that:
`lsmod` outputs `squashfs` and `loop`

I tried installing it in two ways:

#### 1. Install from EPEL9 (some packages might not be necessary)

```
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/squashfs-tools-ng-1.2.0-2.el9.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/squashfs-tools-ng-devel-1.2.0-2.el9.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/squashfs-tools-ng-libs-1.2.0-2.el9.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/squashfuse-0.1.104-1.el9.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/squashfuse-devel-0.1.104-1.el9.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/squashfuse-libs-0.1.104-1.el9.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/snap-confine-2.58.3-1.el9.x86_64.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/snapd-selinux-2.58.3-1.el9.noarch.rpm
wget https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/s/snapd-2.58.3-1.el9.x86_64.rpm

sudo yum install squashfuse-libs-0.1.104-1.el9.x86_64.rpm squashfuse-0.1.104-1.el9.x86_64.rpm squashfs-tools-ng-1.2.0-2.el9.x86_64.rpm squashfs-tools-ng-devel-1.2.0-2.el9.x86_64.rpm squashfs-tools-ng-libs-1.2.0-2.el9.x86_64.rpm squashfuse-devel-0.1.104-1.el9.x86_64.rpm snap-confine-2.58.3-1.el9.x86_64.rpm snapd-selinux-2.58.3-1.el9.noarch.rpm snapd-2.58.3-1.el9.x86_64.rpm
```

Running `snap` returns help commands as expected

Run `(sudo) snap install snap-store-proxy` returns:
```
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
       /tmp/syscheck-mountpoint-1357066368: wrong fs type, bad option, bad superblock on
       /dev/loop0, missing codepage or helper program, or other error.

```
#### 2. Build from source

```
sudo dnf install -y git libseccomp-devel xfsprogs-devel libcap-devel go
git clone https://github.com/snapcore/snapd.git
cd snapd/
mkdir -p /tmp/build
go build -o /tmp/build ./...
cd /tmp/build
sudo ./snapd
```

Log output
```
2023/11/30 11:32:10.048397 overlord.go:271: Acquiring state lock file
2023/11/30 11:32:10.048717 overlord.go:276: Acquired state lock file
2023/11/30 11:32:10.056725 patch.go:64: Patching system state level 6 to sublevel 1...
2023/11/30 11:32:10.059219 patch.go:64: Patching system state level 6 to sublevel 2...
2023/11/30 11:32:10.061908 patch.go:64: Patching system state level 6 to sublevel 3...
2023/11/30 11:32:10.071653 daemon.go:247: started snapd/2.58+git1507.g3a88dc38ca (series 16; classic; devmode) amzn/2023 (amd64) linux/6.1.61-85.141.amzn2023.x8.
2023/11/30 11:32:10.116956 main.go:125: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount: /tmp/syscheck-mountpoint-236683182: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
2023/11/30 11:32:10.117119 daemon.go:340: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
2023/11/30 11:32:10.118420 backends.go:58: AppArmor status: apparmor not enabled
2023/11/30 11:32:10.132644 system_key.go:254: running from non-installed location /tmp/build/snapd: ignoring system-key
2023/11/30 11:32:10.132729 helpers.go:146: error trying to compare the snap system key: system-key versions not comparable
2023/11/30 11:32:15.153860 daemon.go:519: gracefully waiting for running hooks
2023/11/30 11:32:15.153887 daemon.go:521: done waiting for running hooks
2023/11/30 11:32:18.154312 overlord.go:515: Released state lock file
daemon stop requested to wait for socket activation
```

Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

Hi, thanks for raising this. AL2023 is not supported yet by snapd. The team is working on supporting this system. I'll keep you updated.

Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

Hi, we have added snapd validation for AL2023 in google cloud. It is using a custom AL2023 image based on this one https://cdn.amazonlinux.com/al2023/os-images/2023.2.20231113.0/kvm/al2023-kvm-2023.2.20231113.0-kernel-6.1-x86_64.xfs.gpt.qcow2

Changed in snapd:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.