after upgrade to proxmox 9, mysql is not working inside lxc

dorijan79

Active Member
May 5, 2018
19
2
43
46
Hi to all,
after upgrading to proxmox 9 from 8, inside my ubuntu 20.04 I am running mysql server and it didnt want to start


Code:
[ 3035.876248] audit: type=1400 audit(1755111844.969:36487): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189099 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3035.876270] audit: type=1400 audit(1755111844.969:36488): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189099 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3035.876383] audit: type=1400 audit(1755111844.969:36489): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189099 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3035.876398] audit: type=1400 audit(1755111844.969:36490): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189099 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3035.876525] audit: type=1400 audit(1755111844.969:36491): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189099 comm="mysqld" family="unix" sock_type="dgram" protocol=0 requested="create" denied="create" addr=none
[ 3035.876566] audit: type=1400 audit(1755111844.969:36492): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189099 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3035.876581] audit: type=1400 audit(1755111844.969:36493): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189099 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3035.908239] audit: type=1400 audit(1755111845.001:36494): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189100 comm="mysqld" family="unix" sock_type="dgram" protocol=0 requested="create" denied="create" addr=none
[ 3036.162692] audit: type=1400 audit(1755111845.255:36495): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189100 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3036.162714] audit: type=1400 audit(1755111845.255:36496): apparmor="DENIED" operation="create" class="net" namespace="root//lxc-107_<-var-lib-lxc>" profile="/usr/sbin/mysqld" pid=189100 comm="mysqld" family="unix" sock_type="stream" protocol=0 requested="create" denied="create" addr=none
[ 3040.891716] kauditd_printk_skb: 27 callbacks suppressed

the only way I was able to run it is to put
lxc.apparmor.profile: unconfined

is there any other way to fix this?
 
I've heard that apparmor was causing issues for some lcx upgrades.
Run apt install --fix-broken and see if it fixes anything. Take a snap shot before running just incase.
 
  • Like
Reactions: Kingneutron
thank you, but where to run? inside lxc container?

apt is working fine, but mysql would not start if I did not put it to unconfined
 
Run that inside the lxc.
Again not sure if this will fix your issue, but I've heard the apparmor was causing issues and this seemed to fix it.
 
I had the same issue after the upgrade to Proxmox v9 for 2 of my containers running ubuntu 20.04. I found an article with these commands that fixed it for me

https://linuxconfig.org/how-to-disable-apparmor-on-ubuntu-20-04-focal-fossa-linux

For example we will now disable AppArmor for a MySQL server:

Code:
$ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
$ apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld

This managed to fix my ghost site but my wordpress site is still broken unfortunately.
 
Last edited:
I can only confirm that mysql (with MythTV) on Ubuntu 24.04.x does not have this issue. Maybe it is becoming time to update the OS inside the container?