glance <-> swift integration non-functional

Bug #1804023 reported by Andrew McLeod
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Glance Charm
Fix Released
Medium
Unassigned

Bug Description

bionic (distro) deployment of glance + swift, error 'no module named swiftclient' - python2 swiftclient module is installed, python3-swiftclient is not. manually installing python3-swiftclient gets past this specific error

error log:

https://pastebin.ubuntu.com/p/5pCh6nnFJK/

Revision history for this message
Corey Bryant (corey.bryant) wrote :

It appears the problem is that the charm itself is py3 now is attempting to use the py2 swift client, python-swiftclient. hooks/glance_utils.py imports swiftclient. The charm needs to use the python3-swiftclient.

Revision history for this message
James Page (james-page) wrote :

Marking as Medium as most deployments don't use swift as the backend for glance (ceph is used).

This is fairly non-trivial to fix - Py3 versions of swiftclient are only present from Xenial onwards and we have to support trusty still. It also looks like the swift support is still using keystone v2 auth which will be broken in later releases which drop the v2 api.

Changed in charm-glance:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Page (james-page) wrote :

Preference is to switch to subprocess execution of the swiftclient rather than direct module calls.

Revision history for this message
James Page (james-page) wrote :

I highly doubt the swift integration functional in any way in a HA deployment:

        temp_url_key = pwgen(length=64)
        swift_connection.post_account(headers={'x-account-meta-temp-url-key':
                                               temp_url_key})

The temp-url key is generated per unit, rather than being set by the master glance unit and then being shared via leader storage.

summary: - py3 - No module named swiftclient
+ glance <-> swift integration non-functional
Revision history for this message
James Page (james-page) wrote :

OK so we need to make a decision as to whether to spend the cycles to fix this support, or drop it all together.

Revision history for this message
David Ames (thedac) wrote :

@James,

That temp_url_key bit seems vestigial. Note that this is in the image-service (nova-compute,cinder to glance) relation and not the object-store (glance to swift) relation. Also the image-service contexts never check swift-temp-url-key key [0]. I also grepped through all the charms and all of charm-helpers and swift-temp-url-key is only found in the glance charm it is never consumed as far as I can tell.

Long story short, I think we can safely remove it.

[0] https://github.com/juju/charm-helpers/blob/master/charmhelpers/contrib/openstack/context.py#L751

Revision history for this message
David Ames (thedac) wrote :

Code speaks louder than words: https://review.openstack.org/620371

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

Reviewed: https://review.openstack.org/620371
Committed: https://git.openstack.org/cgit/openstack/charm-glance/commit/?id=178d2701d640e656498e58131b529025a43d79b2
Submitter: Zuul
Branch: master

commit 178d2701d640e656498e58131b529025a43d79b2
Author: David Ames <email address hidden>
Date: Tue Nov 27 09:28:32 2018 -0800

    Remove vestigial swift_temp_url_key

    The swift-temp-url-key key on the image-service relation seems never to
    be consumed (see the ImageService context(s)). It appears to be
    vestigial and causes problems like Bug#1804023.

    As it is never consumed, this change removes it.

    Closes-Bug: #1804023

    Change-Id: I2cc19c550ebb1de09e66de8685d507f7db9e0f24

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

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

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

Reviewed: https://review.openstack.org/623511
Committed: https://git.openstack.org/cgit/openstack/charm-glance/commit/?id=f136e4d68cd84067b2ad97133b4f970503817b18
Submitter: Zuul
Branch: stable/18.11

commit f136e4d68cd84067b2ad97133b4f970503817b18
Author: David Ames <email address hidden>
Date: Tue Nov 27 09:28:32 2018 -0800

    Remove vestigial swift_temp_url_key

    The swift-temp-url-key key on the image-service relation seems never to
    be consumed (see the ImageService context(s)). It appears to be
    vestigial and causes problems like Bug#1804023.

    As it is never consumed, this change removes it.

    Closes-Bug: #1804023

    Change-Id: I2cc19c550ebb1de09e66de8685d507f7db9e0f24
    (cherry picked from commit 178d2701d640e656498e58131b529025a43d79b2)

James Page (james-page)
Changed in charm-glance:
milestone: none → 19.04
David Ames (thedac)
Changed in charm-glance:
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.