backup tests fail due to format errors in messages

Bug #1166600 reported by Avishay Traeger on 2013-04-09
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Low
Avishay Traeger
Grizzly
Low
John Griffith

Bug Description

======================================================================
ERROR: Test normal backup restoration
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stack/cinder-submit/cinder/tests/test_backup.py", line 276, in test_restore_backup
    self.backup_mgr.restore_backup(self.ctxt, backup_id, vol_id)
  File "/home/stack/cinder-submit/cinder/backup/manager.py", line 194, in restore_backup
    backup['id'], backup['size'])
  File "/usr/lib/python2.7/logging/__init__.py", line 1428, in warning
    self.logger.warning(msg, *args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1152, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1258, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1268, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1308, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 748, in handle
    self.emit(record)
  File "/home/stack/cinder-submit/.venv/local/lib/python2.7/site-packages/nose/plugins/logcapture.py", line 82, in emit
    self.buffer.append(self.format(record))
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: %d format: a number is required, not unicode
-------------------- >> begin captured logging << --------------------
cinder.backup.manager: INFO: restore_backup started, restoring backup: a21d84f9-8797-49e8-b985-66281f27886e to volume: f6d3dde7-2b43-4203-a6a8-96c131bb27a2
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: Test error handling when attempting a restore of a backup
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stack/cinder-submit/cinder/tests/test_backup.py", line 256, in test_restore_backup_with_bad_service
    vol_id)
  File "/usr/lib/python2.7/unittest/case.py", line 471, in assertRaises
    callableObj(*args, **kwargs)
  File "/home/stack/cinder-submit/cinder/backup/manager.py", line 194, in restore_backup
    backup['id'], backup['size'])
  File "/usr/lib/python2.7/logging/__init__.py", line 1428, in warning
    self.logger.warning(msg, *args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1152, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1258, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1268, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1308, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 748, in handle
    self.emit(record)
  File "/home/stack/cinder-submit/.venv/local/lib/python2.7/site-packages/nose/plugins/logcapture.py", line 82, in emit
    self.buffer.append(self.format(record))
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: %d format: a number is required, not unicode
-------------------- >> begin captured logging << --------------------
cinder.backup.manager: INFO: restore_backup started, restoring backup: fc1870ea-dcc8-4516-a454-429532303dcc to volume: 7d8030d7-973d-41c5-9b30-7f94d9b81fda
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: Test error handling when an error occurs during backup restore
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/stack/cinder-submit/cinder/tests/test_backup.py", line 230, in test_restore_backup_with_driver_error
    vol_id)
  File "/usr/lib/python2.7/unittest/case.py", line 471, in assertRaises
    callableObj(*args, **kwargs)
  File "/home/stack/cinder-submit/cinder/backup/manager.py", line 194, in restore_backup
    backup['id'], backup['size'])
  File "/usr/lib/python2.7/logging/__init__.py", line 1428, in warning
    self.logger.warning(msg, *args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1152, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1258, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1268, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1308, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 748, in handle
    self.emit(record)
  File "/home/stack/cinder-submit/.venv/local/lib/python2.7/site-packages/nose/plugins/logcapture.py", line 82, in emit
    self.buffer.append(self.format(record))
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: %d format: a number is required, not unicode
-------------------- >> begin captured logging << --------------------
cinder.backup.manager: INFO: restore_backup started, restoring backup: 87f353dd-8d17-4080-8ab6-c21df92a4ac0 to volume: 5d75d9e4-62bf-4fa2-b678-7b6703cc4a38
--------------------- >> end captured logging << ---------------------

Changed in cinder:
assignee: nobody → Avishay Traeger (avishay-il)

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

Changed in cinder:
status: New → In Progress

Reviewed: https://review.openstack.org/26459
Committed: http://github.com/openstack/cinder/commit/23bd028ce39bebf0f5d2403df328ad55e6eb007e
Submitter: Jenkins
Branch: master

commit 23bd028ce39bebf0f5d2403df328ad55e6eb007e
Author: Avishay Traeger <email address hidden>
Date: Tue Apr 9 09:27:46 2013 +0300

    Fix backup manager formatting error.

    ID was being printed as %d instead of %s, causing tests to fail. This
    error was previously undetected.
    In addition, NetApp tests are failing due to a bug in the suds
    package, which is no longer actively maintained. This patch adds skips
    to the problematic tests, which should be removed once the issue is
    resolved.

    Change-Id: I5645909f59aa2ea3dc536ed4707ea75754307050
    Fixes: bug 1166600

Changed in cinder:
status: In Progress → Fix Committed
Mathew Odden (locke105) wrote :

Should this be back ported to grizzly as well? I seem to be running into the issue there as well.

Reviewed: https://review.openstack.org/26685
Committed: http://github.com/openstack/cinder/commit/fed7c923156b6f808d3d8b3db6c520810f49b135
Submitter: Jenkins
Branch: stable/grizzly

commit fed7c923156b6f808d3d8b3db6c520810f49b135
Author: Avishay Traeger <email address hidden>
Date: Tue Apr 9 09:27:46 2013 +0300

    Fix backup manager formatting error.

    ID was being printed as %d instead of %s, causing tests to fail. This
    error was previously undetected.
    In addition, NetApp tests are failing due to a bug in the suds
    package, which is no longer actively maintained. This patch adds skips
    to the problematic tests, which should be removed once the issue is
    resolved.

    Change-Id: I5645909f59aa2ea3dc536ed4707ea75754307050
    Fixes: bug 1166600
    (cherry picked from commit 23bd028ce39bebf0f5d2403df328ad55e6eb007e)

tags: added: in-stable-grizzly
Thierry Carrez (ttx) on 2013-05-29
Changed in cinder:
milestone: none → havana-1
status: Fix Committed → Fix Released
Alan Pevec (apevec) on 2013-08-06
Changed in cinder:
importance: Undecided → Low
tags: removed: in-stable-grizzly
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers