config-changed fails on upgrade to cs:swift-storage-249 with loop devices

Bug #1804128 reported by Xav Paice
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Swift Storage Charm
Fix Released
Critical
Alex Kavanagh

Bug Description

Upgrade charm to cs:swift-storage-249 (from 247). The config-changed hook failed with:

2018-11-20 04:12:43 INFO juju-log Making dir /srv/node swift:swift 755
2018-11-20 04:12:43 DEBUG config-changed Traceback (most recent call last):
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/hooks/config-changed", line 430, in <module>
2018-11-20 04:12:43 DEBUG config-changed main()
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/hooks/config-changed", line 418, in main
2018-11-20 04:12:43 DEBUG config-changed hooks.execute(sys.argv)
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/core/hookenv.py", line 909, in execute
2018-11-20 04:12:43 DEBUG config-changed self._hooks[hook_name]()
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/core/host.py", line 717, in wrapped_f
2018-11-20 04:12:43 DEBUG config-changed restart_functions)
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/core/host.py", line 739, in restart_on_change_helper
2018-11-20 04:12:43 DEBUG config-changed r = lambda_f()
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/core/host.py", line 716, in <lambda>
2018-11-20 04:12:43 DEBUG config-changed (lambda: f(*args, **kwargs)), restart_map, stopstart,
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/contrib/hardening/harden.py", line 93, in _harden_inner2
2018-11-20 04:12:43 DEBUG config-changed return f(*args, **kwargs)
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/hooks/config-changed", line 236, in config_changed
2018-11-20 04:12:43 DEBUG config-changed configure_storage()
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/hooks/config-changed", line 345, in configure_storage
2018-11-20 04:12:43 DEBUG config-changed setup_storage(config('encrypt'))
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/lib/swift_storage_utils.py", line 481, in setup_storage
2018-11-20 04:12:43 DEBUG config-changed for dev in determine_block_devices():
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/lib/swift_storage_utils.py", line 294, in determine_block_devices
2018-11-20 04:12:43 DEBUG config-changed [x for x in map(ensure_block_device, bdevs) if str(x).lower() not in
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/lib/swift_storage_utils.py", line 294, in <listcomp>
2018-11-20 04:12:43 DEBUG config-changed [x for x in map(ensure_block_device, bdevs) if str(x).lower() not in
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/lib/misc_utils.py", line 70, in ensure_block_device
2018-11-20 04:12:43 DEBUG config-changed bdev = ensure_loopback_device(bdev, size)
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/contrib/storage/linux/loopback.py", line 68, in ensure_loopback_device
2018-11-20 04:12:43 DEBUG config-changed for d, f in six.iteritems(loopback_devices()):
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/contrib/storage/linux/loopback.py", line 40, in loopback_devices
2018-11-20 04:12:43 DEBUG config-changed check_output(cmd).splitlines() if d != '']
2018-11-20 04:12:43 DEBUG config-changed File "/var/lib/juju/agents/unit-swift-storage-z1-0/charm/charmhelpers/contrib/storage/linux/loopback.py", line 40, in <listcomp>
2018-11-20 04:12:43 DEBUG config-changed check_output(cmd).splitlines() if d != '']
2018-11-20 04:12:43 DEBUG config-changed TypeError: 'str' does not support the buffer interface
2018-11-20 04:12:43 ERROR juju.worker.uniter.operation runhook.go:129 hook "config-changed" failed: exit status 1

The block-device setting is currently '/srv/node/swift1/swift.img|500G /srv/node/swift2/swift.img|500G'.

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

This is because swift-storage is now a py3 charm, but the code in charmhelpers wasn't actually upgraded to py3 code entirely.

Changed in charm-swift-storage:
status: New → Confirmed
assignee: nobody → Alex Kavanagh (ajkavanagh)
importance: Undecided → Critical
Changed in charm-swift-storage:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-swift-storage (master)

Fix proposed to branch: master
Review: https://review.openstack.org/619009

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-swift-storage (master)

Reviewed: https://review.openstack.org/619009
Committed: https://git.openstack.org/cgit/openstack/charm-swift-storage/commit/?id=25ec6c6a3dd609746d1194a07588ca954f19a333
Submitter: Zuul
Branch: master

commit 25ec6c6a3dd609746d1194a07588ca954f19a333
Author: Alex Kavanagh <email address hidden>
Date: Tue Nov 20 14:27:55 2018 +0000

    Sync c-h with loopback_devices() fix

    PY3 bug in loopback_devices caused the related bug. This patch syncs
    just the relevant file to fix the bug into charmhelpers.

    Change-Id: I5aacd16c2bd4957c49210e867dc76efa1a315ab4
    Closes-Bug: #1804128

Changed in charm-swift-storage:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-swift-storage (stable/18.11)

Fix proposed to branch: stable/18.11
Review: https://review.openstack.org/619078

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-swift-storage (stable/18.11)

Reviewed: https://review.openstack.org/619078
Committed: https://git.openstack.org/cgit/openstack/charm-swift-storage/commit/?id=49b53d996c9cc5dac594844091ddbaac05a6f207
Submitter: Zuul
Branch: stable/18.11

commit 49b53d996c9cc5dac594844091ddbaac05a6f207
Author: Alex Kavanagh <email address hidden>
Date: Tue Nov 20 14:27:55 2018 +0000

    Sync c-h with loopback_devices() fix

    PY3 bug in loopback_devices caused the related bug. This patch syncs
    just the relevant file to fix the bug into charmhelpers.

    Closes-Bug: #1804128
    (cherry picked from commit 25ec6c6a3dd609746d1194a07588ca954f19a333)

    Change-Id: I0fd46225f8afac9c7105232330ca54529d5b78f2

James Page (james-page)
Changed in charm-swift-storage:
milestone: none → 18.11
James Page (james-page)
Changed in charm-swift-storage:
status: Fix Committed → Fix Released
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.