swift-proxy-server fails to start with Python 3.5

Bug #1667579 reported by Ihar Hrachyshka
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Unassigned
devstack
Invalid
Undecided
Unassigned
neutron
Invalid
Medium
Unassigned

Bug Description

Traceback (most recent call last):
  File "/usr/local/bin/swift-proxy-server", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/opt/stack/new/swift/bin/swift-proxy-server", line 23, in <module>
    sys.exit(run_wsgi(conf_file, 'proxy-server', **options))
  File "/opt/stack/new/swift/swift/common/wsgi.py", line 905, in run_wsgi
    loadapp(conf_path, global_conf=global_conf)
  File "/opt/stack/new/swift/swift/common/wsgi.py", line 389, in loadapp
    ctx = loadcontext(loadwsgi.APP, conf_file, global_conf=global_conf)
  File "/opt/stack/new/swift/swift/common/wsgi.py", line 373, in loadcontext
    global_conf=global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/opt/stack/new/swift/swift/common/wsgi.py", line 66, in get_context
    object_type, name=name, global_conf=global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 450, in get_context
    global_additions=global_additions)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 562, in _pipeline_app_context
    for name in pipeline[:-1]]
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 562, in <listcomp>
    for name in pipeline[:-1]]
  File "/opt/stack/new/swift/swift/common/wsgi.py", line 66, in get_context
    object_type, name=name, global_conf=global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 454, in get_context
    section)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use
    object_type, name=use, global_conf=global_conf)
  File "/opt/stack/new/swift/swift/common/wsgi.py", line 66, in get_context
    object_type, name=name, global_conf=global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 406, in get_context
    global_conf=global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 620, in get_context
    object_type, name=name)
  File "/usr/local/lib/python3.5/dist-packages/paste/deploy/loadwsgi.py", line 646, in find_egg_entry_point
    possible.append((entry.load(), protocol, entry.name))
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 2302, in load
    return self.resolve()
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 2308, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/opt/stack/new/swift/swift/common/middleware/slo.py", line 799
    def is_small_segment((seg_dict, start_byte, end_byte)):
                         ^
SyntaxError: invalid syntax

http://logs.openstack.org/14/437514/3/check/gate-rally-dsvm-py35-neutron-neutron-ubuntu-xenial/3221186/logs/screen-s-proxy.txt.gz

This currently blocks neutron gate where we have a voting py3 tempest job. The reason why swift is deployed with Python3.5 there is because we special case in devstack to deploy the service with Python3:

http://git.openstack.org/cgit/openstack-dev/devstack/tree/inc/python#n167

The short term solution is to disable the special casing. Swift should then work on fixing the code, and gate on Python3 (preferably the same job as neutron has).

Tags: python3
Changed in neutron:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
Changed in devstack:
status: New → Confirmed
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

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

Changed in devstack:
status: Confirmed → In Progress
Revision history for this message
John Dickinson (notmyname) wrote :

Swift doesn't support py3, and thee will be a *lot* of work to make it do so. It's being worked on in general, but it won't be done any time soon.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on devstack (master)

Change abandoned by Ihar Hrachyshka (<email address hidden>) on branch: master
Review: https://review.openstack.org/437802
Reason: Seems like https://review.openstack.org/#/c/438135/ is the way forward, and it's not pressing neutron gate anymore since it's non-voting.

Changed in neutron:
importance: Critical → Medium
Changed in swift:
status: New → Confirmed
Changed in neutron:
status: Confirmed → Invalid
assignee: Ihar Hrachyshka (ihar-hrachyshka) → nobody
Changed in devstack:
assignee: Ihar Hrachyshka (ihar-hrachyshka) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.

Changed in devstack:
status: In Progress → Confirmed
Sean Dague (sdague)
Changed in devstack:
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
status: Confirmed → In Progress
Tim Burke (1-tim-z)
tags: added: python3
Changed in devstack:
assignee: Ihar Hrachyshka (ihar-hrachyshka) → nobody
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

Seems that this is an issue that only swift can solve. Hopefully this gets done well before py2 is EOL so there can be a reasonable transition period. IMO it would have to be at least a year, so swift should be making it a critical effort to support Python 3 by the end of 2018. The clock is ticking: https://pythonclock.org/

Changed in devstack:
status: In Progress → Invalid
Revision history for this message
Tim Burke (1-tim-z) wrote :

As of Swift 2.22.0, we have support for py3 across all services and daemons.

FWIW, this particular problem was addressed in https://opendev.org/openstack/swift/commit/11bf9e4

Changed in swift:
status: Confirmed → 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.