Exception: Could not determine LXD version. #683

Closed
tytus-kurek opened this Issue Feb 16, 2017 · 63 comments

Comments

Projects
None yet

tytus-kurek commented Feb 16, 2017

There is a problem with running conjure-up command:

ubuntu@maas:~$ /snap/bin/conjure-up
Traceback (most recent call last):
File "/snap/conjure-up/66/bin/conjure-up", line 11, in
sys.exit(main())
File "/snap/conjure-up/66/lib/python3.6/site-packages/conjureup/app.py", line 207, in main
utils.lxd_version(),
File "/snap/conjure-up/66/lib/python3.6/site-packages/conjureup/utils.py", line 117, in lxd_version
raise Exception("Could not determine LXD version.")
Exception: Could not determine LXD version.

Environment details:

OS: Ubuntu 16.04.2
conjure-up version: 2.1.0 (from the snap store)
lxd version: 2.0.9

Contributor

battlemidget commented Feb 16, 2017

There is a newer version of conjure-up that handles LXD a lot better, please upgrade first:

sudo snap refresh conjure-up --classic --candidate

@battlemidget battlemidget self-assigned this Feb 16, 2017

@battlemidget battlemidget added the bug label Feb 16, 2017

@battlemidget battlemidget added this to the 2.1.0 milestone Feb 16, 2017

I'm getting the same error as the original reporter on a fresh 17.04 LTS desktop install (ubuntu-17.04-desktop-amd64.iso).

I downloaded the iso, installed it in a virtualbox and then followed the instructions from https://conjure-up.io:

  • sudo snap install conjure-up --classic
  • conjure-up
Contributor

battlemidget commented Jul 17, 2017

@karelbemelmans Can you attach ~/.cache/conjure-up/conjure-up.log?

geesen commented Jul 17, 2017

same here with fresh ubuntu 16.04.2 LTS (server edition)
also tried the edge version

commands:

  • conjure-up.conjure-down
  • conjure-up
  • conjure-up.juju
  • conjure-up.lxc
  • conjure-up.lxd
  • conjure-up.redis-cli
    tracking: candidate
    installed: 2.2.2 (561) 92MB classic
    refreshed: 2017-07-14 05:51:13 +0200 CEST
    channels:
    stable: 2.2.2 (549) 92MB classic
    candidate: 2.2.2 (561) 92MB classic
    beta: 2.2.2 (561) 92MB classic
    edge: 2.3-alpha1-20170713.0307 (557) 92MB classic

Same problem on Ubuntu 16.04 LTS with all updates. My conjure-up.log is blank.

My conjure-up.log is blank too.

Contributor

battlemidget commented Jul 17, 2017

hmm, ok we'll need to try and reproduce this. is it possible to attach a sosreport to this bug from each you of experiencing this issue

Tell me how you want that sosreport, or point me to some docs how to do it.

For now I can give you this output already, this was run on a fresh install of the 17.04 iso:

karel@unbutu-17:~$ sudo snap install conjure-up --classic
[sudo] password for karel: 
conjure-up 2.2.2 from 'canonical' installed

karel@unbutu-17:~$ conjure-up
Traceback (most recent call last):
  File "/snap/conjure-up/549/bin/conjure-up", line 11, in <module>
    load_entry_point('conjure-up==2.2.2', 'console_scripts', 'conjure-up')()
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/app.py", line 256, in main
    utils.lxd_version(),
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/utils.py", line 208, in lxd_version
    raise Exception("Could not determine LXD version.")
Exception: Could not determine LXD version.

karel@unbutu-17:~$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev             1000156       0   1000156   0% /dev
tmpfs             204600    6400    198200   4% /run
/dev/sda1       10253588 5183004   4530016  54% /
tmpfs            1022984      12   1022972   1% /dev/shm
tmpfs               5120       4      5116   1% /run/lock
tmpfs            1022984       0   1022984   0% /sys/fs/cgroup
tmpfs             204596     172    204424   1% /run/user/1000
/dev/loop0         82432   82432         0 100% /snap/core/2381
/dev/loop1         90368   90368         0 100% /snap/conjure-up/549
tmpfs                100       0       100   0% /var/snap/conjure-up/common/lxd/shmounts
tmpfs                100       0       100   0% /var/snap/conjure-up/common/lxd/devlxd

jedieaston commented Jul 17, 2017

Here's the same info from my system:

easton@Mercy ~/v/ansible1> ssh easton@192.168.0.119
easton@192.168.0.119's password:
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.8.0-58-generic x86_64)

0 packages can be updated.
0 updates are security updates.

