canonical / lxd

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

Faulty parsing of /etc/fstab #4407

Closed bk closed 6 years ago

bk commented 6 years ago

Required information

Issue description

Certain legitimate entries in /etc/fstab cause an error message to be emitted each time the lxc command is run. This applies to some fuse file systems, such as unionfs, but may also apply to others. An example of a line in fstab which causes this is:

unionfs#/mnt/a=RO:/mnt/b=RW /mnt/c fuse cow,allow_other,_netdev 0 0

Apparently, the # is taken to start a comment, since the error message is: 2018/04/04 13:11:04.026913 system_key.go:117: cannot determine nfs usage in generateSystemKey: cannot parse /etc/fstab: expected between 3 and 6 fields, found 1.

For most operations, the message is merely a nuisance, but when such a line is present in fstab it causes problems for snap refresh and has in at least one instance caused containers to become inaccessible after a snap package update (from build 6418 to 6469).

Steps to reproduce

  1. Add a line of the above kind to /etc/fstab.
  2. Run a lxc subcommand.
  3. Observe the emitted warning.
stgraber commented 6 years ago

Just did some grepping in source trees locally, this error is originating from snapd itself, not from LXD.

I'd recommend you open a forum topic about this at https://forum.snapcraft.io as that's currently the recommended way to interact with the snapd developers.

Please post the URL here so that anyone who runs into a similar issue can find it.

brauner commented 6 years ago

That error is not from LXD though is it? That looks like it is coming from snapd.

stgraber commented 6 years ago

https://github.com/snapcore/snapd/pull/4973

bk commented 6 years ago

The PR referenced by @stgraber has already been applied to master, fixing this issue - see snapcore/snapd@187de26821c03f5b024508d11a3ac804614b118e. Sorry for reporting this in the wrong place.