"interface file missing" in snapd 2.58 + lxd + fedora

Bug #2002835 reported by Tiago Nobrega
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Critical
Unassigned

Bug Description

The setup is this: a fedora 35 host (a google vm running a spread test), running an ubuntu 22.04 lxd instance, running snapd inside.
The behavior seems to be that a "snap set ..." command will fail the first time, and then work.
The failure output is this:

root@test-ubuntu2204:~# snap set system refresh.hold=2023-01-14T19:38:14.031694Z
error: cannot perform the following tasks:
- Run configure hook of "core" snap (run hook "configure": cannot load apparmor profiles: exit status 1
apparmor_parser output:
Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
Use --subdomainfs to override.
)

... then if I repeat the command it works fine. Confirmed to happen in Fedora 35 and 37 so far. The attached file has the commands used to reproduce it together with more debugging info. The file shows that this behavior happens with snapd 2.58, but not with 2.57.6.

Revision history for this message
Tiago Nobrega (tigarmo) wrote :
description: updated
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

Is this is regression, i.e. was this working with 2.57.x? Or with a previous version of lxd ?

Changed in snapd:
status: New → Incomplete
Revision history for this message
Tiago Nobrega (tigarmo) wrote :

Yes, correct. This started failing once snapd updated to 2.58. On the original attachment it's possible to see that the command "snap set system refresh.hold=2023-01-14T19:38:14.031694Z" works with 2.57.6 but then fails with 2.58 right after. Thanks!

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for double checking! Can you please try to run "snap revert snapd" ? This should bring you back to version 2.57.6 and double check? This should also unblock you from this failure until we figure out what is going wrong.

Changed in snapd:
status: Incomplete → Confirmed
importance: Undecided → High
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Michael, it is really hard to revert as this happens in the container created with LXD through Snapcraft.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This also affects Arch and NixOS users

Revision history for this message
Jon Seager (jnsgruk) wrote :

I also just ran into this as part of an exception raised by craft-providers:

jon@thor in  ~/parca-scrape-target-operator  main
❯ charmcraft pack --verbose
Starting charmcraft version 2.1.0.dev0+unknown
Logging execution to '/home/jon/.local/state/charmcraft/log/charmcraft-20230125-130010.005914.log'
Packing the charm.
Launching environment to pack for base name='ubuntu' channel='22.04' architectures=['amd64'] (may take a while the first time but it's reusable)
Deprecated: Parameter 'use_snapshots' is deprecated. Use parameter 'use_base_instance' instead.
Checking for instance 'charmcraft-parca-scrape-target-14920-0-0-amd64' in project 'charmcraft' in remote 'local'
Instance exists and is not running. Starting instance.
charmcraft internal error: LXDError(brief='Failed to hold snap refreshes.\n* Command that failed: \'lxc --project charmcraft exec local:charmcraft-parca-scrape-target-14920-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 snap set system refresh.hold=2023-01-26T13:00:13.587872Z\'\n* Command exit code: 1\n* Command standard error output: b\'error: cannot perform the following tasks:\\n- Run configure hook of "core" snap (run hook "configure": cannot load apparmor profiles: exit status 1\\napparmor_parser output:\\nCache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)\\nWarning: unable to find a suitable fs in /proc/mounts, is it mounted?\\nUse --subdomainfs to override.\\n)\\n\'', details=None, resolution=None)
Full execution log: '/home/jon/.local/state/charmcraft/log/charmcraft-20230125-130010.005914.log'

Revision history for this message
Marc Oppenheimer (marcoppenheimer) wrote :

To add to this, on Arch Linux, 6.1.7-zen1-1-zen kernel:

```

kafka-operator main ❯ charmcraft clean && charmcraft pack --debug
Cleaning project 'kafka'.
Cleaned project 'kafka'.
charmcraft internal error: CalledProcessError(1, ['lxc', '--project', 'charmcraft', 'exec', 'local:charmcraft-kafka-3688420-0-0-amd64', '--', 'env', 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'CHARMCRAFT_MANAGED_MODE=1', 'snap', 'set', 'system', 'refresh.hold=2023-01-26T16:16:39.563760Z'])
Full execution log: '/home/marc/.local/state/charmcraft/log/charmcraft-20230125-161627.897560.log'

kafka-operator main ❯ lxc exec --project=charmcraft charmcraft-kafka-3688420-0-0-amd64 bash
root@charmcraft-kafka-3688420-0-0-amd64:~# snap set system refresh.hold=2023-01-26T16:16:39.563760Z
root@charmcraft-kafka-3688420-0-0-amd64:~# echo $?
0
root@charmcraft-kafka-3688420-0-0-amd64:~# exit
exit

kafka-operator main ❯ charmcraft pack --debug
Packing the charm

DONE
```

Michael Vogt (mvo)
Changed in snapd:
importance: High → Critical
Revision history for this message
Michael Vogt (mvo) wrote :

This is fixed with https://github.com/snapcore/snapd/pull/12533 and waits for the release of 2.58.3

Changed in snapd:
status: Confirmed → Fix Committed
Changed in snapd:
status: Fix Committed → Fix Released
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.