installing mojo upgrades juju-deployer from 0.6.4 to 0.9.2, but still depends on 0.6.4 - The 'juju-deployer' distribution was not found and is required by mojo

Bug #1644922 reported by Larry Michel
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mojo: Continuous Delivery for Juju
Fix Released
High
Tim Kuhlman
juju-deployer
Invalid
Undecided
Unassigned

Bug Description

Installing mojo from mojo-maintainers ppa ends up upgrading juju-deployer on Trusty. But package dependencies still point to 0.6.4:

============================================================================
$ sudo apt-get install mojo
sudo: unable to resolve host oil-ci-2-bastion
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  juju-deployer python3-juju-deployer
The following NEW packages will be installed:
  mojo python3-juju-deployer
The following packages will be upgraded:
  juju-deployer
1 upgraded, 2 newly installed, 0 to remove and 60 not upgraded.
Need to get 0 B/146 kB of archives.
After this operation, 7,168 B disk space will be freed.
Do you want to continue? [Y/n] y
Selecting previously unselected package python3-juju-deployer.
(Reading database ... 57632 files and directories currently installed.)
Preparing to unpack .../python3-juju-deployer_0.9.2~bzr203~60~ubuntu14.04.1_amd64.deb ...
Unpacking python3-juju-deployer (0.9.2~bzr203~60~ubuntu14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/python3-juju-deployer_0.9.2~bzr203~60~ubuntu14.04.1_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/juju-deployer', which is also in package juju-deployer 0.6.4~bzr168~49~ubuntu14.04.1
Preparing to unpack .../juju-deployer_0.9.2~bzr203~60~ubuntu14.04.1_amd64.deb ...
Unpacking juju-deployer (0.9.2~bzr203~60~ubuntu14.04.1) over (0.6.4~bzr168~49~ubuntu14.04.1) ...
Selecting previously unselected package mojo.
Preparing to unpack .../archives/mojo_0.3.2-10_all.deb ...
Unpacking mojo (0.3.2-10) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python3-juju-deployer_0.9.2~bzr203~60~ubuntu14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ dpkg -l|grep juju
ii juju 1.25.8-0ubuntu1~14.04.1~juju1 all next generation service orchestration system
ii juju-core 1.25.8-0ubuntu1~14.04.1~juju1 amd64 Juju is devops distilled - client
iU juju-deployer 0.9.2~bzr203~60~ubuntu14.04.1 amd64 A transitional package which depends on python-juju-deployer.
ii juju-local 1.25.6-0ubuntu1.14.04.1 all dependency package for the Juju local provider
ii juju-mongodb 2.4.9-0ubuntu3 amd64 MongoDB object/document-oriented database for Juju
ii python-jujuclient 0.53.3+bzr96+41~ubuntu14.04.1 all Python API client for juju-core
ii python3-jujuclient 0.53.3+bzr96+41~ubuntu14.04.1 all Python API client for Juju (Python 3)

$ sudo apt-get install -f
sudo: unable to resolve host oil-ci-2-bastion
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  python3-juju-deployer
The following NEW packages will be installed:
  python3-juju-deployer
0 upgraded, 1 newly installed, 0 to remove and 60 not upgraded.
2 not fully installed or removed.
Need to get 0 B/49.0 kB of archives.
After this operation, 293 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 57646 files and directories currently installed.)
Preparing to unpack .../python3-juju-deployer_0.9.2~bzr203~60~ubuntu14.04.1_amd64.deb ...
Unpacking python3-juju-deployer (0.9.2~bzr203~60~ubuntu14.04.1) ...
Setting up python3-juju-deployer (0.9.2~bzr203~60~ubuntu14.04.1) ...
Setting up juju-deployer (0.9.2~bzr203~60~ubuntu14.04.1) ...
Setting up mojo (0.3.2-10) ...
sudo: unable to resolve host oil-ci-2-bastion
sudo: unable to resolve host oil-ci-2-bastion
If you want non-root user to run mojo (e.g.: jenkins), review below file and install it with:
sudo install -o root -g root -m 0440 /usr/share/mojo/contrib/99-mojo-sudoers /etc/sudoers.d
sudo usermod -aG mojo jenkins
============================================================================

Also, note that there are installation errors which I am able to resolve with apt-get install -f and I had also hit bug 1643878; it seems like those 2 could be related. In any case, the real issue is this:

============================================================================
$ apt-cache showpkg mojo
Package: mojo
Versions:
0.3.2-10 (/var/lib/apt/lists/ppa.launchpad.net_mojo-maintainers_ppa_ubuntu_dists_trusty_main_binary-amd64_Packages) (/var/lib/dpkg/status)
 Description Language:
                 File: /var/lib/apt/lists/ppa.launchpad.net_mojo-maintainers_ppa_ubuntu_dists_trusty_main_binary-amd64_Packages
                  MD5: 98fcced1fb4b700162fd6a2a7e4d939b
 Description Language: en
                 File: /var/lib/apt/lists/ppa.launchpad.net_mojo-maintainers_ppa_ubuntu_dists_trusty_main_i18n_Translation-en
                  MD5: 98fcced1fb4b700162fd6a2a7e4d939b

