mesosphere-backup / mesos-cli

This project has been deprecated. Please use the DC/OS CLI.

Home Page:https://github.com/mesosphere/dcos-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mesos ps throws IndexError: list index out of range

guenter opened this issue · comments

root@srv3-em2deimos:/home/support# mesos config master zk://10.240.50.239:2181,10.240.169.142:2181,10.240.129.141:2181/mesos
root@srv3-em2deimos:/home/support# mesos ps
Traceback (most recent call last):
  File "/usr/local/bin/mesos-ps", line 9, in <module>
    load_entry_point('mesos.cli==0.1.1', 'console_scripts', 'mesos-ps')()
  File "/usr/local/lib/python2.7/dist-packages/mesos/cli/cli.py", line 60, in wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mesos/cli/cmds/ps.py", line 82, in main
    tb.add_row([fn(task) for fn in table_generator.values()])
  File "/usr/local/lib/python2.7/dist-packages/mesos/cli/cmds/ps.py", line 54, in <lambda>
    ("time", lambda x: x.cpu_time),
  File "/usr/local/lib/python2.7/dist-packages/mesos/cli/task.py", line 75, in cpu_time
    st = self.stats
  File "/usr/local/lib/python2.7/dist-packages/mesos/cli/task.py", line 69, in stats
    return self.slave.task_stats(self["id"])
  File "/usr/local/lib/python2.7/dist-packages/mesos/cli/slave.py", line 98, in task_stats
    ))[0]["statistics"]
IndexError: list index out of range

I'm seeing this too:

(mesos-cli)[benh@tw-mbp13-bhindman ~]$ mesos ps
===>You have no tasks for that filter<===
(mesos-cli)[benh@tw-mbp13-bhindman ~]$ mesos ps -i
Traceback (most recent call last):
  File "/Users/benh/mesos-cli/bin/mesos-ps", line 11, in <module>
    sys.exit(main())
  File "/Users/benh/mesos-cli/lib/python2.7/site-packages/mesos/cli/cli.py", line 60, in wrapper
    return fn(*args, **kwargs)
  File "/Users/benh/mesos-cli/lib/python2.7/site-packages/mesos/cli/cmds/ps.py", line 82, in main
    tb.add_row([fn(task) for fn in table_generator.values()])
  File "/Users/benh/mesos-cli/lib/python2.7/site-packages/mesos/cli/cmds/ps.py", line 54, in <lambda>
    ("time", lambda x: x.cpu_time),
  File "/Users/benh/mesos-cli/lib/python2.7/site-packages/mesos/cli/task.py", line 75, in cpu_time
    st = self.stats
  File "/Users/benh/mesos-cli/lib/python2.7/site-packages/mesos/cli/task.py", line 69, in stats
    return self.slave.task_stats(self["id"])
  File "/Users/benh/mesos-cli/lib/python2.7/site-packages/mesos/cli/slave.py", line 98, in task_stats
    ))[0]["statistics"]
IndexError: list index out of range

Hmmm, I need a debug command that saves the responses. In the mean time, I'll get that protected so that it doesn't explode.

If I remember correctly, you get this when a task has not reached the RUNNING state, yet.

@StephanErb I bet you're exactly right, I just recently made tasks not in running yet get included in that list (speeds up time to tail). Thanks!