sql backend throwing DeprecationWarning: BaseException.message

Bug #1257530 reported by gordon chung
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
Unassigned
oslo-incubator
Fix Released
Low
Roman Podoliaka

Bug Description

seems to be some integrity error when using mysql backend.

collector is flooded with repeating message:

/opt/stack/ceilometer/ceilometer/openstack/common/db/sqlalchemy/session.py:484: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.message)
/opt/stack/ceilometer/ceilometer/openstack/common/db/sqlalchemy/session.py:484: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.message)
/opt/stack/ceilometer/ceilometer/openstack/common/db/sqlalchemy/session.py:484: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.message)
/opt/stack/ceilometer/ceilometer/openstack/common/db/sqlalchemy/session.py:484: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.message)

gordon chung (chungg)
Changed in ceilometer:
assignee: nobody → gordon chung (chungg)
gordon chung (chungg)
summary: - mysql backend throwing DeprecationWarning: BaseException.message
+ sql backend throwing DeprecationWarning: BaseException.message
Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Triaged
Revision history for this message
gordon chung (chungg) wrote :

related to _create_or_update method... we try adding values and catch IntegrityError if value is already added. while we catch error, underlying oslo code has a wrapper to catch error as well (see def _wrap_db_error(f))... that catch is pumping out deprecationWarnings.

the data seems to be recorded still -- just the screen is flooded with warnings

Revision history for this message
Al Bailey (albailey1974) wrote :

In my environment I was able to eliminate those deprecation warnings by replacing:
m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.message)
with this:
m = _DUP_KEY_RE_DB[engine_name].match(integrity_error.args[0])

gordon chung (chungg)
Changed in ceilometer:
assignee: gordon chung (chungg) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Changed in oslo:
assignee: nobody → gordon chung (chungg)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in oslo:
assignee: gordon chung (chungg) → Attila Fazekas (afazekas)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
assignee: nobody → Attila Fazekas (afazekas)
status: Triaged → In Progress
Revision history for this message
gordon chung (chungg) wrote :

this needs to be fixed in oslo but for most part, ceilometer specific part will be handled by this: https://review.openstack.org/#/c/81969/

Changed in ceilometer:
assignee: Attila Fazekas (afazekas) → nobody
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.db (master)

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

Changed in ceilometer:
status: In Progress → Confirmed
Changed in oslo:
importance: Undecided → Low
Revision history for this message
Brant Knudson (blk-u) wrote :

The deprecation warnings are also printed when running keystone-manage db_sync.

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

Change abandoned by afazekas (<email address hidden>) on branch: master
Review: https://review.openstack.org/94054

Changed in oslo:
assignee: Attila Fazekas (afazekas) → Roman Podoliaka (rpodolyaka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.db (master)

Reviewed: https://review.openstack.org/111266
Committed: https://git.openstack.org/cgit/openstack/oslo.db/commit/?id=584a8834889f7f5fac4b598e63bbcc8e1dd53abe
Submitter: Jenkins
Branch: master

commit 584a8834889f7f5fac4b598e63bbcc8e1dd53abe
Author: Alexei Kornienko <email address hidden>
Date: Fri Aug 1 15:48:34 2014 +0300

    Fixed DeprecationWarning in exc_filters

    DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
    This warning was generated in exc_filters during exception conversions.
    Fix it by removing access to deprecated attribute

    Closes-Bug: #1257530

    Change-Id: I8ff8b974946ecab13f12a70b315dd94c3453197e

Changed in oslo:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo-incubator:
milestone: none → juno-3
status: Fix Committed → Fix Released
Revision history for this message
gordon chung (chungg) wrote :

marking as committed since we're using oslo.db

Changed in ceilometer:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: kilo-1 → 2015.1.0
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.