NFS backup driver logs TypeError when not configured correctly

Bug #1797227 reported by Eric Harney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Eric Harney

Bug Description

If "backup_share" is not set, this error is logged:

Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall [-] Fixed interval looping call 'cinder.backup.manager.BackupManager._setup_backup
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall Traceback (most recent call last):
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall File "/usr/lib/python2.7/site-packages/oslo_service/loopingcall.py", line 193, i
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall result = func(*self.args, **self.kw)
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall File "/opt/stack/cinder/cinder/backup/manager.py", line 151, in _setup_backup_dr
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall backup_service = self.service(context=ctxt, db=self.db)
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall File "/opt/stack/cinder/cinder/backup/drivers/nfs.py", line 61, in __init__
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall backup_path = self._init_backup_repo_path()
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall File "/opt/stack/cinder/cinder/backup/drivers/nfs.py", line 82, in _init_backup_
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall remotefsclient.mount(self.backup_share)
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall File "/opt/stack/os-brick/os_brick/remotefs/remotefs.py", line 97, in mount
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall mount_path = self.get_mount_point(share)
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall File "/opt/stack/os-brick/os_brick/remotefs/remotefs.py", line 81, in get_mount_
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall self._get_hash_str(device_name))
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall File "/opt/stack/os-brick/os_brick/remotefs/remotefs.py", line 73, in _get_hash_
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall return hashlib.md5(base_str).hexdigest()
Oct 10 15:57:50 centstack.localdomain cinder-backup[17863]: ERROR oslo.service.loopingcall TypeError: md5() argument 1 must be string or buffer, not None

fixing this results in the more sensible error message based on the checking that is already done:

Oct 10 16:00:47 centstack.localdomain cinder-backup[17939]: ERROR oslo.service.loopingcall InvalidConfigurationValue: Value "None" is not valid for configuration option "backup_share"

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

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

Changed in cinder:
assignee: nobody → Eric Harney (eharney)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/609534
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=fdc10686cf77e981ba5dc7107d545095c36a2a95
Submitter: Zuul
Branch: master

commit fdc10686cf77e981ba5dc7107d545095c36a2a95
Author: Eric Harney <email address hidden>
Date: Wed Oct 10 16:00:59 2018 -0400

    NFS Backup: Avoid TypeError in os-brick when not configured

    If backup_share is not set, a TypeError is raised from
    os-brick, because this code is run before the config options
    are validated.

    Don't try to initialize the path if this is not set.

    Closes-Bug: #1797227
    Change-Id: I96e104f0e0da0257c48bbaffc2b436f670ccdb76

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 14.0.0.0rc1

This issue was fixed in the openstack/cinder 14.0.0.0rc1 release candidate.

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.