Reverse Depends:
Dependencies:
0.3.2-10 - python (2 2.7) python (3 2.8) python:any (2 2.7.1-0ubuntu2) python-apt (2 0.8.3) python-jujuclient (2 0.0.7) juju-deployer (2 0.6.4) python-codetree (4 0.1.0) lxc (2 1.0.0) python-cinderclient (2 1.0.0) python-bzrlib (0 (null)) python-jinja2 (0 (null)) bzr (0 (null)) lxc-templates (0 (null)) debootstrap (0 (null)) python-argcomplete (0 (null)) juju-local (0 (null)) canonical-mojo (0 (null)) canonical-mojo (0 (null))
Provides:
0.3.2-10 - canonical-mojo
============================================================================

The dependency issue then shows up as:

============================================================================
$ mojo
Traceback (most recent call last):
  File "/usr/bin/mojo", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3141, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3127, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3154, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 640, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 941, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 828, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'juju-deployer' distribution was not found and is required by mojo
============================================================================

Tags: oil uosci

Related branches

Revision history for this message
Larry Michel (lmic) wrote :

I see what's happening. The juju-deployer in juju stable PPA,0.6.4~bzr168~49~ubuntu14.04.1, while seemingly being at the 0.6.4 level doesn't meet the depends "juju-deployer (>= 0.6.4)" for whatever reason.

So I installed from debs using juju-deployer_0.6.4-0ubuntu1_all.deb and it overwrote 0.6.4~bzr168~49~ubuntu14.04.1. Afterwards, the mojo install completed without attempting to upgrade juju-deployer.

So, went from:

$ apt-cache policy juju-deployer
juju-deployer:
  Installed: 0.6.4~bzr168~49~ubuntu14.04.1
  Candidate: 0.9.2~bzr203~60~ubuntu14.04.1
  Version table:
     0.9.2~bzr203~60~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu/ trusty/main amd64 Packages
 *** 0.6.4~bzr168~49~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/juju/stable/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.3.6-0ubuntu2 0
        500 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

to:

$ apt-cache policy juju-deployer
juju-deployer:
  Installed: 0.6.4-0ubuntu1
  Candidate: 0.9.2~bzr203~60~ubuntu14.04.1
  Version table:
     0.9.2~bzr203~60~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu/ trusty/main amd64 Packages
 *** 0.6.4-0ubuntu1 0
        100 /var/lib/dpkg/status
     0.6.4~bzr168~49~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/juju/stable/ubuntu/ trusty/main amd64 Packages
     0.3.6-0ubuntu2 0
        500 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

Revision history for this message
Greg Lutostanski (lutostag) wrote :

Just sudo apt install python-juju-deployer

Perhaps deps for the mojo package need updating?

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

Same here on a fresh Xenial installation.

Repro and output:

<fresh 16.04 cloud instance>
sudo add-apt-repository ppa:juju/stable -y &&\
sudo add-apt-repository ppa:mojo-maintainers/ppa -y &&\
sudo apt-get update -y &&\
sudo apt-get install juju mojo -y

mojo --version

Traceback (most recent call last):
  File "/usr/bin/mojo", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 635, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'juju-deployer' distribution was not found and is required by mojo

sudo apt-get install python-juju-deployer -y

mojo --version

0.4.0

tags: added: uosci
Tom Haddon (mthaddon)
Changed in mojo:
status: New → Confirmed
importance: Undecided → High
Tim Kuhlman (timkuhlman)
Changed in mojo:
assignee: nobody → Tim Kuhlman (timkuhlman)
Revision history for this message
Akash Chandrashekar (achandrashekar) wrote :

Via the current instructions on the mojo page : https://mojo.canonical.com/

This bug still exists in 0.4.0.

Until sudo apt-get install python-juju-deployer -y is installed issue continues be there :

mojo project-new --series trusty mojo-how-to

Traceback (most recent call last):
  File "/usr/bin/mojo", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 635, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'juju-deployer' distribution was not found and is required by mojo
ubuntu@juju-056424-0-kvm-0:~$ apt-get install juju-deployer

Tim Kuhlman (timkuhlman)
Changed in mojo:
status: Confirmed → Fix Released
Revision history for this message
William Grant (wgrant) wrote :

/usr/bin/juju-deployer declares its interpreter as python3 nowadays, so it's up to things that import deployer directly to depend on python-juju-deployer. Since mojo now does, I don't think there's anything left to do here.

Changed in juju-deployer:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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