Project

General

Profile

Actions

Bug #55117

closed

`cephadm unit status` prints backtrace if service is stopped

Added by Moritz Roehrich about 2 years ago. Updated almost 2 years ago.

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

0%

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

Description

Tested on: v16.2.7.558

```
node1:~ # cephadm unit stop --name osd.5
Inferring fsid a513cede-9c55-11ec-9477-52540073e111
node1:~ # cephadm unit status --name osd.5
Inferring fsid a513cede-9c55-11ec-9477-52540073e111
- Ceph osd.5 for a513cede-9c55-11ec-9477-52540073e111
Loaded: loaded (/etc/systemd/system/ceph-a513cede-9c55-11ec-9477-52540073e111@.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Sat 2022-03-05 09:19:51 CET; 5s ago
Process: 49884 ExecStartPre=/bin/rm -f (code=exited, status=0/SUCCESS)
Process: 49885 ExecStart=/bin/bash /var/lib/ceph/a513cede-9c55-11ec-9477-52540073e111/osd.5/unit.run (code=exited, status=0/SUCCESS)
Process: 58151 ExecStop=/bin/bash -c /usr/bin/podman stop ceph-a513cede-9c55-11ec-9477-52540073e111-osd.5 ; bash /var/lib/ceph/a513cede-9c55-11ec-9477-52540073e111/osd.5/unit.stop (code=exited, status=0/SUCCESS)
Process: 58298 ExecStopPost=/bin/bash /var/lib/ceph/a513cede-9c55-11ec-9477-52540073e111/osd.5/unit.poststop (code=exited, status=0/SUCCESS)
Process: 58520 ExecStopPost=/bin/rm -f (code=exited, status=0/SUCCESS)
Main PID: 50273 (code=exited, status=0/SUCCESS)
...
Traceback (most recent call last):
File "/usr/sbin/cephadm", line 8859, in <module>
main()
File "/usr/sbin/cephadm", line 8847, in main
r = ctx.func(ctx)
File "/usr/sbin/cephadm", line 1888, in _infer_config
return func(ctx)
File "/usr/sbin/cephadm", line 1858, in _infer_fsid
return func(ctx)
File "/usr/sbin/cephadm", line 5104, in command_unit
desc=''
File "/usr/sbin/cephadm", line 1618, in call_throws
raise RuntimeError('Failed command: %s' % ' '.join(command))
RuntimeError: Failed command: systemctl status
```

So, `systemctl status` returns a non zero status (because the service is not running), which I assume is expected behavior.

It would be good if cephadm does not treat is as a RuntimeError, as it makes output confusing.

Actions #1

Updated by Michael Fritch about 2 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 45765
Actions #2

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Status changed from Fix Under Review to Pending Backport

Do we need to backport this fix?

Actions #3

Updated by Moritz Roehrich almost 2 years ago

It's fixed in master. But as far as I can tell it's not in quincy or older releases. It would probably be a good idea to backport it to quincy and pacific. I'd be happy to do it, help me by outlining roughly what needs to be done?

Actions #4

Updated by Redouane Kachach Elhichou almost 2 years ago

Thanks, after some checks it seems this PR is already included into Quincy backport https://github.com/ceph/ceph/pull/46055.

Actions #5

Updated by Moritz Roehrich almost 2 years ago

That sounds great.
I'd really like to see it be backported to pacific too if possible. Is there going to be a batch backport to pacific too or should I create a separate PR for that. If there is a batch backport, how can I make sure this change will be picked up.

Actions #6

Updated by Adam King almost 2 years ago

  • Tags set to pacific,quincy
Actions #7

Updated by Redouane Kachach Elhichou almost 2 years ago

Thanks Moritz, there are already plans to backport the change to pacific as well so just stay tuned for it.

Actions #8

Updated by Redouane Kachach Elhichou almost 2 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF