canonical / layer-basic

Base layer for building charms using the reactive pattern
Apache License 2.0
11 stars 43 forks source link

series-upgrade to focal fails #175

Closed tbaumann closed 4 years ago

tbaumann commented 4 years ago

Just experienced with the ubuntu charm. Series upgrade to focal fails because the virtualenv command isn't there. I think the issue is, that the virtualenv package no longer contains the package. Once the package python3-virtualenv is installed manually, everything works.

unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade Reading package lists...
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade Building dependency tree...
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade Reading state information...
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade build-essential is already the newest version (12.8ubuntu1).
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade python3-dev is already the newest version (3.8.2-0ubuntu2).
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade python3-setuptools is already the newest version (45.2.0-1).
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade python3-yaml is already the newest version (5.3.1-1).
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade python3-pip is already the newest version (20.0.2-5ubuntu1).
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade python3-wheel is already the newest version (0.34.2-1).
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade The following packages were automatically installed and are no longer required:
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade   dh-python g++-7 libfreetype6 libpython3.6-dev libstdc++-7-dev libuv1
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade   python3-keyring python3-keyrings.alt python3-secretstorage python3-xdg
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade   python3.6-dev
unit-ubuntu-2: 14:15:50 DEBUG unit.ubuntu/2.post-series-upgrade Use 'apt autoremove' to remove them.
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade 0 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade Reading package lists...
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade Building dependency tree...
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade Reading state information...
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade The following packages were automatically installed and are no longer required:
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade   dh-python g++-7 libfreetype6 libpython3.6-dev libstdc++-7-dev libuv1
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade   python3-keyring python3-keyrings.alt python3-secretstorage python3-xdg
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade   python3.6-dev
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade Use 'apt autoremove' to remove them.
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade 0 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.
unit-ubuntu-2: 14:15:51 DEBUG unit.ubuntu/2.post-series-upgrade Reading package lists...
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade Building dependency tree...
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade Reading state information...
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade virtualenv is already the newest version (20.0.17-1).
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade The following packages were automatically installed and are no longer required:
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   dh-python g++-7 libfreetype6 libpython3.6-dev libstdc++-7-dev libuv1
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   python3-keyring python3-keyrings.alt python3-secretstorage python3-xdg
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   python3.6-dev
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade Use 'apt autoremove' to remove them.
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade 0 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade Traceback (most recent call last):
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   File "/var/lib/juju/agents/unit-ubuntu-2/charm/hooks/post-series-upgrade", line 8, in <module>
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade     basic.bootstrap_charm_deps()
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   File "lib/charms/layer/basic.py", line 97, in bootstrap_charm_deps
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade     check_call(cmd)
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   File "/usr/lib/python3.8/subprocess.py", line 359, in check_call
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade     retcode = call(*popenargs, **kwargs)
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   File "/usr/lib/python3.8/subprocess.py", line 340, in call
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade     with Popen(*popenargs, **kwargs) as p:
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade     self._execute_child(args, executable, preexec_fn, close_fds,
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade   File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade     raise child_exception_type(errno_num, err_msg, err_filename)
unit-ubuntu-2: 14:15:52 DEBUG unit.ubuntu/2.post-series-upgrade FileNotFoundError: [Errno 2] No such file or directory: 'virtualenv'
unit-ubuntu-2: 14:15:52 ERROR juju.worker.uniter.operation hook "post-series-upgrade" failed: exit status 1
unit-ubuntu-2: 14:15:52 INFO juju.worker.uniter awaiting error resolution for "post-series-upgrade" hook
tbaumann commented 4 years ago

Sorry, this was an artefact of the lxd package failing and somehow leaving do-release-upgrade unfinished in a non obvious way.

It's not a charm problem. Everything is fine.