Last login: Mon Jul 17 08:58:02 2017 from 192.168.0.120
easton@backstack:$ sudo snap install conjure-up --classic
[sudo] password for easton:
conjure-up 2.2.2 from 'canonical' installed
easton@backstack:
$ conjure-up
Traceback (most recent call last):
File "/snap/conjure-up/549/bin/conjure-up", line 11, in
load_entry_point('conjure-up==2.2.2', 'console_scripts', 'conjure-up')()
File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/app.py", line 256, in main
utils.lxd_version(),
File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/utils.py", line 208, in lxd_version
raise Exception("Could not determine LXD version.")
Exception: Could not determine LXD version.
easton@backstack:$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8012340 0 8012340 0% /dev
tmpfs 1606864 9532 1597332 1% /run
/dev/mapper/ubuntu--gnome--vg-root 463939360 4912092 435437380 2% /
tmpfs 8034312 136 8034176 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8034312 0 8034312 0% /sys/fs/cgroup
/dev/loop0 82432 82432 0 100% /snap/core/2381
/dev/sda1 482922 117069 340919 26% /boot
tmpfs 1606864 16 1606848 1% /run/user/121
tmpfs 1606864 0 1606864 0% /run/user/1000
/dev/loop1 90368 90368 0 100% /snap/conjure-up/549
tmpfs 100 0 100 0% /var/snap/conjure-up/common/lxd/shmounts
tmpfs 100 0 100 0% /var/snap/conjure-up/common/lxd/devlxd
easton@backstack:
$

Also, I noticed that "conjure-up.lxd --version" and "lxd --version" report different values, could that be part of the problem?

Contributor

battlemidget commented Jul 17, 2017

Also, I noticed that "conjure-up.lxd --version" and "lxd --version" report different values, could that be part of the problem?

No because we package our own lxd and call it directly via conjure-up.lxd --version

Contributor

battlemidget commented Jul 17, 2017

@jedieaston after running conjure-up.lxd --version were you able to retry conjure-up? That is basically the same call we make when determining the version.

richardsith commented Jul 17, 2017

I've used the command:

$: sudo snap refresh conjure-up --classic --candidate

but the issue is still present

screen shot 2017-07-17 at 18 28 58

is it fixed or we need to wait? thanks

@battlemidget battlemidget reopened this Jul 17, 2017

@battlemidget battlemidget modified the milestones: 2.2.4, 2.1.0 Jul 17, 2017

Contributor

battlemidget commented Jul 17, 2017

@johnsca maybe we can sync tomorrow to try and track this down

Contributor

battlemidget commented Jul 17, 2017

can you guys post snap version output?

yes

$: snap version
snap    2.26.9
snapd   2.26.9
series  16
ubuntu  16.04
kernel  4.4.0-83-generic
Contributor

battlemidget commented Jul 17, 2017

thanks im on snapd 2.25, lemme upgrade and see if thats it

Contributor

battlemidget commented Jul 17, 2017

yep 2.26.9 is the problem

