nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.32k stars 1.49k forks source link

Python error after upgrading from 2.5.1 to 2.6 #813

Closed rmenessec closed 8 years ago

rmenessec commented 8 years ago
localhost ~ [0]# glances
Traceback (most recent call last):
  File "/usr/local/bin/glances", line 9, in <module>
    load_entry_point('Glances==2.6', 'console_scripts', 'glances')()
  File "/usr/local/lib/python3.4/dist-packages/glances/__init__.py", line 133, in main
    standalone.serve_forever()
  File "/usr/local/lib/python3.4/dist-packages/glances/standalone.py", line 107, in serve_forever
    return self.__serve_forever()
  File "/usr/local/lib/python3.4/dist-packages/glances/standalone.py", line 92, in __serve_forever
    self.screen.update(self.stats)
  File "/usr/local/lib/python3.4/dist-packages/glances/outputs/glances_curses.py", line 975, in update
    self.flush(stats, cs_status=cs_status)
  File "/usr/local/lib/python3.4/dist-packages/glances/outputs/glances_curses.py", line 953, in flush
    self.display(stats, cs_status=cs_status)
  File "/usr/local/lib/python3.4/dist-packages/glances/outputs/glances_curses.py", line 530, in display
    'sensors').get_stats_display(args=self.args)
  File "/usr/local/lib/python3.4/dist-packages/glances/plugins/glances_plugin.py", line 555, in get_stats_display
    'msgdict': self.msg_curse(args),
  File "/usr/local/lib/python3.4/dist-packages/glances/plugins/glances_sensors.py", line 206, in msg_curse
    msg = '{0:>7.0f}{1}'.format(value, unit)
TypeError: non-empty format string passed to object.__format__
localhost ~ [1]# alias glances
alias glances='glances -1 -b -t 1'

Failing on one machine, but not the second one I upgraded. Both machines are running Ubuntu 15.10. The machine where it fails has AuFS and bind mounts. Both machines have the same /etc/glances/glances.conf:

[diskio]
hide=ram0,ram1,ram2,ram3,ram4,ram5,ram6,ram7,ram8,ram9,ram10,ram11,ram12,ram13,ram14,ram15

Removing glances.conf or the alias has no effect. Works again after downgrading back to 2.5.1.

nicolargo commented 8 years ago

@rmenessec The error is on the sensor plugin. As a workaround. Can you try to run Glances 2.6 with the --disable-sensors options?

@asergi Perhaps a issue following the implementation of compat.py script ? Can you have a look, we can schedule an hotfix (version 2.6.1) if the bug is confirmed.

dbarboza commented 8 years ago

Also getting this on upgrade from 2.5.1 to 2.6. Web view works, --disable-sensors works in console, as does running on a VM (no sensors). I tried hiding specific sensors in glances.conf but that does not seem to be functional - they still show up in web view. My output from sensors: coretemp-isa-0000 Adapter: ISA adapter Physical id 0: +50.0°C (high = +80.0°C, crit = +100.0°C) Core 0: +50.0°C (high = +80.0°C, crit = +100.0°C) Core 1: +46.0°C (high = +80.0°C, crit = +100.0°C) Core 2: +49.0°C (high = +80.0°C, crit = +100.0°C) Core 3: +46.0°C (high = +80.0°C, crit = +100.0°C)

nct6776-isa-0290 Adapter: ISA adapter Vcore: +0.87 V (min = +0.00 V, max = +1.74 V) in1: +1.84 V (min = +0.00 V, max = +0.00 V) ALARM AVCC: +3.30 V (min = +2.98 V, max = +3.63 V) +3.3V: +3.30 V (min = +2.98 V, max = +3.63 V) in4: +1.02 V (min = +0.00 V, max = +0.00 V) ALARM in5: +1.70 V (min = +0.00 V, max = +0.00 V) ALARM in6: +0.82 V (min = +0.00 V, max = +0.00 V) ALARM 3VSB: +3.44 V (min = +2.98 V, max = +3.63 V) Vbat: +3.28 V (min = +2.70 V, max = +3.63 V) fan1: 2928 RPM (min = 0 RPM) fan2: 1016 RPM (min = 0 RPM) fan3: 0 RPM (min = 0 RPM) fan4: 0 RPM (min = 0 RPM) fan5: 0 RPM (min = 0 RPM) SYSTIN: +41.0°C (high = +0.0°C, hyst = +0.0°C) ALARM sensor = thermistor CPUTIN: +43.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor AUXTIN: +35.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermistor PECI Agent 0: +51.0°C (high = +80.0°C, hyst = +75.0°C) (crit = +100.0°C) PCH_CHIP_TEMP: +0.0°C
PCH_CPU_TEMP: +0.0°C
PCH_MCH_TEMP: +0.0°C
intrusion0: ALARM intrusion1: ALARM beep_enable: disabled

radeon-pci-0100 Adapter: PCI adapter temp1: +50.0°C (crit = +120.0°C, hyst = +90.0°C)

Python is 2.7.6. Ubuntu 14.04, kernel 4.2.

On Ubuntu 16.04 on a Lenovo T440p, glances works in console with sensors enabled, with python 2.7.11.

rmenessec commented 8 years ago

@nicolargo , that worked. I'm using glances in console-only mode.

nicolargo commented 8 years ago

@rmenessec i just add a workaround in the DEVELOP branch, can you test it ?

rmenessec commented 8 years ago

@nicolargo , seems to work.

I'm finding that glances.conf is mostly undocumented. Should I open a separate bug for documentation?

nicolargo commented 8 years ago

@rmenessec Most of the specific configuration file documentation is in the Anatomy of the application chapter: http://glances.readthedocs.org/en/latest/aoa/index.html

Feel free to open an issue and propose improvement for it.