Closed redno2 closed 1 year ago
Can you get the output of ip l
on the system when you get the error?
I seem to have stumbled on the same issue.
# lxc start production-jenkinsmaster02
Error: Failed to start device "eth0": Failed to set the MAC address: Failed to run: ip link set dev mac6289d050 address aa:00:00:c2:48:94: exit status 2 (RTNETLINK answers: Address already in use)
Try `lxc info --show-log production-jenkinsmaster02` for more info
# lxc info --show-log production-jenkinsmaster02
Name: production-jenkinsmaster02
Status: STOPPED
Type: virtual-machine
Architecture: x86_64
Location: osg-node3
Created: 2022/04/24 03:42 +08
Last Used: 2022/10/29 06:17 +08
Error: open /var/snap/lxd/common/lxd/logs/production-jenkinsmaster02/qemu.log: no such file or directory
I ran ip l
and I saw there is a device already with the same MAC:
# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 08:94:ef:10:83:44 brd ff:ff:ff:ff:ff:ff
altname enp22s0f0
3: eno2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master trunk state UP mode DEFAULT group default qlen 1000
link/ether 7e:8e:a3:99:bb:0a brd ff:ff:ff:ff:ff:ff permaddr 08:94:ef:10:83:45
altname enp22s0f1
4: eno3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master trunk state UP mode DEFAULT group default qlen 1000
link/ether 7e:8e:a3:99:bb:0a brd ff:ff:ff:ff:ff:ff permaddr 08:94:ef:10:83:46
altname enp22s0f2
5: eno4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master trunk state UP mode DEFAULT group default qlen 1000
link/ether 7e:8e:a3:99:bb:0a brd ff:ff:ff:ff:ff:ff permaddr 08:94:ef:10:83:47
altname enp22s0f3
6: enx0a94ef10834b: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 0a:94:ef:10:83:4b brd ff:ff:ff:ff:ff:ff
7: trunk: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 7e:8e:a3:99:bb:0a brd ff:ff:ff:ff:ff:ff
8: trunk.41@trunk: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 7e:8e:a3:99:bb:0a brd ff:ff:ff:ff:ff:ff
10: macdc1379a0@trunk.41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UP mode DEFAULT group default qlen 500
link/ether aa:00:00:5d:0d:a9 brd ff:ff:ff:ff:ff:ff
22: trunk.252@trunk: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 7e:8e:a3:99:bb:0a brd ff:ff:ff:ff:ff:ff
24: maca6aee821@trunk.41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UP mode DEFAULT group default qlen 500
link/ether aa:00:00:c2:48:94 brd ff:ff:ff:ff:ff:ff
25: mac6f081606@trunk.41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UP mode DEFAULT group default qlen 500
link/ether aa:00:00:4d:cf:ef brd ff:ff:ff:ff:ff:ff
29: mac1907947c@trunk.41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UP mode DEFAULT group default qlen 500
link/ether aa:00:00:5e:47:f8 brd ff:ff:ff:ff:ff:ff
So I deleted that device and that allowed me to start the instance:
# ip l del dev maca6aee821
# lxc start production-jenkinsmaster02
Here is some info about my environment:
# uname -a
Linux osg-node3 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
# lxc --version
5.7
# lxd --version
5.7
# lxc config show production-jenkinsmaster02 --expanded
architecture: x86_64
config:
limits.cpu: "48"
limits.memory: 16GB
security.nesting: "true"
volatile.cloud-init.instance-id: 16b013a6-f75e-473a-a4c7-b01c7320404a
volatile.eth0.host_name: mac71c65c73
volatile.eth0.hwaddr: aa:00:00:c2:48:94
volatile.eth0.last_state.created: "true"
volatile.last_state.power: RUNNING
volatile.uuid: b1e5ea52-5f5d-4149-b13e-d07bc777a34b
volatile.vsock_id: "123"
devices:
eth0:
name: eth0
nictype: macvlan
parent: trunk
type: nic
vlan: "41"
root:
path: /
pool: zfs-rpool
type: disk
ephemeral: false
profiles:
- default
stateful: false
The only log from the same day in /var/snap/lxd/common/lxd/logs/lxd.log
is this:
time="2022-10-31T09:15:08+08:00" level=error msg="Failed writing error for HTTP response" err="open /var/snap/lxd/common/lxd/logs/production-jenkinsmaster02/qemu.log: no such file or directory" url="/1.0/instances/{name}/logs/{file}" writeErr="<nil>"
Unfortunately I don't have monitor logs.
I confirm the link was still here after the delete container (which was a VM).
ip l
....
183: macae0400be@lxdbr121: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 500
link/ether 00:16:3e:12:12:12 brd ff:ff:ff:ff:ff:ff
ip l del macae0400be
and fix my issue, I can start the container
This can occur if the previously stopped container didn't cleanly stop and LXD never got a chance to remove the old interface.
Can you try and capture the output of /var/snap/lxd/common/lxd/logs/lxd.log
the next time this happens.
Also this can be caused by an issue in the kernel if for some reason it does not release the interface.
Closing this for now. But if you are able to get the logs as requested please can you post over at https://discuss.linuxcontainers.org/ as we prefer to handle support cases there. Thanks
Distribution: Ubuntu
Distribution version: Distributor ID: Ubuntu Description: Ubuntu 20.04.5 LTS Release: 20.04 Codename: focal
The output of "lxc info" or if that fails:
Issue description
I use github action to spawn and destroy some containers, after few runs and jobs canceling which was working great until here. Now I cannot start it because it seem the MAC address is still use, but not really at least not in existing containers. Seem to be keep in the db and when I create the same container with the same MAC address, I got the message the MAC address is already in use, when I start it.
Steps to reproduce
Step three Works well until here, but probably after canceling and start my job in github action which delete and create the same container multiple time, I got the error
Information to attach
dmesg
)lxc info NAME --show-log
)lxc config show NAME --expanded
)Run apt upgrade
package_upgrade: true
Install arbitrary packages
packages:
Add apt repositories
apt_mirror: http://mirror.local
Run Arbitrary Commands for More Control
runcmd:
power_state: delay: now mode: poweroff message: Bye Bye timeout: 5 condition: True volatile.base_image: a0d63a06d6d5eb55cc999b2a6b5578273526b61dde9b60333a70ef4af9b0ec34 volatile.cloud-init.instance-id: f6b68b1d-4352-4302-a5b9-c1a4ca1d987d volatile.eth0.hwaddr: 00:16:3e:12:12:12 volatile.last_state.power: STOPPED volatile.last_state.ready: "false" volatile.uuid: f9a84a5a-ae53-4fba-a7af-1fcb49c52430 volatile.vsock_id: "357" devices: eth0: name: eth0 nictype: macvlan parent: lxdbr121 type: nic root: path: / pool: lxd_pool size: 16GiB type: disk sharedHomeDir: path: /opt/pc-efkolos readonly: "True" source: /home/action-runner/actions-runner-2/_work/pc-efkolos/pc-efkolos type: disk ephemeral: false profiles:
cat /var/snap/lxd/common/lxd/logs/lxd.log
time="2022-10-24T18:14:39+02:00" level=warning msg=" - Couldn't find the CGroup blkio.weight, disk priority will be ignored" time="2022-10-24T18:14:39+02:00" level=warning msg=" - Couldn't find the CGroup memory swap accounting, swap limits will be ignored" time="2022-10-24T18:14:44+02:00" level=error msg="Invalid configuration key: unknown key" key=storage.lvm_fstype time="2022-10-24T18:14:44+02:00" level=error msg="Invalid configuration key: unknown key" key=storage.lvm_mount_options time="2022-10-24T18:14:44+02:00" level=error msg="Invalid configuration key: unknown key" key=storage.lvm_thinpool_name time="2022-10-24T18:14:44+02:00" level=error msg="Invalid configuration key: unknown key" key=storage.lvm_volume_size time="2022-10-24T18:14:44+02:00" level=warning msg="Failed to initialize fanotify, falling back on fsnotify" err="Failed to initialize fanotify: invalid argument" time="2022-10-24T18:14:45+02:00" level=warning msg="Failed to update instance types: Get \"https://uk.lxd.images.canonical.com/meta/instance-types/.yaml\": Forbidden" time="2022-10-25T09:43:07+02:00" level=error msg="Failed writing error for HTTP response" err="open /var/snap/lxd/common/lxd/logs/pc-efkolos-desktop-jammy/qemu.log: no such file or directory" url="/1.0/instances/{name}/logs/{file}" writeErr=""
time="2022-10-25T10:09:22+02:00" level=error msg="Failed writing error for HTTP response" err="open /var/snap/lxd/common/lxd/logs/pc-efkolos-desktop-jammy/qemu.log: no such file or directory" url="/1.0/instances/{name}/logs/{file}" writeErr=""