Project

General

Profile

Bug #47514

pybind: balancer show: AttributeError: 'Plan' object has no attribute 'show'

Added by Rene Moser over 3 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
balancer module
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
octopus, pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

ceph version 15.2.4 (7447c15c6ff58d7fce91843b705a268a1917325c) octopus (stable)

# ceph balancer optimize storage lab-volumes lab-images
# ceph balancer show storage
Error EINVAL: Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1167, in _handle_command
    return self.handle_command(inbuf, cmd)
  File "/usr/share/ceph/mgr/balancer/module.py", line 602, in handle_command
    return (0, plan.show(), '')
AttributeError: 'Plan' object has no attribute 'show'

Related issues

Copied to mgr - Backport #51484: pacific: pybind: balancer show: AttributeError: 'Plan' object has no attribute 'show' Resolved
Copied to mgr - Backport #51485: octopus: pybind: balancer show: AttributeError: 'Plan' object has no attribute 'show' Resolved

History

#1 Updated by Reed Dier over 3 years ago

Rene Moser wrote:

ceph version 15.2.4 (7447c15c6ff58d7fce91843b705a268a1917325c) octopus (stable)

[...]

Having the same issue, Ubuntu 18.04.

I've dug into this to see if I can find the culprit:
I tested on fresh single-node clusters with:
18.04 using ceph repos
20.04 using ceph repos
20.04 using ubuntu repos

The ceph repo files for /usr/share/ceph/mgr/mgr_module.py and /usr/share/ceph/mgr/balancer/module.py are identical, and the Ubuntu repos are different.

