Project

General

Profile

Backport #37870

mgr/dashboard: (Mimic) UnboundLocalError: local variable 'mirror_mode' referenced before assignment

Added by Sebastian Wagner 6 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Target version:
Release:
mimic

Description

Extracting from https://github.com/rook/rook/issues/2404

[07/Jan/2019:06:27:21] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/jsontools.py", line 61, in json_handler
    value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib64/ceph/mgr/dashboard/controllers/summary.py", line 68, in __call__
    'rbd_mirroring': self._rbd_mirroring(),
  File "/usr/lib64/ceph/mgr/dashboard/controllers/summary.py", line 37, in _rbd_mirroring
    _, data = get_daemons_and_pools()
  File "/usr/lib64/ceph/mgr/dashboard/tools.py", line 212, in wrapper
    return rvc.run(fn, args, kwargs)
  File "/usr/lib64/ceph/mgr/dashboard/tools.py", line 194, in run
    raise self.exception
UnboundLocalError: local variable 'mirror_mode' referenced before assignment

and

Traceback (most recent call last):
  File "/usr/lib64/ceph/mgr/dashboard/controllers/rbd_mirroring.py", line 94, in get_pools
    mirror_mode = rbdctx.mirror_mode_get(ioctx)
  File "rbd.pyx", line 1195, in rbd.RBD.mirror_mode_get (/home/jenkins-build/build/workspace/ceph-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/13.2.2/rpm/el7/BUILD/ceph-13.2.2/build/src/pybind/rbd/pyrex/rbd.c:8543)
PermissionError: [errno 1] error getting mirror mode

Fix is most likely be a simple cherry-pick of this single line: https://github.com/ceph/ceph/commit/dc616c7d724a2580927ff8fb1fbc070d83dd67ef#diff-24e410817ffc0acf57da283811f4aa03R98

History

#1 Updated by Lenz Grimmer 6 months ago

  • Subject changed from Mimc dashboard: UnboundLocalError: local variable 'mirror_mode' referenced before assignment to mgr/dashboard: (Mimic) UnboundLocalError: local variable 'mirror_mode' referenced before assignment
  • Target version set to v13.2.5

#2 Updated by Sebastian Wagner 5 months ago

  • Pull request ID set to 26009

#3 Updated by Sebastian Wagner 5 months ago

  • Backport set to mimic

#4 Updated by Lenz Grimmer 5 months ago

  • Status changed from New to Need Review
  • Assignee set to Sebastian Wagner

#6 Updated by Nathan Cutler 5 months ago

  • Status changed from Need Review to Pending Backport

#7 Updated by Nathan Cutler 5 months ago

  • Copied to Backport #38210: mimic: mgr/dashboard: (Mimic) UnboundLocalError: local variable 'mirror_mode' referenced before assignment added

#8 Updated by Nathan Cutler 4 months ago

  • Tracker changed from Bug to Backport
  • Status changed from Pending Backport to Resolved
  • Release set to mimic

This was a mimic-only fix. The original PR mentioned above targets the mimic branch and will be included in 13.2.5.

#9 Updated by Nathan Cutler 4 months ago

  • Copied to deleted (Backport #38210: mimic: mgr/dashboard: (Mimic) UnboundLocalError: local variable 'mirror_mode' referenced before assignment)

Also available in: Atom PDF