Flask 0.11.0 broke Octavia unit tests

Bug #1587849 reported by Ihar Hrachyshka
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Critical
Graham Hayes
Liberty
Fix Released
Critical
Elena Ezhova
Mitaka
Fix Released
Critical
Graham Hayes
Newton
Fix Released
Critical
Elena Ezhova
octavia
Fix Released
Critical
Elena Ezhova

Bug Description

http://logs.openstack.org/76/312276/3/check/gate-octavia-python27/e50b1d3/testr_results.html.gz

ft1.13: octavia.tests.functional.amphorae.backend.agent.api_server.test_server.ServerTestCase.test_haproxy_StringException: Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "octavia/tests/functional/amphorae/backend/agent/api_server/test_server.py", line 88, in test_haproxy
    data='test')
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/werkzeug/test.py", line 798, in put
    return self.open(*args, **kw)
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/flask/testing.py", line 113, in open
    follow_redirects=follow_redirects)
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/werkzeug/test.py", line 751, in open
    response = self.run_wsgi_app(environ, buffered=buffered)
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/werkzeug/test.py", line 668, in run_wsgi_app
    rv = run_wsgi_app(self.application, environ, buffered=buffered)
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/werkzeug/test.py", line 871, in run_wsgi_app
    app_rv = app(environ, start_response)
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/flask/app.py", line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/flask/app.py", line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/flask/app.py", line 1559, in handle_exception
    handler = self._find_error_handler(InternalServerError())
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/flask/app.py", line 1476, in _find_error_handler
    .get(code))
  File "/home/jenkins/workspace/gate-octavia-python27/.tox/py27/local/lib/python2.7/site-packages/flask/app.py", line 1465, in find_handler
    handler = handler_map.get(cls)
AttributeError: 'function' object has no attribute 'get'

Flask 0.10.1 works fine.

Tags: breaks-gate
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

This affects both Newton and Mitaka. Liberty is probably also affected.

Revision history for this message
Sergey Belous (sbelous) wrote :

Can you please mark as duplicate this one: https://bugs.launchpad.net/octavia/+bug/1587819 ?

Revision history for this message
Elena Ezhova (eezhova) wrote :

