Error with command iotop on CentOS
When using sudo iotop
(latest version 0.6-2.el7
) in a terminal in my newly installed CentOS 7.5, I get the following error message:
Traceback (most recent call last):
File "/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 620, in main
main_loop()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 610, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 508, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 501, in run_iotop_window
ui.run()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 155, in run
self.process_list.duration)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 434, in refresh_display
lines = self.get_data()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 415, in get_data
return list(map(format, processes))
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 388, in format
cmdline = p.get_cmdline()
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 292, in get_cmdline
proc_status = parse_proc_pid_status(self.pid)
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 196, in parse_proc_pid_status
key, value = line.split(':t', 1)
ValueError: need more than 1 value to unpack
Any idea how to fix this problem?
centos python iotop
add a comment |
When using sudo iotop
(latest version 0.6-2.el7
) in a terminal in my newly installed CentOS 7.5, I get the following error message:
Traceback (most recent call last):
File "/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 620, in main
main_loop()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 610, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 508, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 501, in run_iotop_window
ui.run()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 155, in run
self.process_list.duration)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 434, in refresh_display
lines = self.get_data()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 415, in get_data
return list(map(format, processes))
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 388, in format
cmdline = p.get_cmdline()
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 292, in get_cmdline
proc_status = parse_proc_pid_status(self.pid)
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 196, in parse_proc_pid_status
key, value = line.split(':t', 1)
ValueError: need more than 1 value to unpack
Any idea how to fix this problem?
centos python iotop
It works for me. uname: Linux 4.4.0-127-generic #153~14.04.1-Ubuntu iotop version: iotop 0.6 Phyton version /usr/bin/python2.7
– Marko
Sep 3 '18 at 19:20
add a comment |
When using sudo iotop
(latest version 0.6-2.el7
) in a terminal in my newly installed CentOS 7.5, I get the following error message:
Traceback (most recent call last):
File "/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 620, in main
main_loop()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 610, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 508, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 501, in run_iotop_window
ui.run()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 155, in run
self.process_list.duration)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 434, in refresh_display
lines = self.get_data()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 415, in get_data
return list(map(format, processes))
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 388, in format
cmdline = p.get_cmdline()
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 292, in get_cmdline
proc_status = parse_proc_pid_status(self.pid)
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 196, in parse_proc_pid_status
key, value = line.split(':t', 1)
ValueError: need more than 1 value to unpack
Any idea how to fix this problem?
centos python iotop
When using sudo iotop
(latest version 0.6-2.el7
) in a terminal in my newly installed CentOS 7.5, I get the following error message:
Traceback (most recent call last):
File "/sbin/iotop", line 17, in <module>
main()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 620, in main
main_loop()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 610, in <lambda>
main_loop = lambda: run_iotop(options)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 508, in run_iotop
return curses.wrapper(run_iotop_window, options)
File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 501, in run_iotop_window
ui.run()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 155, in run
self.process_list.duration)
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 434, in refresh_display
lines = self.get_data()
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 415, in get_data
return list(map(format, processes))
File "/usr/lib/python2.7/site-packages/iotop/ui.py", line 388, in format
cmdline = p.get_cmdline()
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 292, in get_cmdline
proc_status = parse_proc_pid_status(self.pid)
File "/usr/lib/python2.7/site-packages/iotop/data.py", line 196, in parse_proc_pid_status
key, value = line.split(':t', 1)
ValueError: need more than 1 value to unpack
Any idea how to fix this problem?
centos python iotop
centos python iotop
edited Jun 29 '18 at 9:49
F. Privé
asked May 29 '18 at 7:24
F. PrivéF. Privé
16816
16816
It works for me. uname: Linux 4.4.0-127-generic #153~14.04.1-Ubuntu iotop version: iotop 0.6 Phyton version /usr/bin/python2.7
– Marko
Sep 3 '18 at 19:20
add a comment |
It works for me. uname: Linux 4.4.0-127-generic #153~14.04.1-Ubuntu iotop version: iotop 0.6 Phyton version /usr/bin/python2.7
– Marko
Sep 3 '18 at 19:20
It works for me. uname: Linux 4.4.0-127-generic #153~14.04.1-Ubuntu iotop version: iotop 0.6 Phyton version /usr/bin/python2.7
– Marko
Sep 3 '18 at 19:20
It works for me. uname: Linux 4.4.0-127-generic #153~14.04.1-Ubuntu iotop version: iotop 0.6 Phyton version /usr/bin/python2.7
– Marko
Sep 3 '18 at 19:20
add a comment |
2 Answers
2
active
oldest
votes
Apparently, recent kernel versions introduced a blank line in /proc/(pid)/status
that iotop does not expect:
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp: 0
SpeculationStoreBypass: vulnerable
As a zeroth approximation of a fix, edit (as root) /usr/lib/python2.7/site-packages/iotop/data.py
ca l.195:
def parse_proc_pid_status(pid):
result_dict = {}
try:
for line in open('/proc/%d/status' % pid):
if not line.strip(): continue
key, value = line.split(':t', 1)
result_dict[key] = value.strip()
except IOError:
pass # No such process
return result_dict
where the if not line.strip(): continue
is new. Beware that python does not have explicit braces, so the indentation of this line should match that of the line below it.
(Also see https://bugs.launchpad.net/pkg-website/+bug/1773383 for other fixes for this bug.)
1
Here is a link to the CentOS bug covering this issue: bugs.centos.org/view.php?id=14864
– doshea
Jun 2 '18 at 6:06
Same for "Pympler" Python package. Line 147. Addif not entry.strip(): continue
before to solve that problem. pythonhosted.org/Pympler
– Eduardo Lucio
Jun 12 '18 at 18:02
add a comment |
Just to complement the accepted answer (couldn't add as comment because they don't allow multiple white spaces)
- Search for the filepath of the Python script
sudo find ./usr/lib | grep iotop/data.py
- Replace with sed
sed -i '1n;/key, value = line/i if not line.strip(): continue' <script_path>
Be careful and check everything is ok the first time you run it.
For my systems, it is:
sudo sed -i '1n;/key, value = line/i if not line.strip(): continue' /usr/lib/python2.7/dist-packages/iotop/data.py
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446624%2ferror-with-command-iotop-on-centos%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Apparently, recent kernel versions introduced a blank line in /proc/(pid)/status
that iotop does not expect:
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp: 0
SpeculationStoreBypass: vulnerable
As a zeroth approximation of a fix, edit (as root) /usr/lib/python2.7/site-packages/iotop/data.py
ca l.195:
def parse_proc_pid_status(pid):
result_dict = {}
try:
for line in open('/proc/%d/status' % pid):
if not line.strip(): continue
key, value = line.split(':t', 1)
result_dict[key] = value.strip()
except IOError:
pass # No such process
return result_dict
where the if not line.strip(): continue
is new. Beware that python does not have explicit braces, so the indentation of this line should match that of the line below it.
(Also see https://bugs.launchpad.net/pkg-website/+bug/1773383 for other fixes for this bug.)
1
Here is a link to the CentOS bug covering this issue: bugs.centos.org/view.php?id=14864
– doshea
Jun 2 '18 at 6:06
Same for "Pympler" Python package. Line 147. Addif not entry.strip(): continue
before to solve that problem. pythonhosted.org/Pympler
– Eduardo Lucio
Jun 12 '18 at 18:02
add a comment |
Apparently, recent kernel versions introduced a blank line in /proc/(pid)/status
that iotop does not expect:
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp: 0
SpeculationStoreBypass: vulnerable
As a zeroth approximation of a fix, edit (as root) /usr/lib/python2.7/site-packages/iotop/data.py
ca l.195:
def parse_proc_pid_status(pid):
result_dict = {}
try:
for line in open('/proc/%d/status' % pid):
if not line.strip(): continue
key, value = line.split(':t', 1)
result_dict[key] = value.strip()
except IOError:
pass # No such process
return result_dict
where the if not line.strip(): continue
is new. Beware that python does not have explicit braces, so the indentation of this line should match that of the line below it.
(Also see https://bugs.launchpad.net/pkg-website/+bug/1773383 for other fixes for this bug.)
1
Here is a link to the CentOS bug covering this issue: bugs.centos.org/view.php?id=14864
– doshea
Jun 2 '18 at 6:06
Same for "Pympler" Python package. Line 147. Addif not entry.strip(): continue
before to solve that problem. pythonhosted.org/Pympler
– Eduardo Lucio
Jun 12 '18 at 18:02
add a comment |
Apparently, recent kernel versions introduced a blank line in /proc/(pid)/status
that iotop does not expect:
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp: 0
SpeculationStoreBypass: vulnerable
As a zeroth approximation of a fix, edit (as root) /usr/lib/python2.7/site-packages/iotop/data.py
ca l.195:
def parse_proc_pid_status(pid):
result_dict = {}
try:
for line in open('/proc/%d/status' % pid):
if not line.strip(): continue
key, value = line.split(':t', 1)
result_dict[key] = value.strip()
except IOError:
pass # No such process
return result_dict
where the if not line.strip(): continue
is new. Beware that python does not have explicit braces, so the indentation of this line should match that of the line below it.
(Also see https://bugs.launchpad.net/pkg-website/+bug/1773383 for other fixes for this bug.)
Apparently, recent kernel versions introduced a blank line in /proc/(pid)/status
that iotop does not expect:
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp: 0
SpeculationStoreBypass: vulnerable
As a zeroth approximation of a fix, edit (as root) /usr/lib/python2.7/site-packages/iotop/data.py
ca l.195:
def parse_proc_pid_status(pid):
result_dict = {}
try:
for line in open('/proc/%d/status' % pid):
if not line.strip(): continue
key, value = line.split(':t', 1)
result_dict[key] = value.strip()
except IOError:
pass # No such process
return result_dict
where the if not line.strip(): continue
is new. Beware that python does not have explicit braces, so the indentation of this line should match that of the line below it.
(Also see https://bugs.launchpad.net/pkg-website/+bug/1773383 for other fixes for this bug.)
edited May 29 '18 at 8:54
answered May 29 '18 at 8:40
Ulrich SchwarzUlrich Schwarz
9,63512946
9,63512946
1
Here is a link to the CentOS bug covering this issue: bugs.centos.org/view.php?id=14864
– doshea
Jun 2 '18 at 6:06
Same for "Pympler" Python package. Line 147. Addif not entry.strip(): continue
before to solve that problem. pythonhosted.org/Pympler
– Eduardo Lucio
Jun 12 '18 at 18:02
add a comment |
1
Here is a link to the CentOS bug covering this issue: bugs.centos.org/view.php?id=14864
– doshea
Jun 2 '18 at 6:06
Same for "Pympler" Python package. Line 147. Addif not entry.strip(): continue
before to solve that problem. pythonhosted.org/Pympler
– Eduardo Lucio
Jun 12 '18 at 18:02
1
1
Here is a link to the CentOS bug covering this issue: bugs.centos.org/view.php?id=14864
– doshea
Jun 2 '18 at 6:06
Here is a link to the CentOS bug covering this issue: bugs.centos.org/view.php?id=14864
– doshea
Jun 2 '18 at 6:06
Same for "Pympler" Python package. Line 147. Add
if not entry.strip(): continue
before to solve that problem. pythonhosted.org/Pympler– Eduardo Lucio
Jun 12 '18 at 18:02
Same for "Pympler" Python package. Line 147. Add
if not entry.strip(): continue
before to solve that problem. pythonhosted.org/Pympler– Eduardo Lucio
Jun 12 '18 at 18:02
add a comment |
Just to complement the accepted answer (couldn't add as comment because they don't allow multiple white spaces)
- Search for the filepath of the Python script
sudo find ./usr/lib | grep iotop/data.py
- Replace with sed
sed -i '1n;/key, value = line/i if not line.strip(): continue' <script_path>
Be careful and check everything is ok the first time you run it.
For my systems, it is:
sudo sed -i '1n;/key, value = line/i if not line.strip(): continue' /usr/lib/python2.7/dist-packages/iotop/data.py
add a comment |
Just to complement the accepted answer (couldn't add as comment because they don't allow multiple white spaces)
- Search for the filepath of the Python script
sudo find ./usr/lib | grep iotop/data.py
- Replace with sed
sed -i '1n;/key, value = line/i if not line.strip(): continue' <script_path>
Be careful and check everything is ok the first time you run it.
For my systems, it is:
sudo sed -i '1n;/key, value = line/i if not line.strip(): continue' /usr/lib/python2.7/dist-packages/iotop/data.py
add a comment |
Just to complement the accepted answer (couldn't add as comment because they don't allow multiple white spaces)
- Search for the filepath of the Python script
sudo find ./usr/lib | grep iotop/data.py
- Replace with sed
sed -i '1n;/key, value = line/i if not line.strip(): continue' <script_path>
Be careful and check everything is ok the first time you run it.
For my systems, it is:
sudo sed -i '1n;/key, value = line/i if not line.strip(): continue' /usr/lib/python2.7/dist-packages/iotop/data.py
Just to complement the accepted answer (couldn't add as comment because they don't allow multiple white spaces)
- Search for the filepath of the Python script
sudo find ./usr/lib | grep iotop/data.py
- Replace with sed
sed -i '1n;/key, value = line/i if not line.strip(): continue' <script_path>
Be careful and check everything is ok the first time you run it.
For my systems, it is:
sudo sed -i '1n;/key, value = line/i if not line.strip(): continue' /usr/lib/python2.7/dist-packages/iotop/data.py
answered 20 mins ago
AFP_555AFP_555
1033
1033
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446624%2ferror-with-command-iotop-on-centos%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It works for me. uname: Linux 4.4.0-127-generic #153~14.04.1-Ubuntu iotop version: iotop 0.6 Phyton version /usr/bin/python2.7
– Marko
Sep 3 '18 at 19:20