Cannot bootstrap with 2.6/edge when using lxd from a snap on disco

Bug #1835187 reported by Liam Young
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Achilleas Anagnostopoulos
Ubuntu on IBM z Systems
Fix Released
High
Unassigned

Bug Description

Cannot bootstrap with 2.6/edge when using lxd from a snap on disco
, 2.6/stable seems fine. Looks like it can't find LXD_DIR

$ lxd --version
3.14

$ sudo snap refresh --channel=2.6/edge juju
juju (2.6/edge) 2.6.6+2.6-b255540 from Canonical✓ refreshed

$ env | grep LXD
$ juju bootstrap lxd test --no-gui --debug
10:22:05 INFO juju.cmd supercommand.go:57 running juju [2.6.6 gc go1.10.4]
10:22:05 DEBUG juju.cmd supercommand.go:58 args: []string{"/snap/juju/8475/bin/juju", "bootstrap", "lxd", "test", "--no-gui", "--debug"}
10:22:05 DEBUG juju.container.lxd connection.go:163 using environment LXD_DIR as socket path: "/var/lib/lxd"
ERROR LXD socket not found; is LXD installed & running?

Please install LXD by running:
 $ sudo snap install lxd
and then configure it with:
 $ newgrp lxd
 $ lxd init

10:22:05 DEBUG cmd supercommand.go:496 error stack:
LXD socket not found; is LXD installed & running?

Please install LXD by running:
 $ sudo snap install lxd
and then configure it with:
 $ newgrp lxd
 $ lxd init

/build/juju/parts/juju/go/src/github.com/juju/juju/provider/lxd/server.go:444:
/build/juju/parts/juju/go/src/github.com/juju/juju/provider/lxd/server.go:233:
/build/juju/parts/juju/go/src/github.com/juju/juju/provider/lxd/server.go:156:
/build/juju/parts/juju/go/src/github.com/juju/juju/provider/lxd/provider.go:351:
/build/juju/parts/juju/go/src/github.com/juju/juju/provider/lxd/provider.go:319:
/build/juju/parts/juju/go/src/github.com/juju/juju/provider/lxd/provider.go:330:
/build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go:905:
/build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go:507:

$ sudo snap refresh --channel=2.6/stable juju
juju (2.6/stable) 2.6.5 from Canonical✓ refreshed
$ juju bootstrap lxd test2
Creating Juju controller "test2" on lxd/localhost
Looking for packaged Juju agent version 2.6.5 for amd64
To configure your system to better support LXD containers, please see: https://github.com/lxc/lxd/blob/master/doc/production-setup.md
Launching controller instance(s) on localhost/localhost...
 - juju-a707a4-0 (arch=amd64)
Installing Juju agent on bootstrap instance
Fetching Juju GUI 2.14.0
Waiting for address

Revision history for this message
Liam Young (gnuoy) wrote :

$ id
uid=1000(liam) gid=1000(liam) groups=1000(liam),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),121(lpadmin),131(sambashare),132(lxd),136(libvirt)

$ ls -l /var/snap/lxd/common/lxd/unix.socket
srw-rw---- 1 root lxd 0 Jul 3 09:31 /var/snap/lxd/common/lxd/unix.socket

Revision history for this message
Simon Richardson (simonrichardson) wrote :

The unix.socket does exist upon further inspection, but it seems to be a permissions issue where we can't read the folder where the socket exists. This seems to only effect 2.6/edge though.

Revision history for this message
Heather Lanigan (hmlanigan) wrote :

@gnuoy, does this still occur? I'm running disco and was unable to reproduce today.

$ snap list
Name Version Rev Tracking Publisher Notes
...
juju 2.6.6+2.6-b3486ad 8489 2.6/edge canonical✓ classic
...
lxd 3.14 11098 stable/… canonical✓ -
...

Changed in juju:
status: New → Incomplete
Changed in juju:
status: Incomplete → Triaged
importance: Undecided → High
milestone: none → 2.7-beta1
assignee: nobody → Achilleas Anagnostopoulos (achilleasa)
Changed in juju:
status: Triaged → In Progress
Revision history for this message
Ryan Beisner (1chb1n) wrote :

I'm just writing to confirm that disco @ 2.6/edge is able to bootstrap with the lxd provider:

beisner@rby:~$ juju controllers
Use --refresh option with this command to see the latest information.

Controller Model User Access Cloud/Region Models Nodes HA Version
lxd* zaza-9fcb5eb9e974 admin superuser localhost/localhost 3 1 none 2.6.7

...

juju 2.6.7+2.6-1c38bf4 8794 2.6/edge canonical✓ classic

...

beisner@rby:~$ lxc list
+------------------+---------+------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------------+---------+------------------+------+------------+-----------+
| juju-b6e840-0 | RUNNING | 10.8.2.11 (eth0) | | PERSISTENT | 0 |
+------------------+---------+------------------+------+------------+-----------+

Thanks!

Revision history for this message
Ryan Beisner (1chb1n) wrote :

^
beisner@rby:~$ uname -a
Linux rby 5.0.0-25-generic #26-Ubuntu SMP Thu Aug 1 12:04:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Ryan Beisner (1chb1n) wrote :

beisner@rby:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco

Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

The problem is that if you try to bootstrap using a disco image that does not come
with lxd pre-installed, juju will currently try to install it via apt. The apt package
for lxd on disco actually installs the snap version but displays a prompt for the
operator to select which channel to use. Unfortunately, this prompt cannot be bypassed
so we cannot actually install via apt in interactive mode.

To replicate:

juju bootstrap lxd test
juju add-machine --series=disco
juju run --machine 0 'sudo snap remove lxd'
juju add-machine lxd:0

juju will try to install lxd on machine 0 but hang there forever. If you poll the
status, the container will never come up.

I am working on a PR to install lxd (if missing) directly from snap for disco+ which
will take care of this issue.

Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

PR https://github.com/juju/juju/pull/10553 includes a fix for the develop branch.

Changed in juju:
status: In Progress → Fix Committed
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: New → Fix Committed
importance: Undecided → High
Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

PR https://github.com/juju/juju/pull/10620 back-ports the fix to the 2.6 branch

Changed in juju:
status: Fix Committed → Fix Released
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.