swift-dispersion-populate and python3

Bug #1895346 reported by David Orman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Unassigned

Bug Description

Reference: https://bugs.launchpad.net/swift/+bug/1863680

Just as swift-dispersion-report needed an update under python3 to function properly, so does swift-dispersion-populate. The following patch to the Ussuri release (mirroring the style of patch that resolved the prior bug report) will correct this issue:

root@sw-proxy01:~# swift-dispersion-populate
Using storage policy: Policy-0
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/keystoneclient/v3/client.py", line 343, in get_raw_token_from_identity_service
    return plugin.get_auth_ref(self.session)
  File "/usr/lib/python3/dist-packages/keystoneclient/auth/identity/v3/base.py", line 189, in get_auth_ref
    authenticated=False, log=False, **rkwargs)
  File "/usr/lib/python3/dist-packages/keystoneclient/session.py", line 543, in post
    return self.request(url, 'POST', **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneclient/session.py", line 428, in request
    resp = send(**kwargs)
  File "/usr/lib/python3/dist-packages/keystoneclient/session.py", line 462, in _send_request
    resp = self.session.request(method, url, **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneclient/httpclient.py", line 96, in request
    return requests.request(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 520, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 630, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 852, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect
    cert_reqs=resolve_cert_reqs(self.cert_reqs),
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 269, in create_urllib3_context
    context.options |= options
  File "/usr/lib/python3.6/ssl.py", line 465, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/usr/lib/python3.6/ssl.py", line 465, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/usr/lib/python3.6/ssl.py", line 465, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  [Previous line repeated 317 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/swiftclient/client.py", line 636, in get_auth_keystone
    auth_url=auth_url, insecure=insecure, timeout=timeout)
  File "/usr/lib/python3/dist-packages/keystoneclient/v3/client.py", line 267, in __init__
    self.authenticate()
  File "/usr/lib/python3/dist-packages/keystoneclient/httpclient.py", line 583, in authenticate
    resp = self.get_raw_token_from_identity_service(**kwargs)
  File "/usr/lib/python3/dist-packages/keystoneclient/v3/client.py", line 353, in get_raw_token_from_identity_service
    _('Authorization failed: %s') % e)
keystoneauth1.exceptions.auth.AuthorizationFailure: Authorization failed: maximum recursion depth exceeded while calling a Python object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/swift-dispersion-populate", line 170, in <module>
    insecure=insecure)
  File "/usr/lib/python3/dist-packages/swiftclient/client.py", line 734, in get_auth
    auth_version=auth_version)
  File "/usr/lib/python3/dist-packages/swiftclient/client.py", line 644, in get_auth_keystone
    raise ClientException('Authorization Failure. %s' % err)
swiftclient.exceptions.ClientException: Authorization Failure. Authorization failed: maximum recursion depth exceeded while calling a Python object
root@sw-proxy01:~#

root@sw-proxy01:~# diff -U0 /usr/bin/swift-dispersion-populate /root/swift-dispersion-populate
--- /usr/bin/swift-dispersion-populate 2020-05-19 16:36:37.000000000 +0000
+++ /root/swift-dispersion-populate 2020-09-11 18:40:21.869464770 +0000
@@ -30,4 +29,0 @@
-try:
- from swiftclient import get_auth
-except ImportError:
- from swift.common.internal_client import get_auth
@@ -164,0 +161,6 @@
+
+ try:
+ # Delay importing so urllib3 will import monkey-patched modules
+ from swiftclient import get_auth
+ except ImportError:
+ from swift.common.internal_client import get_auth
root@sw-proxy01:~# /root/swift-dispersion-populate
Using storage policy: Policy-0
Created 327 containers for dispersion reporting, 13s, 0 retries
Created 327 objects for dispersion reporting, 13s, 0 retries
root@sw-proxy01:~#

Revision history for this message
David Orman (ormandj) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/751384
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=5b8073c7703c42a0b2b07536cd84e16ebf811b04
Submitter: Zuul
Branch: master

commit 5b8073c7703c42a0b2b07536cd84e16ebf811b04
Author: Tim Burke <email address hidden>
Date: Fri Sep 11 11:46:00 2020 -0700

    py3: Fix swift-dispersion-populate

    We fixed swift-dispersion-report already; -populate needed the same fix
    or else it'd hit a "maximum recursion depth exceeded" error.

    Change-Id: I2d22e087a88c9e8003621feb26460ab6e5ce2a57
    Related-Change: I24f4bcc3d62dc37fd9559032bfd25f5b15f98745
    Closes-Bug: #1895346
    Related-Bug: #1863680

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

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/754851

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/754852

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/754853

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

Reviewed: https://review.opendev.org/754853
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=91b2cd0acba786f29fc40c2261cecc83e685b492
Submitter: Zuul
Branch: stable/train

commit 91b2cd0acba786f29fc40c2261cecc83e685b492
Author: Tim Burke <email address hidden>
Date: Fri Sep 11 11:46:00 2020 -0700

    py3: Fix swift-dispersion-populate

    We fixed swift-dispersion-report already; -populate needed the same fix
    or else it'd hit a "maximum recursion depth exceeded" error.

    Change-Id: I2d22e087a88c9e8003621feb26460ab6e5ce2a57
    Related-Change: I24f4bcc3d62dc37fd9559032bfd25f5b15f98745
    Closes-Bug: #1895346
    Related-Bug: #1863680
    (cherry picked from commit 5b8073c7703c42a0b2b07536cd84e16ebf811b04)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (stable/victoria)

Reviewed: https://review.opendev.org/754851
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=508c444697e9d0d721adc0bcc0b863b43ab3768d
Submitter: Zuul
Branch: stable/victoria

commit 508c444697e9d0d721adc0bcc0b863b43ab3768d
Author: Tim Burke <email address hidden>
Date: Fri Sep 11 11:46:00 2020 -0700

    py3: Fix swift-dispersion-populate

    We fixed swift-dispersion-report already; -populate needed the same fix
    or else it'd hit a "maximum recursion depth exceeded" error.

    Change-Id: I2d22e087a88c9e8003621feb26460ab6e5ce2a57
    Related-Change: I24f4bcc3d62dc37fd9559032bfd25f5b15f98745
    Closes-Bug: #1895346
    Related-Bug: #1863680
    (cherry picked from commit 5b8073c7703c42a0b2b07536cd84e16ebf811b04)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (stable/ussuri)

Reviewed: https://review.opendev.org/754852
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=b00df2969698dca789bbc42adc4331308b2db753
Submitter: Zuul
Branch: stable/ussuri

commit b00df2969698dca789bbc42adc4331308b2db753
Author: Tim Burke <email address hidden>
Date: Fri Sep 11 11:46:00 2020 -0700

    py3: Fix swift-dispersion-populate

    We fixed swift-dispersion-report already; -populate needed the same fix
    or else it'd hit a "maximum recursion depth exceeded" error.

    Change-Id: I2d22e087a88c9e8003621feb26460ab6e5ce2a57
    Related-Change: I24f4bcc3d62dc37fd9559032bfd25f5b15f98745
    Closes-Bug: #1895346
    Related-Bug: #1863680
    (cherry picked from commit 5b8073c7703c42a0b2b07536cd84e16ebf811b04)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.27.0

This issue was fixed in the openstack/swift 2.27.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift victoria-eom

This issue was fixed in the openstack/swift victoria-eom release.

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.