Bug #40781
closedceph-crash crashes: 'memoryview: a bytes-like object is required'
Description
To avoid the bug below in ceph-crash, change line 35 in /usr/bin/ceph-crash from:
- f = open(os.path.join(path, 'meta'), 'r')
to
+ f = open(os.path.join(path, 'meta'), 'rb')
in ceph -v
ceph version 14.2.1 (d555a9489eb35f84f2e1ef49b77e19da9d113972) nautilus (stable)
Jul 15 08:08:14 nocsupport4 systemd1: Started Ceph crash dump collector.
Jul 15 08:08:14 nocsupport4 ceph-crash1260: INFO:__main__:monitoring path /var/lib/ceph/crash, delay 600s
Jul 15 08:08:15 nocsupport4 ceph-crash1260: Traceback (most recent call last):
Jul 15 08:08:15 nocsupport4 ceph-crash1260: File "/usr/bin/ceph-crash", line 83, in <module>
Jul 15 08:08:15 nocsupport4 ceph-crash1260: main()
Jul 15 08:08:15 nocsupport4 ceph-crash1260: File "/usr/bin/ceph-crash", line 76, in main
Jul 15 08:08:15 nocsupport4 ceph-crash1260: scrape_path(args.path)
Jul 15 08:08:15 nocsupport4 ceph-crash1260: File "/usr/bin/ceph-crash", line 57, in scrape_path
Jul 15 08:08:15 nocsupport4 ceph-crash1260: rc = post_crash(crashpath)
Jul 15 08:08:15 nocsupport4 ceph-crash1260: File "/usr/bin/ceph-crash", line 36, in post_crash
Jul 15 08:08:15 nocsupport4 ceph-crash1260: stdout, stderr = pr.communicate(input=f.read())
Jul 15 08:08:15 nocsupport4 ceph-crash1260: File "/usr/lib/python3.7/subprocess.py", line 939, in communicate
Jul 15 08:08:15 nocsupport4 ceph-crash1260: stdout, stderr = self._communicate(input, endtime, timeout)
Jul 15 08:08:15 nocsupport4 ceph-crash1260: File "/usr/lib/python3.7/subprocess.py", line 1666, in _communicate
Jul 15 08:08:15 nocsupport4 ceph-crash1260: input_view = memoryview(self._input)
Jul 15 08:08:15 nocsupport4 ceph-crash1260: TypeError: memoryview: a bytes-like object is required, not 'str'
Jul 15 08:08:15 nocsupport4 systemd1: ceph-crash.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 08:08:15 nocsupport4 systemd1: ceph-crash.service: Failed with result 'exit-code'.
Updated by Dan Mick almost 5 years ago
- Status changed from New to 12
python3 I assume. Looks right to me.
Updated by Dan Mick almost 5 years ago
- Status changed from 12 to Fix Under Review
Updated by Kefu Chai over 4 years ago
- Status changed from Fix Under Review to Pending Backport
Updated by Nathan Cutler over 4 years ago
- Copied to Backport #40946: nautilus: ceph-crash crashes: 'memoryview: a bytes-like object is required' added
Updated by Nathan Cutler over 4 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".