-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to start LXD VM due to long UNIX Socket Path #12539
Comments
Hi @cbartz please can you try this again on LXD 5.0.3, as I believe its already been fixed by: https://github.com/canonical/lxd/blob/stable-5.0/lxd/device/device_utils_disk.go#L464-L468 |
Ah no, it wont actually because of https://github.com/canonical/lxd/blob/stable-5.0/lxd/device/disk.go#L936 I think. |
So far I managed to get the file from the socket listener object, and pass it over to
This is possibly a result of the qemu version being used in the snap, I am currently running some tests using other versions to see if this alters the behavior. An alternative approach could be to use symbolic links to the socket files, but I haven't figured an apropriate place to create these links on without resulting in a path longer than 107 bytes. |
@hamistao Don't worry about this line:
That is known, see #12828 |
One approach could be to open a file handle and then pass it as a file path using |
If I am understanding correctly, I have tried this but it doesn't work because qemu doesn't recognize |
Might it be that the protocol error in #13320 is coming from having both |
this isn't the case, although it seemed like the path was still being included, the
|
This (or a similar error) is even easier to reproduce (without adding a disk) by simply specifying a long instance name::
|
@cbartz It is indeed practically the same error, with the difference that the socket whose path is too large in this case is the qemu config socket and not the device socket. |
Required information
Issue description
When adding a disk to an LXD VM instance using a directory on the host with a rather long name, the instance fails to start because the UNIX socket path is too long:
The problem occurred in an OpenStack VM (instance of a GitHub self-hosted runner charm), but could be reproduced locally inside a multipass vm.
Steps to reproduce
lxc launch ubuntu:22.04 stg-ps6-small2-3-166d3e5f-ba4f-4cd0-817e-1ba1994e8c8d --vm
lxc stop stg-ps6-small2-3-166d3e5f-ba4f-4cd0-817e-1ba1994e8c8d
mkdir /home/ubuntu/shared_fs
lxc config device add stg-ps6-small2-3-166d3e5f-ba4f-4cd0-817e-1ba1994e8c8d metrics disk source=/home/ubuntu/shared_fs/ path=/metrics-exchange
lxc start stg-ps6-small2-3-166d3e5f-ba4f-4cd0-817e-1ba1994e8c8d
sudo cat /var/snap/lxd/common/lxd/logs/stg-ps6-small2-3-166d3e5f-ba4f-4cd0-817e-1ba1994e8c8d/qemu.log
Information to attach
dmesg
)lxc info NAME --show-log
)lxc config show NAME --expanded
)lxc monitor
while reproducing the issue)The text was updated successfully, but these errors were encountered: