Public bug reported:

This host has ipv6 disabled at the kernel level for security/privacy
reasons. When running through the 'lxd init' answer script taking
defaults for just about everything. Concerning network ipv4/v6 support
the default is 'auto'. It is reasonable to assume that 'auto' would do a
little interrogation to determine if ipv4/6 is actually enabled on the
host. Instead it makes an assumption and abruptly exits because the proc
file it's trying to manipulate literally doesn't exist.

lxc snap 3.18 on Ubuntu 18.04 host.

$ sudo lxd init
Would you like to use LXD clustering? (yes/no) [default=no]: 
Do you want to configure a new storage pool? (yes/no) [default=yes]: 
Name of the new storage pool [default=default]: 
Name of the storage backend to use (btrfs, ceph, dir, lvm, zfs) [default=zfs]: 
Create a new ZFS pool? (yes/no) [default=yes]: 
Would you like to use an existing block device? (yes/no) [default=no]: 
Size in GB of the new loop device (1GB minimum) [default=100GB]: 
Would you like to connect to a MAAS server? (yes/no) [default=no]: 
Would you like to create a new local network bridge? (yes/no) [default=yes]: 
What should the new bridge be called? [default=lxdbr0]: 
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) 
[default=auto]: 
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) 
[default=auto]: 
Would you like LXD to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]: 
Port to bind LXD to [default=8443]: 
Trust password for new clients: 
Again: 
No password set, client certificates will have to be manually trusted.Would you 
like stale cached images to be updated automatically? (yes/no) [default=yes] 
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: 
Error: Failed to create network 'lxdbr0': open 
/proc/sys/net/ipv6/conf/lxdbr0/autoconf: no such file or directory


cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-4.15.0-65-generic 
root=UUID=0a6a81b7-8f52-45b2-a16b-e64ceee18f89 ro ipv6.disable=1 amdgpu.dc=1 
crashkernel=512M-:192M

$ cat /proc/sys/net/
core/             ipv4/             netfilter/        nf_conntrack_max  unix/

A simple "does this filepath exist" before trying to write to the path
would serve well for the "auto" mode to fail safe and automatically
disable said networking stack. I admit ipv4 is likely always available
but ipv6 could be disabled for a variety of reasons. Bonus points for
printing a warning if neither stack is available.

** Affects: lxd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1849904

Title:
  lxd init assumes ipv6 is available

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1849904/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to