ca86b60ff0f873e6c3cdcca2eae37ebd  bionic_mgr_module.py
ca86b60ff0f873e6c3cdcca2eae37ebd  repo_mgr_module.py
08473e8d578ff16f83ac1e0594d71e8c  ubu_mgr_module.py
54bb102f9630b237a97e62355114446e  bionic_module.py
54bb102f9630b237a97e62355114446e  repo_module.py
86dc4fc4f7c850efb7d842806b0f466f  ubu_module.py
diff /tmp/ubu_module.py /tmp/repo_module.py
432c432
<         self.log.warn("Handling command: '%s'" % str(command))
---
>         self.log.warning("Handling command: '%s'" % str(command))
474c474
<             if pool_ids is '':
---
>             if pool_ids == '':
500c500
<             if existing is not '':
---
>             if existing != '':
508c508
<             if existing is '': # for idempotence
---
>             if existing == '': # for idempotence
668c668
<                 if allow is not '':
---
>                 if allow != '':
1101c1101
<             self.log.warn("Invalid crush_compat balancing key %s. Using 'pgs'." % key)
---
>             self.log.warning("Invalid crush_compat balancing key %s. Using 'pgs'." % key)
diff /tmp/ubu_mgr_module.py /tmp/repo_mgr_module.py
16a17
> from mgr_util import profile_method
17a19
> # Full list of strings in "osd_types.cc:pg_state_string()" 
48c50,55
<     "unknown"]
---
>     "unknown",
>     "premerge",
>     "failed_repair",
>     "laggy",
>     "wait",
> ]
98a106,108
> class MonCommandFailed(RuntimeError): pass
>
>
1053c1063
<     def get_metadata(self, svc_type, svc_id):
---
>     def get_metadata(self, svc_type, svc_id, default=None):
1066c1076,1079
<         return self._ceph_get_metadata(svc_type, svc_id)
---
>         metadata = self._ceph_get_metadata(svc_type, svc_id)
>         if metadata is None:
>             return default
>         return metadata
1080a1094,1104
>     def check_mon_command(self, cmd_dict: dict) -> HandleCommandResult:
>         """ 
>         Wrapper around :func:`~mgr_module.MgrModule.mon_command`, but raises,
>         if ``retval != 0``.
>         """ 
>
>         r = HandleCommandResult(*self.mon_command(cmd_dict))
>         if r.retval:
>             raise MonCommandFailed(f'{cmd_dict["prefix"]} failed: {r.stderr} retval: {r.retval}')
>         return r
>
1364a1389
>     @profile_method()
1389c1414
<                     self.log.warn("No perf counter schema for {0}.{1}".format(
---
>                     self.log.warning("No perf counter schema for {0}.{1}".format(

I was hoping that moving to 20.04 from 18.04 and python 3.6 to 3.8 would magically make this go away, but it doesn't look like that will be the case sadly.

For reference, I am using "bare metal" install, not cephadm/ceph-orch container based.

#2 Updated by Reed Dier over 3 years ago

Reed Dier wrote:

For reference, I am using "bare metal" install, not cephadm/ceph-orch container based.

I also want to be more clear, that neither the Ubuntu nor Ceph maintained packages work.
Below is output of trying to show the balancer output, first with 15.2.5-1focal from ceph repos on ubuntu-focal, then from latest ubuntu repos, 15.2.3-0ubuntu0.20.04.2, and is also the same Ubuntu 18.04 with package version 15.2.5-1bionic.

$ ceph -v ; ceph balancer optimize plan1 pool1 ; ceph balancer show plan1 ; md5sum /usr/share/ceph/mgr/mgr_module.py ; md5sum /usr/share/ceph/mgr/balancer/module.py
ceph version 15.2.5 (2c93eff00150f0cc5f106a559557a58d3d7b6f1f) octopus (stable)
Error EINVAL: Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1177, in _handle_command
    return self.handle_command(inbuf, cmd)
  File "/usr/share/ceph/mgr/balancer/module.py", line 602, in handle_command
    return (0, plan.show(), '')
AttributeError: 'Plan' object has no attribute 'show'
ca86b60ff0f873e6c3cdcca2eae37ebd  /usr/share/ceph/mgr/mgr_module.py
54bb102f9630b237a97e62355114446e  /usr/share/ceph/mgr/balancer/module.py

$ ceph -v ; ceph balancer optimize plan1 pool1 ; ceph balancer show plan1 ; md5sum /usr/share/ceph/mgr/mgr_module.py ; md5sum /usr/share/ceph/mgr/balancer/module.py
ceph version 15.2.3 (d289bbdec69ed7c1f516e0a093594580a76b78d0) octopus (stable)
Error EINVAL: Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1153, in _handle_command
    return self.handle_command(inbuf, cmd)
  File "/usr/share/ceph/mgr/balancer/module.py", line 602, in handle_command
    return (0, plan.show(), '')
AttributeError: 'Plan' object has no attribute 'show'

08473e8d578ff16f83ac1e0594d71e8c  /usr/share/ceph/mgr/mgr_module.py
86dc4fc4f7c850efb7d842806b0f466f  /usr/share/ceph/mgr/balancer/module.py

#3 Updated by Sebastian Wagner about 3 years ago

  • Project changed from Ceph to mgr
  • Category changed from ceph cli to balancer module

#4 Updated by Chris Palmer about 3 years ago

I'm getting an identical error to the first one listed in #2, except under Octopus 15.2.9 on Debian Buster (bare metal install). The md5sum for /usr/share/ceph/mgr/mgr_module.py is identical but for /usr/share/ceph/mgr/balancer/module.py is cd1fa26b515615ae07a9faa3561df56d.

#5 Updated by Jan-Philipp Litza over 2 years ago

I'm seeing the same thing, even for Pacific. But it's not caused by any packaging errors. The releases simply don't include the relevant commit from this PR (probably because it says it's about type annotations)

#6 Updated by Neha Ojha over 2 years ago

  • Status changed from New to Pending Backport
  • Backport set to octopus, pacific

#7 Updated by Backport Bot over 2 years ago

  • Copied to Backport #51484: pacific: pybind: balancer show: AttributeError: 'Plan' object has no attribute 'show' added

#8 Updated by Backport Bot over 2 years ago

  • Copied to Backport #51485: octopus: pybind: balancer show: AttributeError: 'Plan' object has no attribute 'show' added

#9 Updated by Cory Snyder over 2 years ago

  • Pull request ID set to 39295

#10 Updated by Loïc Dachary about 2 years ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Also available in: Atom PDF