woodpecker fails to deploy on baremetal

Bug #1921765 reported by Gábor Mészáros
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Woodpecker Charm
Triaged
Medium
Unassigned

Bug Description

This is the traceback I'm getting right after doing
`juju deploy cs:~openstack-charmers-next/woodpecker --to lxd:25 --series bionic --bind "oam-space public=ceph-access-space cluster=ceph-replica-space`

Tried leaving out bindings and deploying on other machines, the result is the same.

2021-03-29 07:06:23 INFO juju-log Installing ['ceph-common', 'fio'] with options: ['--option=Dpkg::Options::=--force-confold']
2021-03-29 07:06:23 DEBUG config-changed Reading package lists...
2021-03-29 07:06:23 DEBUG config-changed Building dependency tree...
2021-03-29 07:06:23 DEBUG config-changed Reading state information...
2021-03-29 07:06:24 DEBUG config-changed fio is already the newest version (3.1-1).
2021-03-29 07:06:24 DEBUG config-changed ceph-common is already the newest version (12.2.12-0ubuntu0.18.04.5).
2021-03-29 07:06:24 DEBUG config-changed The following packages were automatically installed and are no longer required:
2021-03-29 07:06:24 DEBUG config-changed libauparse0 libfreetype6
2021-03-29 07:06:24 DEBUG config-changed Use 'apt autoremove' to remove them.
2021-03-29 07:06:24 DEBUG config-changed 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2021-03-29 07:06:24 INFO juju-log Updating status
2021-03-29 07:06:24 DEBUG config-changed lxc
2021-03-29 07:06:24 WARNING juju-log No snap resource available, install blocked, deferring event: CephBenchmarkingCharmJewel/on/install[1]
2021-03-29 07:06:24 DEBUG juju-log Found event: CephBenchmarkingCharmJewel/on/install[1] x 1
2021-03-29 07:06:24 DEBUG juju-log Deferring CephBenchmarkingCharmJewel/on/install[1] notice count of 1
2021-03-29 07:06:24 DEBUG juju-log Emitting Juju event config_changed.
2021-03-29 07:06:24 INFO juju-log Setting swift key
2021-03-29 07:06:24 ERROR juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 964, in <module>
    main(ops_openstack.core.get_charm_class_for_release())
  File "/var/lib/juju/agents/unit-ceph-benchmarking-3/charm/venv/ops/main.py", line 347, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-ceph-benchmarking-3/charm/venv/ops/main.py", line 123, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-ceph-benchmarking-3/charm/venv/ops/framework.py", line 212, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-ceph-benchmarking-3/charm/venv/ops/framework.py", line 624, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-ceph-benchmarking-3/charm/venv/ops/framework.py", line 667, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 385, in render_config
    self.get_swift_key()
  File "./src/charm.py", line 676, in get_swift_key
    self.peers.set_swift_key(_swift_key)
  File "/var/lib/juju/agents/unit-ceph-benchmarking-3/charm/src/interface_ceph_benchmarking_peers.py", line 50, in set_swift_key
    self.peers_rel.data[self.peers_rel.app][self.SWIFT_KEY] = password
AttributeError: 'NoneType' object has no attribute 'data'
2021-03-29 07:06:24 ERROR juju.worker.uniter.operation runhook.go:132 hook "config-changed" failed: exit status 1

Revision history for this message
Gábor Mészáros (gabor.meszaros) wrote :

idk if this is enough of a fix, but adding the below patch at least makes the charm deployable.

--- interface_woodpecker_peers.py 2021-03-31 11:47:19.170943605 +0000
+++ interface_woodpecker_peers.py.patched 2021-03-31 12:03:46.441972755 +0000
@@ -47,7 +47,8 @@

     def set_swift_key(self, password):
         logging.info("Setting swift key")
- self.peers_rel.data[self.peers_rel.app][self.SWIFT_KEY] = password
+ if self.peers_rel:
+ self.peers_rel.data[self.peers_rel.app][self.SWIFT_KEY] = password

     def set_swift_user_created(self, user):
         logging.info("Setting swift user created")

Revision history for this message
Gábor Mészáros (gabor.meszaros) wrote :
Revision history for this message
James Page (james-page) wrote :

I think your proposed patch is reasonable to resolve early-unit lifecycle issues related to the lack of the peers relation at that point in time.

Changed in charm-woodpecker:
status: New → Triaged
importance: Undecided → Medium
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.