canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.32k stars 926 forks source link

Services not starting on LXC Containers after container restart #12050

Closed greenman1969 closed 1 year ago

greenman1969 commented 1 year ago

Required information

Issue description

When setting up new lxc containers based on ubuntu:22.04 they initally start fine and start services normally, however after a restart they fail to start the ssh service and any other services I was expecting to have running such as smbd and jellyfin.

Steps to reproduce

  1. lxc launch ubuntu:22.04 test -p defaultContainer -p defaultUser -p vlan1
  2. lxc stop test
  3. lxc start test
  4. lxc shell
  5. systemctl status sshd * shows as dead and I cannot log in via ssh

Information to attach

Resources: Processes: 26 CPU usage: CPU usage (in seconds): 25 Memory usage: Memory (current): 73.18MiB Network usage: eth0: Type: broadcast State: UP Host interface: veth2da3ce3b MAC address: 00:16:3e:fd:37:69 MTU: 1500 Bytes received: 351.77kB Bytes sent: 124.53kB Packets received: 4155 Packets sent: 1790 IP addresses: inet: 10.0.0.157/24 (global) inet6: fe80::216:3eff:fefd:3769/64 (link) lo: Type: loopback State: UP MTU: 65536 Bytes received: 442B Bytes sent: 442B Packets received: 6 Packets sent: 6 IP addresses: inet: 127.0.0.1/8 (local) inet6: ::1/128 (local)

Log:

lxc smb0 20230720042513.181 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3621 - newuidmap binary is missing lxc smb0 20230720042513.181 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3627 - newgidmap binary is missing lxc smb0 20230720042513.182 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3621 - newuidmap binary is missing lxc smb0 20230720042513.182 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3627 - newgidmap binary is missing lxc smb0 20230720042517.199 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3621 - newuidmap binary is missing lxc smb0 20230720042517.199 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3627 - newgidmap binary is missing lxc smb0 20230720042642.886 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3621 - newuidmap binary is missing lxc smb0 20230720042642.886 WARN conf - ../src/src/lxc/conf.c:lxc_map_ids:3627 - newgidmap binary is missing

location: none metadata: context: ip: '@' method: GET protocol: unix url: /1.0 username: gage level: debug message: Handling API request timestamp: "2023-07-20T04:52:42.666810341Z" type: logging

location: none metadata: context: ip: '@' method: GET protocol: unix url: /1.0/instances/smb0 username: gage level: debug message: Handling API request timestamp: "2023-07-20T04:52:42.669025913Z" type: logging

location: none metadata: context: ip: '@' method: GET protocol: unix url: /1.0/events username: gage level: debug message: Handling API request timestamp: "2023-07-20T04:52:42.672075517Z" type: logging

location: none metadata: context: ip: '@' method: PUT protocol: unix url: /1.0/instances/smb0/state username: gage level: debug message: Handling API request timestamp: "2023-07-20T04:52:42.672490287Z" type: logging

location: none metadata: context: id: 22366fc4-efc2-4c41-9213-e6d57a9a3fdf local: /var/snap/lxd/common/lxd/unix.socket remote: '@' level: debug message: Event listener server handler started timestamp: "2023-07-20T04:52:42.672290217Z" type: logging

location: none metadata: context: instance: smb0 instanceType: container project: default stateful: "false" level: debug message: Start started timestamp: "2023-07-20T04:52:42.679535945Z" type: logging

location: none metadata: context: class: task description: Starting instance operation: ba249881-0a6c-499f-ab08-034cfa38ecc3 project: default level: debug message: Started operation timestamp: "2023-07-20T04:52:42.67945922Z" type: logging

location: none metadata: context: class: task description: Starting instance operation: ba249881-0a6c-499f-ab08-034cfa38ecc3 project: default level: debug message: New operation timestamp: "2023-07-20T04:52:42.679418338Z" type: logging

location: none metadata: context: action: start instance: smb0 project: default reusable: "false" level: debug message: Instance operation lock created timestamp: "2023-07-20T04:52:42.679696885Z" type: logging

location: none metadata: context: ip: '@' method: GET protocol: unix url: /1.0/operations/ba249881-0a6c-499f-ab08-034cfa38ecc3 username: gage level: debug message: Handling API request timestamp: "2023-07-20T04:52:42.680585192Z" type: logging

location: none metadata: context: driver: dir instance: smb0 pool: default project: default level: debug message: MountInstance started timestamp: "2023-07-20T04:52:42.681075076Z" type: logging

