[juju-2.0] trusty package doesn't install juju-2.0 commands via update-alternatives

Bug #1633593 reported by Felipe Reyes
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
juju-release-tools
Fix Released
Critical
Nicholas Skaggs

Bug Description

In some cases /usr/bin/juju is juju 2.0 when upgrading a trusty environment that has ppa:juju/stable PPA enabled.

[Impact]

Users may end up inadvertently using the juju command from 2.0 and without the option to manage their juju-1.x deployed environments.

[Test]

lxc launch ubuntu:14.04 juju
lxc exec juju /bin/bash
$ sudo apt-get update
$ sudo apt-get install -y juju
$ juju --version
1.25.6-trusty-amd64
$ sudo add-apt-repository -y ppa:juju/stable
$ sudo apt-get update
$ sudo apt-get upgrade

Expected result:

/usr/bin/juju points to juju 1.25

Actual result:

In some cases /usr/bin/juju may be actually juju-2.0, because the juju-2.0 package doesn't use update-alternatives

$ dpkg -L juju-2.0
/.
...
/usr/bin/juju
/usr/bin/juju-metadata
/usr/bin/jujud
/usr/bin/juju-upgrade-mongo
...

Tags: sts
Felipe Reyes (freyes)
tags: added: sts
Changed in juju-release-tools:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Mario Splivalo (mariosplivalo) wrote :

I can confirm this.

I installed trusty, added juju stable ppa, and installed latest 1.25 from the ppa. This is the situation most of the long-time juju users will be at.
After doing dist-upgrade /usr/bin/juju points to juju2, rendering existing juju1 deployment inaccessible.

To remedy this one needs to run 'dpkg-reconfigure juju-core'.

Here is the shortlog:

ubuntu@jujutest:~$ apt-cache policy juju
juju:
  Installed: 1.25.6-0ubuntu1~14.04.1~juju1
  Candidate: 1:2.0.0-0ubuntu1~14.04.2~juju1
  Version table:
     1:2.0.0-0ubuntu1~14.04.2~juju1 0
        500 http://ppa.launchpad.net/juju/stable/ubuntu/ trusty/main amd64 Packages
     1.25.6-0ubuntu1.14.04.1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
 *** 1.25.6-0ubuntu1~14.04.1~juju1 0
        500 http://ppa.launchpad.net/juju/stable/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1.18.1-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
ubuntu@jujutest:~$ which juju
/usr/bin/juju
ubuntu@jujutest:~$ ls -al /usr/bin/juju
lrwxrwxrwx 1 root root 22 Oct 14 20:35 /usr/bin/juju -> /etc/alternatives/juju

After the 'apt-get dist-upgrade':

ubuntu@jujutest:~$ apt-cache policy juju
juju:
  Installed: 1:2.0.0-0ubuntu1~14.04.2~juju1
  Candidate: 1:2.0.0-0ubuntu1~14.04.2~juju1
  Version table:
 *** 1:2.0.0-0ubuntu1~14.04.2~juju1 0
        500 http://ppa.launchpad.net/juju/stable/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1.25.6-0ubuntu1.14.04.1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
     1.25.6-0ubuntu1~14.04.1~juju1 0
        500 http://ppa.launchpad.net/juju/stable/ubuntu/ trusty/main amd64 Packages
     1.18.1-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
ubuntu@jujutest:~$ ls -al /usr/bin/juju
lrwxrwxrwx 1 root root 24 Oct 13 23:59 /usr/bin/juju -> ../lib/juju-2.0/bin/juju

Then the fix:

ubuntu@jujutest:~$ sudo dpkg-reconfigure juju-core
update-alternatives: using /usr/lib/juju-1.25.6/bin/juju to provide /usr/bin/juju (juju) in auto mode
ubuntu@jujutest:~$ ls -al /usr/bin/juju
lrwxrwxrwx 1 root root 22 Oct 14 20:42 /usr/bin/juju -> /etc/alternatives/juju
ubuntu@jujutest:~$ juju --version
1.25.6-trusty-amd64
ubuntu@jujutest:~$

Changed in juju-release-tools:
assignee: nobody → Nicholas Skaggs (nskaggs)
importance: High → Critical
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

This issue should have no effect on 1.25 deployments. Users will have to run update-alternatives after upgrading no matter what. Running it now results in restoring juju-1.25, which is the desired outcome. After a new package for 2.0 is uploaded that supports using update-alternatives (and thus this bug is fixed), it will allow you to easily toggle between them as expected. That will be the only change from the current setup.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Since juju 2 is not wanted as an upgrade path, I've removed the package completely. It may take a little while to propagate. If you have upgraded already, you will want to manually uninstall the package to remove it from your system.

Leaving this bug open at a lower priority to discuss if a replacement package is desirable and what that would look like.

Changed in juju-release-tools:
status: Triaged → 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.