As this bug is already referenced in CRs, I marked my bug report (https://bugs.launchpad.net/octavia/+bug/1587819) as duplicate.

tags: added: breaks-gate
Revision history for this message
Elena Ezhova (eezhova) wrote :

As for octavia failures was caused by the fact that with Flask 0.11 setting error handler in the following way [1] is no longer valid. One should use either errorhandler decorator [2] or register_error_handler method [3].
Even though flask docs say that app.error_handler_spec[None][code] = callable [4] can be used it's no longer true for 0.11.

[1] https://github.com/openstack/octavia/blob/master/octavia/amphorae/backends/agent/api_server/server.py#L40
[2] https://github.com/pallets/flask/blob/master/flask/app.py#L1133
[3] https://github.com/pallets/flask/blob/master/flask/app.py#L1179
[4] https://github.com/pallets/flask/blob/master/flask/app.py#L1147-L1153

Revision history for this message
Elena Ezhova (eezhova) wrote :
Changed in octavia:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

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

Changed in designate:
assignee: nobody → Elena Ezhova (eezhova)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/324038

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/324039

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

Reviewed: https://review.openstack.org/323929
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=6df18b545f70ad2c2815077d23bb3d102ae545d4
Submitter: Jenkins
Branch: master

commit 6df18b545f70ad2c2815077d23bb3d102ae545d4
Author: Elena Ezhova <email address hidden>
Date: Wed Jun 1 16:51:03 2016 +0300

    Make registering error handlers compliant with Flask 0.11

    With Flask 0.11 setting error handlers by directly modifying
    app.error_handler_spec dictionary leads to AttributeErrors.
    It should be done by using register_error_handler method or
    errorhandler decorator.

    Change-Id: I4c6cb80a6311c081a30130ba51b8e5d7a88331b2
    Closes-Bug: #1587849

Changed in designate:
status: In Progress → Fix Released
Changed in octavia:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to octavia (master)

Reviewed: https://review.openstack.org/323869
Committed: https://git.openstack.org/cgit/openstack/octavia/commit/?id=685f7c17fd5c882e1b7198507112c2ebb8fce745
Submitter: Jenkins
Branch: master

commit 685f7c17fd5c882e1b7198507112c2ebb8fce745
Author: Elena Ezhova <email address hidden>
Date: Wed Jun 1 16:27:16 2016 +0300

    Make registering error handlers compliant with Flask 0.11

    With Flask 0.11 setting error handlers by directly modifying
    app.error_handler_spec dictionary leads to AttributeErrors.
    It should be done by using register_error_handler method or
    errorhandler decorator.

    Change-Id: I2f41ab2b9ea8c4a964b16acdf77def1b08b64a6e
    Closes-Bug: #1587849

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

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/324308

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/324312

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/designate 3.0.0.0b1

This issue was fixed in the openstack/designate 3.0.0.0b1 development milestone.

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

Reviewed: https://review.openstack.org/324038
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=f0875734311ee3d4f9ed03cdf855a78df1906e92
Submitter: Jenkins
Branch: stable/mitaka

commit f0875734311ee3d4f9ed03cdf855a78df1906e92
Author: Elena Ezhova <email address hidden>
Date: Wed Jun 1 16:51:03 2016 +0300

    Make registering error handlers compliant with Flask 0.11

    With Flask 0.11 setting error handlers by directly modifying
    app.error_handler_spec dictionary leads to AttributeErrors.
    It should be done by using register_error_handler method or
    errorhandler decorator.

    Change-Id: I4c6cb80a6311c081a30130ba51b8e5d7a88331b2
    Closes-Bug: #1587849

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

Reviewed: https://review.openstack.org/324039
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=58f3a600862b51b19c3b789790157b07fff67e49
Submitter: Jenkins
Branch: stable/liberty

commit 58f3a600862b51b19c3b789790157b07fff67e49
Author: Elena Ezhova <email address hidden>
Date: Wed Jun 1 16:51:03 2016 +0300

    Make registering error handlers compliant with Flask 0.11

    With Flask 0.11 setting error handlers by directly modifying
    app.error_handler_spec dictionary leads to AttributeErrors.
    It should be done by using register_error_handler method or
    errorhandler decorator.

    Change-Id: I4c6cb80a6311c081a30130ba51b8e5d7a88331b2
    Closes-Bug: #1587849

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

Reviewed: https://review.openstack.org/324308
Committed: https://git.openstack.org/cgit/openstack/octavia/commit/?id=bc1ef7e5a7cdabe0e9d93c27325ece642056a383
Submitter: Jenkins
Branch: stable/mitaka

commit bc1ef7e5a7cdabe0e9d93c27325ece642056a383
Author: Elena Ezhova <email address hidden>
Date: Wed Jun 1 16:27:16 2016 +0300

    Make registering error handlers compliant with Flask 0.11

    With Flask 0.11 setting error handlers by directly modifying
    app.error_handler_spec dictionary leads to AttributeErrors.
    It should be done by using register_error_handler method or
    errorhandler decorator.

    Change-Id: I2f41ab2b9ea8c4a964b16acdf77def1b08b64a6e
    Closes-Bug: #1587849
    (cherry picked from commit 685f7c17fd5c882e1b7198507112c2ebb8fce745)

Elena Ezhova (eezhova)
Changed in octavia:
assignee: nobody → Elena Ezhova (eezhova)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to octavia (stable/liberty)

Reviewed: https://review.openstack.org/324312
Committed: https://git.openstack.org/cgit/openstack/octavia/commit/?id=a40af639d4302d6f949252814c7c696664ac631f
Submitter: Jenkins
Branch: stable/liberty

commit a40af639d4302d6f949252814c7c696664ac631f
Author: Elena Ezhova <email address hidden>
Date: Wed Jun 1 16:27:16 2016 +0300

    Make registering error handlers compliant with Flask 0.11

    With Flask 0.11 setting error handlers by directly modifying
    app.error_handler_spec dictionary leads to AttributeErrors.
    It should be done by using register_error_handler method or
    errorhandler decorator.

    Change-Id: I2f41ab2b9ea8c4a964b16acdf77def1b08b64a6e
    Closes-Bug: #1587849
    (cherry picked from commit 685f7c17fd5c882e1b7198507112c2ebb8fce745)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/octavia 0.9.0

This issue was fixed in the openstack/octavia 0.9.0 release.

Changed in designate:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/octavia 0.8.1

This issue was fixed in the openstack/octavia 0.8.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate 2.1.0

This issue was fixed in the openstack/designate 2.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.