KeyError cfg['python_packages']

Bug #1815047 reported by Andre Ruiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
New
Undecided
Unassigned

Bug Description

When deploying a charm built locally, I get the following error on the juju debug-log. The specific code that is throwing the error is in lib/charms/layer/basic.py:

if cfg['python_packages']:

This seems wrong as all the other config access throughout the file use the form of cfg.get('configname'), and it is probaly a bug.

I'm using the snap on Comsic:
Name Version Rev Tracking Publisher Notes
charm 2.5.1 318 stable johnsca classic

I checked https://github.com/juju-solutions/layer-basic/blob/master/lib/charms/layer/basic.py and this change was introduced about 5 months ago, so the question is why it's not breaking every build currently (on cosmic, at least).

unit-nextcloud-4: 10:20:21 DEBUG unit.nextcloud/4.install Found existing installation: charms.reactive 1.2.0
unit-nextcloud-4: 10:20:21 DEBUG unit.nextcloud/4.install Uninstalling charms.reactive-1.2.0:
unit-nextcloud-4: 10:20:21 DEBUG unit.nextcloud/4.install Successfully uninstalled charms.reactive-1.2.0
unit-nextcloud-4: 10:20:22 DEBUG unit.nextcloud/4.install Successfully installed MarkupSafe-1.1.0 PyYAML-3.13 Tempita-0.5
.2 charmhelpers-0.19.8 charms.reactive-1.2.0 pip-8.1.2 pyaml-18.11.0 setuptools-39.0.1 setuptools-scm-1.17.0
unit-nextcloud-4: 10:20:22 DEBUG unit.nextcloud/4.install Traceback (most recent call last):
unit-nextcloud-4: 10:20:22 DEBUG unit.nextcloud/4.install File "/var/lib/juju/agents/unit-nextcloud-4/charm/hooks/insta
ll", line 8, in <module>
unit-nextcloud-4: 10:20:22 DEBUG unit.nextcloud/4.install basic.bootstrap_charm_deps()
unit-nextcloud-4: 10:20:22 DEBUG unit.nextcloud/4.install File "lib/charms/layer/basic.py", line 118, in bootstrap_char
m_deps
unit-nextcloud-4: 10:20:22 DEBUG unit.nextcloud/4.install if cfg['python_packages']:
unit-nextcloud-4: 10:20:22 DEBUG unit.nextcloud/4.install KeyError: 'python_packages'
unit-nextcloud-4: 10:20:22 ERROR juju.worker.uniter.operation hook "install" failed: exit status 1
unit-nextcloud-4: 10:20:22 INFO juju.worker.uniter awaiting error resolution for "install" hook

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

Sorry I guess this is the wrong place for this bug. Uppon more investigation it seems that layers get downloaded from github in realtime and are not present on any package.

I will submit a pull request to the project on github.

This can be closed. Thank you.

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.