Fixing LXC Container Permissions and Network Issues

sTiKyt

New Member
Aug 14, 2024
1
0
1
Hello Proxmox Community,

I’m seeking help with an LXC container that failed to start and encountered several issues. Here’s a summary of the problem and the steps I’ve taken so far:


Our LXC container (ID: 565) failed to start with the following error message:
Code:
sync_wait: 34 An error occurred in another process (expected sequence number 7)
__lxc_start: 2114 Failed to spawn container "565"
TASK ERROR: startup for container '565' failed

Steps Taken:

1. Accessing the Container:
I accessed the container by mounting it and using chroot and found that apt and init were missing. I manually downloaded and installed apt along with its dependencies after several retries.

2. Restoring Basic Functionality:
I managed to reinstall init, and now the container starts, but it’s facing the following issues:
  • Network Interfaces: The network interfaces are always DOWN on start.
  • Permissions: Permissions seem to be incorrect everywhere, and I’ve been trying to fix them using the following approach:
Code:
# /etc: System configuration files
chattr -i /var/lib/lxc/565/rootfs/etc
chown -R 100000:100000 /var/lib/lxc/565/rootfs/etc
chmod -R 755 /var/lib/lxc/565/rootfs/etc
chmod 700 /var/lib/lxc/565/rootfs/etc/cron.d
chmod 700 /var/lib/lxc/565/rootfs/etc/cron.daily
chmod 700 /var/lib/lxc/565/rootfs/etc/cron.hourly
chmod 700 /var/lib/lxc/565/rootfs/etc/cron.monthly
chmod 700 /var/lib/lxc/565/rootfs/etc/cron.weekly

# /var: Variable data files, logs, and application-specific data
chattr -i /var/lib/lxc/565/rootfs/var
chown -R 100000:100000 /var/lib/lxc/565/rootfs/var
chmod -R 755 /var/lib/lxc/565/rootfs/var
chmod 1777 /var/lib/lxc/565/rootfs/var/tmp
chmod 1777 /var/lib/lxc/565/rootfs/var/spool

# /usr: System-wide application files
chattr -i /var/lib/lxc/565/rootfs/usr
chown -R 100000:100000 /var/lib/lxc/565/rootfs/usr
chmod -R 755 /var/lib/lxc/565/rootfs/usr

# /bin: Essential user binaries
chattr -i /var/lib/lxc/565/rootfs/bin
chown -R 100000:100000 /var/lib/lxc/565/rootfs/bin
chmod -R 755 /var/lib/lxc/565/rootfs/bin

# /sbin: Essential system binaries
chattr -i /var/lib/lxc/565/rootfs/sbin
chown -R 100000:100000 /var/lib/lxc/565/rootfs/sbin
chmod -R 755 /var/lib/lxc/565/rootfs/sbin

Current Issues:
  • Network Configuration: Network interfaces remain DOWN upon startup. I need guidance on resolving this issue.
  • Permissions: Although I’ve made adjustments, the container still exhibits permissions issues. Any advice on additional fixes or checks would be helpful.
  • Plesk: I'm unable to install plesk using it's official installer script. This container had it before.
Have you encountered anything like this before?
Is there a better way to recover an LXC container in my situation?
What could have caused this sudden damage, leading to such issues?
Can anyone suggest additional steps to resolve the network interface problems or correct permissions more effectively?
Are there specific logs or files I should check to troubleshoot these issues further?
 

Attachments

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!