spaces in container path of mounted shares

Asked by gannon12raiders

When mounting a host folder into a container (using lxc config device add <container> <device> disk source=<source> path=<path>), the path variable doesn't handle spaces upon a container restart. It functions as expected (escaping with a backslash) when first added, (you can use the share and everything) but on container restart, an error is generated. Example:

>lxc stop Container1

>lxc config device add Container1 share disk source=/share path=/home/test/testing\ spaces
Device share added to Container1

>lxc config show Container1
...
devices:
    share:
        path: /home/test/testing spaces
        source: /share
        type: disk
...

>lxc start Container1
error: Error calling 'lxd forkstart Container1 /var/lib/lxd/containers /var/log/lxd/Container1/lxc.conf': err='exit status 1'
Try `lxc info --show-log Container1` for more info

>lxc info --show-log Container1 | grep -i error
lxc 20160515102447.195 ERROR lxc_conf - conf.c:mount_entry:1650 - No such file or directory - failed to mount '/var/lib/lxd/devices/Container1/disk.home-test-testing' on '/usr/lib/x86_64-linux-gnu/lxc/spaces'
lxc 20160515102447.195 ERROR lxc_conf - conf.c:lxc_setup:3730 - failed to setup the mount entries for 'Container1'
lxc 20160515102447.195 ERROR lxc_start - start.c:do_start:819 - failed to setup the container
lxc 20160515102447.195 ERROR lxc_sync - sync.c:__sync_wait:52 - An error occurred in another process (expected sequence number 2)
lxc 20160515102447.195 ERROR lxc_start - start.c:__lxc_start:1329 - failed to spawn 'Container1'

Is there a formatting thing I'm doing wrong? Doubly escaping causes the add command to fail. Manually adding a backslash into the config doesn't change anything - it just adds a backslash at the end of disk.home-test-testing.

Spaces seem to be handled for the source field just fine, when escaped if added via command-line. They will show in the config without spaces but are interpreted correctly, as far as I can tell.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu lxd Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.