Bug #61577
openCephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given
0%
Description
Per commands:
cd build
ninja vstart # builds just enough to run vstart
../src/vstart.sh --debug --new -x --localhost --bluestore
It loops on: "CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given".
Check log file: build/out/mgr.x.log
2023-06-02T22:40:03.421+0800 7f8f8e832640 20 mgr.server operator() health checks:
{
"MGR_MODULE_DEPENDENCY": {
"severity": "HEALTH_WARN",
"summary": {
"message": "12 mgr modules have failed dependencies",
"count": 12
},
"detail": [
{
"message": "Module 'balancer' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'crash' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'dashboard' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'devicehealth' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'iostat' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'nfs' has failed dependency: cannot import name 'TracingSpec' from 'ceph.deployment.service_spec' (/usr/lib/python3.10/site
-packages/ceph/deployment/service_spec.py)"
},
{
"message": "Module 'orchestrator' has failed dependency: cannot import name 'TracingSpec' from 'ceph.deployment.service_spec' (/usr/lib/python
3.10/site-packages/ceph/deployment/service_spec.py)"
},
{
"message": "Module 'pg_autoscaler' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'rbd_support' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'status' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'telemetry' has failed dependency: CephArgtype.to_argdesc() takes from 2 to 3 positional arguments but 4 were given"
},
{
"message": "Module 'volumes' has failed dependency: cannot import name 'TracingSpec' from 'ceph.deployment.service_spec' (/usr/lib/python3.10/
site-packages/ceph/deployment/service_spec.py)"
}
]
},
"TOO_FEW_OSDS": {
"severity": "HEALTH_WARN",
"summary": {
"message": "OSD count 0 < osd_pool_default_size 3",
"count": 3
},
"detail": []
}
}
However, checked on the function, it has 4 parameters.
@staticmethod
def to_argdesc(tp, attrs, has_default=False, positional=True):
if has_default:
attrs['req'] = 'false'
if not positional:
attrs['positional'] = 'false'
CEPH_ARG_TYPES = {
str: CephString,
int: CephInt,
float: CephFloat,
bool: CephBool
}
try:
return CEPH_ARG_TYPES[tp]().argdesc(attrs)
except KeyError:
if isinstance(tp, CephArgtype):
return tp.argdesc(attrs)
elif isinstance(tp, type) and issubclass(tp, enum.Enum):
return CephChoices(tp=tp).argdesc(attrs)
else:
return CephArgtype._compound_type_to_argdesc(tp, attrs, positional)
Updated by Ernesto Puerta 12 months ago
Some time ago it was decided to package and distribute some Python code as a stand-alone package (and that includes ceph_argparse.py). As packages installed in site-packages take precedence over local ones, this probably means that you have it probably installed in /usr/lib/python3.10/site-packages/ceph/, and that's an older version with the 2 to 3 args instead of 4.
This also happens a lot in Jenkins/CI environment, where many jobs run an older Ceph version and then leak dependencies, and next job will hit this very same issue.
We should be able to get rid of this issue by prepending the mgr path (or some custom devel path) to the internal ceph-mgr PYTHONPATH.
Updated by Ernesto Puerta 12 months ago
- Assignee set to Pere Díaz Bou
@Pere, as you're the one most familiar with the mgr PYTHONPATH, you should probably be able to quickly fix this. Thanks!
Updated by ZeGang Luo 12 months ago
Ernesto Puerta wrote:
Some time ago it was decided to package and distribute some Python code as a stand-alone package (and that includes ceph_argparse.py). As packages installed in site-packages take precedence over local ones, this probably means that you have it probably installed in /usr/lib/python3.10/site-packages/ceph/, and that's an older version with the 2 to 3 args instead of 4.
This also happens a lot in Jenkins/CI environment, where many jobs run an older Ceph version and then leak dependencies, and next job will hit this very same issue.
We should be able to get rid of this issue by prepending the mgr path (or some custom devel path) to the internal ceph-mgr PYTHONPATH.
It is exactly as it is. Great help. Thank you, @Ernesto.