/etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE

I’m having problems starrting any snap app, so I ran: status apparmor.service, and got back:

* apparmor.service - Load AppArmor profiles
     Loaded: loaded (/lib/systemd/system/apparmor.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-12-24 16:36:40 CET; 25min ago
       Docs: man:apparmor(7)
             https://gitlab.com/apparmor/apparmor/wikis/home/
    Process: 1123 ExecStart=/lib/apparmor/apparmor.systemd reload (code=exited, status=1/FAILURE)
   Main PID: 1123 (code=exited, status=1/FAILURE)

Dec 24 16:36:40 obelix apparmor.systemd[1262]: AppArmor parser error for /etc/apparmor.d/usr.sbin.cupsd in profile /etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE
Dec 24 16:36:40 obelix apparmor.systemd[1266]: AppArmor parser error for /etc/apparmor.d/usr.sbin.haveged in profile /etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE
Dec 24 16:36:40 obelix apparmor.systemd[1270]: AppArmor parser error for /etc/apparmor.d/usr.sbin.ippusbxd in profile /etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE
Dec 24 16:36:40 obelix apparmor.systemd[1271]: AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld-digikam in profile /etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE
Dec 24 16:36:40 obelix apparmor.systemd[1275]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Dec 24 16:36:40 obelix apparmor.systemd[1277]: AppArmor parser error for /etc/apparmor.d/usr.sbin.tcpdump in profile /etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE
Dec 24 16:36:40 obelix apparmor.systemd[1123]: Error: At least one profile failed to load
Dec 24 16:36:40 obelix systemd[1]: apparmor.service: Main process exited, code=exited, status=1/FAILURE
Dec 24 16:36:40 obelix systemd[1]: apparmor.service: Failed with result 'exit-code'.
Dec 24 16:36:40 obelix systemd[1]: Failed to start Load AppArmor profiles.

The file it’s complaining about is multiarch:

-------------------------------------------------------------
# @{multiarch} is the set of patterns matching multi-arch library
# install prefixes.
@{multiarch}=*-linux-gnu*, 

# Also, include files in tunables/multiarch.d for site and packaging
# specific adjustments to @{multiarch}.
include <tunables/multiarch.d>
--------------------------------------------------------------

aa-status only gives:

apparmor module is loaded.

And when I want to uninstall anything in snap I get a similar error:

B$> snap remove audacity
error: cannot perform the following tasks:
- Disconnect audacity:pulseaudio from core:pulseaudio (cannot setup profiles for snap "audacity": cannot load apparmor profiles: exit status 1
apparmor_parser output:
AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap-update-ns.audacity in profile /etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE
AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap.audacity.audacity in profile /etc/apparmor.d/tunables/multiarch at line 13: syntax error, unexpected TOK_SET_VAR, expecting TOK_VALUE

Can this be fixed, or can I re-install snap from scratch?

Thanks.

I added triple backticks (```) to your post so that we can more easily read the outputs you have.

As you noted the file in question is /etc/apparmor.d/tunables/multiarch, which is not part of snapd. I suggest you file a bug against apparmor at bugs.launchpad.net/apparmor with this information. There is nothing that snapd can do, but you can probably just fix that one file and snapd will start working again. I don’t personally see anything wrong with that file, but I’m not sure…

That file on my system seems to match exactly what you have:

# ------------------------------------------------------------------
#
#    Copyright (C) 2010 Canonical Ltd.
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of version 2 of the GNU General Public
#    License published by the Free Software Foundation.
#
# ------------------------------------------------------------------

# @{multiarch} is the set of patterns matching multi-arch library
# install prefixes.
@{multiarch}=*-linux-gnu*

# Also, include files in tunables/multiarch.d for site and packaging
# specific adjustments to @{multiarch}.
include <tunables/multiarch.d>