location: none metadata: context: driver: dir instance: smb0 pool: default project: default level: debug message: MountInstance finished timestamp: "2023-07-20T04:52:42.681488829Z" type: logging

location: none metadata: class: task created_at: "2023-07-20T04:52:42.674730949Z" description: Starting instance err: "" id: ba249881-0a6c-499f-ab08-034cfa38ecc3 location: none may_cancel: false metadata: null resources: instances:

location: none metadata: class: task created_at: "2023-07-20T04:52:42.674730949Z" description: Starting instance err: "" id: ba249881-0a6c-499f-ab08-034cfa38ecc3 location: none may_cancel: false metadata: null resources: instances:

location: none metadata: context: device: eth1 instance: smb0 instanceType: container project: default type: nic level: debug message: Starting device timestamp: "2023-07-20T04:52:42.685396172Z" type: logging

location: none metadata: context: action: start created: 2023-07-20 04:00:26.736295741 +0000 UTC ephemeral: "false" instance: smb0 instanceType: container project: default stateful: "false" used: 2023-07-20 04:25:13.1594658 +0000 UTC level: info message: Starting instance timestamp: "2023-07-20T04:52:42.679720668Z" type: logging

location: none metadata: context: device: root instance: smb0 instanceType: container project: default type: disk level: debug message: Starting device timestamp: "2023-07-20T04:52:42.703209227Z" type: logging

location: none metadata: context: driver: dir instance: smb0 pool: default project: default level: debug message: UpdateInstanceBackupFile started timestamp: "2023-07-20T04:52:42.703466031Z" type: logging

location: none metadata: context: driver: dir instance: smb0 pool: default project: default level: debug message: UpdateInstanceBackupFile finished timestamp: "2023-07-20T04:52:42.705302779Z" type: logging

location: none metadata: context: driver: dir pool: default refCount: "1" volName: smb0 level: debug message: Skipping unmount as in use timestamp: "2023-07-20T04:52:42.70528648Z" type: logging

location: none metadata: context: ip: '@' method: GET protocol: unix url: /internal/containers/smb0/onstart?project=default username: root level: debug message: Handling API request timestamp: "2023-07-20T04:52:42.745736048Z" type: logging

location: none metadata: context: {} level: debug message: 'Scheduler: container smb0 started: re-balancing' timestamp: "2023-07-20T04:52:42.755831941Z" type: logging

location: none metadata: action: instance-started requestor: address: '@' protocol: unix username: gage source: /1.0/instances/smb0 project: default timestamp: "2023-07-20T04:52:42.982914488Z" type: lifecycle

location: none metadata: context: class: task description: Starting instance operation: ba249881-0a6c-499f-ab08-034cfa38ecc3 project: default level: debug message: Success for operation timestamp: "2023-07-20T04:52:42.983061801Z" type: logging

location: none metadata: context: action: start err: instance: smb0 project: default reusable: "false" level: debug message: Instance operation lock finished timestamp: "2023-07-20T04:52:42.982950491Z" type: logging

location: none metadata: class: task created_at: "2023-07-20T04:52:42.674730949Z" description: Starting instance err: "" id: ba249881-0a6c-499f-ab08-034cfa38ecc3 location: none may_cancel: false metadata: null resources: instances:

location: none metadata: context: action: start created: 2023-07-20 04:00:26.736295741 +0000 UTC ephemeral: "false" instance: smb0 instanceType: container project: default stateful: "false" used: 2023-07-20 04:25:13.1594658 +0000 UTC level: info message: Started instance timestamp: "2023-07-20T04:52:42.982835299Z" type: logging

location: none metadata: context: instance: smb0 instanceType: container project: default stateful: "false" level: debug message: Start finished timestamp: "2023-07-20T04:52:42.983003228Z" type: logging

location: none metadata: context: listener: 22366fc4-efc2-4c41-9213-e6d57a9a3fdf local: /var/snap/lxd/common/lxd/unix.socket remote: '@' level: debug message: Event listener server handler stopped timestamp: "2023-07-20T04:52:42.987479895Z" type: logging

lxd.log

Please let me know if there are any other pieces of information you'd like to have (and information on how to get them would be helpful). Thank you!

greenman1969 commented 1 year ago

Issue does not appear when using images:debian/12/cloud so issue may be localized to the ubuntu:22.04 image.

tomponline commented 1 year ago

Hi, this sounds like a support issue, rather than a LXD issue. Please can you post over at https://discourse.ubuntu.com/c/lxd/support/149

Thanks