:-(

Contributor

battlemidget commented Jul 17, 2017

Contributor

battlemidget commented Jul 17, 2017

All, I'm working with the snapd team to figure out what the problem is and what a resolution will be. Thanks for your patience

@battlemidget battlemidget locked and limited conversation to collaborators Jul 17, 2017

Contributor

battlemidget commented Jul 18, 2017

Just an update,

We are still working on the issue, an initial fix is currently in testing. You can also follow along with the snapd bug https://bugs.launchpad.net/snapd/+bug/1704860

I'll keep everyone posted once this issue is resolved.

Thank you
Adam

Contributor

battlemidget commented Jul 19, 2017

If you all can test with:

sudo snap refresh core --beta
conjure-up

And let us know if that fixes the problem. (I've tested along with a few others but would like more feedback from you all)

Thank you
Adam

@battlemidget battlemidget unlocked this conversation Jul 19, 2017

Works great for me, thanks for the quick fix guys 👍

richardsith commented Jul 19, 2017

perfect, great job fix that..thanks

$: sudo snap install conjure-up --classic
2017-07-19T11:12:47+02:00 INFO cannot auto connect core:core-support-plug to core:core-support: (slot auto-connection), existing connection state "core:core-support-plug core:core-support" in the way
conjure-up 2.2.2 from 'canonical' installed

then

$: sudo snap refresh core --beta
core (beta) 16-2.26.13 from 'canonical' refreshed

screen shot 2017-07-19 at 11 16 56

screen shot 2017-07-19 at 11 39 19

geesen commented Jul 19, 2017

can also confirm that it is working now! thanks a lot

Contributor

battlemidget commented Jul 19, 2017

perfect, thank you! I'll close this ticket once the core snap hits the stable channel

ok thanks a lot

chrone81 commented Jul 19, 2017

Sadly, using latest snap core beta and conjure-up candidate still do not work.

$ conjure-up
Traceback (most recent call last):
  File "/snap/conjure-up/549/bin/conjure-up", line 11, in <module>
    load_entry_point('conjure-up==2.2.2', 'console_scripts', 'conjure-up')()
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/app.py", line 256, in main
    utils.lxd_version(),
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/utils.py", line 208, in lxd_version
    raise Exception("Could not determine LXD version.")
Exception: Could not determine LXD version.
$ sudo conjure-up.lxd --version
2.14

Env. details:

$ snap version
- snap    2.26.13
- snapd   2.26.13
- series  16
- ubuntu  16.04
- kernel  4.4.0-83-generic
$ snap list
- conjure-up  2.2.2       561 canonical  classic
- core        16-2.26.13  2445  canonical 

richardsith commented Jul 19, 2017

@chrone81 this is my situation:

:sudo conjure-up.lxd --version
[sudo] password for richardsith: 
2.14
-----------------------------------
:snap version
snap    2.26.13
snapd   2.26.13
series  16
ubuntu  16.04
kernel  4.4.0-83-generic
-----------------------------------
:snap list
Name        Version     Rev   Developer  Notes
conjure-up  2.2.2       549   canonical  classic
core        16-2.26.13  2445  canonical  -

confirm you the correct fix of that, I'm completing the deploy of Openstack Autopilot via Landscape

screen shot 2017-07-19 at 12 59 16

Try to remove conjure
: sudo snap remove conjure-up

and re-install that using

: sudo snap install conjure-up --classic
: sudo snap refresh core --beta

@richardsith weird, I tried on two physical machines running Ubuntu 16.04.2 to no avail. :( The two nodes above were just clean installed. Will try in VirtualBox tomorrow.

snap version && snap list
snap    2.26.13
snapd   2.26.13
series  16
ubuntu  16.04
kernel  4.4.0-83-generic
Name        Version     Rev   Developer  Notes
conjure-up  2.2.2       549   canonical  classic
core        16-2.26.13  2445  canonical  -

ramur commented Jul 19, 2017

Still not able to resolve the issue. Please help

Contributor

battlemidget commented Jul 19, 2017

Can you run:

sudo snap run --shell conjure-up.lxd
conjure-up

And paste the output of that

ramur commented Jul 19, 2017

Can not open /var/lib/snapd/seccomp/profiles//snap.conjure-up.conjure-up (No such file or directory)
aborting: No such file or directory

richardsith commented Jul 19, 2017

@ramur I've this on that directory

:ls /var/lib/snapd/seccomp/profiles/
snap.core.hook.configure

ramur commented Jul 19, 2017

@richardsith, yes I do have that file, but still not able to bring conjure-up

@battlemidget, I got this on two nodes.

$ sudo snap run --shell conjure-up.lxd
# conjure-up

  !! This should _not_ be run as root or with sudo. !!

Contributor

battlemidget commented Jul 19, 2017

Thanks going to take this over to https://forum.snapcraft.io/t/snapd-2-26-9-and-conjure-up-no-longer-work/1348, please follow along there and participate in the thread to help the snap developers track down this issue.

Contributor

battlemidget commented Jul 19, 2017

@chrone81 hm you are hitting a different issue, does snap run --shell conjure-up.lxd do the same thing?

ramur commented Jul 19, 2017

@battlemidget, thanks, I saw the post, many thanks

@battlemidget yeap, same thing either using sudo user or root.

root@node9:~# snap run --shell conjure-up.lxd
root@node9:~# conjure-up

  !! This should _not_ be run as root or with sudo. !!
$ conjure-up
Traceback (most recent call last):
  File "/snap/conjure-up/549/bin/conjure-up", line 11, in <module>
    load_entry_point('conjure-up==2.2.2', 'console_scripts', 'conjure-up')()
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/app.py", line 256, in main
    utils.lxd_version(),
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/utils.py", line 208, in lxd_version
    raise Exception("Could not determine LXD version.")
Exception: Could not determine LXD version.

$ sudo conjure-up.lxd --version
2.14

$ sudo snap list && sudo snap version
Name        Version     Rev   Developer  Notes
conjure-up  2.2.2       549   canonical  classic
core        16-2.26.13  2445  canonical  -
snap    2.26.13
snapd   2.26.13
series  16
ubuntu  16.04
kernel  4.4.0-83-generic
Contributor

battlemidget commented Jul 19, 2017

@chrone81 thats because you're logged in as root already, you'll want to be a non root user doing this

ramur commented Jul 19, 2017

@battlemidget. The following is the log
journalctl -f
-- Logs begin at Wed 2017-07-19 06:28:34 PDT. --
Jul 19 06:34:09 ubudoc3 kernel: audit: type=1400 audit(1500471249.642:55): apparmor="DENIED" operation="file_inherit" profile="/usr/lib/snapd/snap-confine" name="/dev/tty" pid=2873 comm="snap-confine" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
Jul 19 06:38:43 ubudoc3 anacron[1282]: Job cron.weekly' started Jul 19 06:38:43 ubudoc3 anacron[3187]: Updated timestamp for jobcron.weekly' to 2017-07-19
Jul 19 06:38:46 ubudoc3 anacron[1282]: Job cron.weekly' terminated Jul 19 06:43:38 ubudoc3 systemd[1]: Starting Cleanup of Temporary Directories... Jul 19 06:43:38 ubudoc3 systemd-tmpfiles[3279]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring. Jul 19 06:43:38 ubudoc3 systemd[1]: Started Cleanup of Temporary Directories. Jul 19 06:43:43 ubudoc3 anacron[1282]: Jobcron.monthly' started
Jul 19 06:43:43 ubudoc3 anacron[1282]: Job `cron.monthly' terminated
Jul 19 06:43:43 ubudoc3 anacron[1282]: Normal exit (2 jobs run)

chrone81 commented Jul 19, 2017

@battlemidget weird, I believed I have run it from non-root but with sudo, and with root user before.

Here's the output again as non-root account and without sudo:

user@node9:~$ snap run --shell conjure-up.lxd
user@node9:~$ conjure-up
Traceback (most recent call last):
  File "/snap/conjure-up/549/bin/conjure-up", line 11, in <module>
    load_entry_point('conjure-up==2.2.2', 'console_scripts', 'conjure-up')()
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/app.py", line 256, in main
    utils.lxd_version(),
  File "/snap/conjure-up/549/lib/python3.6/site-packages/conjureup/utils.py", line 208, in lxd_version
    raise Exception("Could not determine LXD version.")
Exception: Could not determine LXD version.

richardsith commented Jul 19, 2017

@chrone81 did you try to remove conjure-up? and re-install it?
Because I just to create a new VM with U16.04.2, updated that via apt, then used the commands above to install conjure-up and it works well.

@richardsith yes, I did it several times hours ago and after you suggested. Even on one node I purged the snapd package and reinstall again.

@chrone81 have you installed snapd? because on 16.04 it's already present it's not necessary to install it. Which OS are you using?

Contributor

battlemidget commented Jul 19, 2017

@chrone81 a workaround is to sudo apt install snapd and make sure the deb installed snapd is 2.25 (I know it's confusing but it will get better!) Let me know if that fixes your issue.

@battlemidget its giving me same issue. :(

Contributor

battlemidget commented Jul 19, 2017

@gauravbansal74 did you see my last post? You need to make sure you're on debian package snapd 2.25. They are working on a fix in the core snap that'll be released soon so this won't be necessary. If you can't wait though updating your snapd debian package is the workaround

@battlemidget I think it's already snapd 2.25.

user@node9:~$ sudo apt install snapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
snapd is already the newest version (2.25).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

user@node9:~$ sudo dpkg -l | grep -i snap
ii  snap                               2013-11-29-1ubuntu2.16.04.1                amd64        location of genes from DNA sequence with hidden markov model
ii  snap-confine                       2.25                                       amd64        Transitional package for snapd
ii  snapd                              2.25                                       amd64        Tool to interact with Ubuntu Core Snappy.
ii  ubuntu-core-launcher               2.25                                       amd64        Transitional package for snapd

Should I purge the snap, snap-confine, snapd, and ubuntu-core-launcher to execute "sudo apt install snapd"?

@battlemidget Thank you. I am following the thread.

Contributor

battlemidget commented Jul 19, 2017

Should I purge the snap, snap-confine, snapd, and ubuntu-core-launcher to execute "sudo apt install snapd"?

Yea give that a try, i would also try to sudo snap remove core, just apt install snapd, then sudo snap install core --beta

chrone81 commented Jul 19, 2017

@battlemidget Ok I think I got this working after removing all snap, snapd, snap-confine, and ubuntu-core-launcher packages and reinstalled only snapd package.

@node10:~# dpkg -l | grep -i snap
ii  snap                               2013-11-29-1ubuntu2.16.04.1                amd64        location of genes from DNA sequence with hidden markov model
ii  snapd                              2.25                                       amd64        Tool to interact with Ubuntu Core Snappy.

I don't know where that "snap" package came from. Based on its description is for location of genes from DNS sequence with hidden markov model. Perhaps that snap packages confused the snapd. I did installed the nodes using Ubuntu 16.04.2 64-bit server iso image which downloaded from releases.ubuntu.com last week.

Thanks!

Contributor

battlemidget commented Jul 19, 2017

@chrone81 Yea it's possible, I know a lot of people confuse the package snap with package snapd :( Thanks for the patience and hopefully this will all be resolved soon.

jensleister commented Jul 19, 2017

I'm also on a fresh install using Ubuntu 16.04.2 64-bit server iso image on a physical machine. Ran into the same problem.

Here is what I've:

$ conjure-up.lxd --version
/snap/conjure-up/557/wrappers/lxd: 9: exec: aa-exec: not found
mdmn@mars:~$ snap version && snap list
snap    2.26.13
snapd   2.26.13
series  16
ubuntu  16.04
kernel  4.4.0-62-generic
Name        Version                   Rev   Developer  Notes
conjure-up  2.3-alpha1-20170713.0307  557   canonical  classic
core        16-2.26.13                2445  canonical  -
lxd         git-79a36e6               3026  canonical  -
$ sudo snap install conjure-up --edge
snap "conjure-up" is already installed, see "snap refresh --help"
$ sudo snap refresh conjure-up --edge
snap "conjure-up" has no updates available
$ snap version && snap list
snap    2.26.13
snapd   2.26.13
series  16
ubuntu  16.04
kernel  4.4.0-62-generic
Name        Version                   Rev   Developer  Notes
conjure-up  2.3-alpha1-20170713.0307  557   canonical  classic
core        16-2.26.13                2445  canonical  -
lxd         git-79a36e6               3026  canonical  -
user@mars:~$ conjure-up.lxd --version
/snap/conjure-up/557/wrappers/lxd: 9: exec: aa-exec: not found
$ sudo conjure-up.lxd --version
2.14

In my opinion there appears to be an issue with privileges when writing to /var. Here is why:

$ sudo apt-get purge snapd
# Got a _lot_ of rm errors for /var/conjure-up directory. Therefore, rebooted and re-ran former shell command. It worked successfully.
$ dpkg -l | grep -i snap
$ sudo apt install snapd
INFO cannot auto connect core:core-support-plug to core:core-support: (slot auto-connection), existing connection state "core:core-support-plug core:core-support" in the way
$ sudo snap install conjure-up --classic
# re-login may be required at that point if you just installed snap utility
# I did a full reboot -- just to be on the safe side...
$ conjure-up kubernetes

Now I'm asked to select the spell for kubernetes. All good 👍

BTW Read this, too. Didn't help 👎

So what's the issue? I guess the standard packages (I've enstolled only OpenSSH when installing the fresh system) installs packages via apt which get in the way of the newer snap stuff for conjure-up.

Can anyone confirm, pls?

@jedieaston I 've tested the same your lab creating a new VM with U16.04.2 updated via apt then installed conjure-up followed the above suggests and it works without issue.
All the procedure for installing Openstack Autopilot via conjure-up has been completed without issue, try to update the OS and then remove via apt conjure-up and re.install that

This fix worked great for me too:
sudo snap refresh core --beta

My environment:

andre@maas:~$ conjure-up.lxd --version
2.14
andre@maas:~$ snap version
snap    2.26.14
snapd   2.26.14
series  16
ubuntu  16.04
kernel  4.4.0-62-generic
andre@maas:~$ snap list
Name        Version     Rev   Developer  Notes
conjure-up  2.2.2       549   canonical  classic
core        16-2.26.14  2462  canonical  -

Many thanks for the quick fix.

Thank you so much! I thought this was either an old bug, or I was the only one lol

sudo snap refresh core --beta worked perfectly! :D

Contributor

battlemidget commented Jul 21, 2017

For those who have the APT package snapd version 2.21 installed a new core snap was pushed to the --beta channel that addresses that particular issue.

Also want to remind everyone that this Monday July 24th, you should make sure to refresh your core snap back into the stable channel as this fix will have made it there by then.

Closing this bug now as resolved any other issues please file new bugs so we can get them addressed. Thanks!

manwegit commented Aug 30, 2017

To add my 2cents worth. For me the problem:

 conjure-up.lxd --version
/snap/conjure-up/557/wrappers/lxd: 9: exec: aa-exec: not found

happened for some reason because I became normal user with su
So this works:

ssh user@machine
conjure-up

and this does not work:

su - user
conjure-up
Contributor

battlemidget commented Aug 30, 2017

you dont have /usr/sbin in your path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment