Hello, System: 11.0-STABLE r317528 After update from py27-glances-2.8.1 to py27-glances-2.8.8: # glances Traceback (most recent call last): File "/usr/local/bin/glances", line 11, in <module> load_entry_point('Glances==2.8.8', 'console_scripts', 'glances')() File "/usr/local/lib/python2.7/site-packages/glances/__init__.py", line 225, in main start_standalone(config=config, args=args) File "/usr/local/lib/python2.7/site-packages/glances/__init__.py", line 105, in start_standalone standalone = GlancesStandalone(config=config, args=args) File "/usr/local/lib/python2.7/site-packages/glances/standalone.py", line 43, in __init__ self.stats = GlancesStats(config=config, args=args) File "/usr/local/lib/python2.7/site-packages/glances/stats.py", line 43, in __init__ self.load_modules(self.args) File "/usr/local/lib/python2.7/site-packages/glances/stats.py", line 77, in load_modules self.load_plugins(args=args) File "/usr/local/lib/python2.7/site-packages/glances/stats.py", line 96, in load_plugins plugin = __import__(os.path.basename(item)[:-3]) File "/usr/local/lib/python2.7/site-packages/glances/plugins/glances_batpercent.py", line 38, in <module> psutil.sensors_battery() File "/usr/local/lib/python2.7/site-packages/psutil/__init__.py", line 2263, in sensors_battery return _psplatform.sensors_battery() File "/usr/local/lib/python2.7/site-packages/psutil/_psbsd.py", line 411, in sensors_battery percent, minsleft, power_plugged = cext.sensors_battery() OSError: [Errno 2] No such file or directory I've tested update on several servers. Result is the same.
I can't reproduce this problem, Which version of psutil do you have? This is mine > $ glances --version Glances v2.8.8 with psutil v5.0.1
Same error. Seem glances does not recognize if no battery sensor is there.
I am tried 2.9.1. It provides a correct ErrorMessage and does not segfault.
(In reply to Gasol Wu from comment #1) > Which version of psutil do you have? I use glances with recent version of psutil from ports: 5.2.2
(Segfault was wrong). 2.9.1 states: Error while initializing the batpercent plugin ([Errno 2] No such file or directory) Error while initializing the sensors plugin ([Errno 2] No such file or directory) and starts normal and as expected.
https://github.com/nicolargo/glances/issues/1051 Seems like this issue, fixed in 2.9.1. I will submit update PR soon.
here is patch for 2.9.1 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219129
(In reply to Gasol Wu from comment #7) I just tested 2.9.1. It starts and works fine. But it says at start: Error while initializing the sensors plugin ([Errno 2] No such file or directory) Error while initializing the batpercent plugin ([Errno 2] No such file or directory
work/glances-2.9.1/glances/plugins/glances_sensors.py: 234 except OSError as e: 235 # FreeBSD: If oid 'hw.acpi.battery' not present, Glances wont start #1055 236 logger.error("Can not grab temperatures sensors ({})".format(e))
What output generate by command `cat /tmp/glances-${USER}.log`?
(In reply to Gasol Wu from comment #10) 2017-05-08 08:07:12,404 -- INFO -- Start Glances 2.9.1 2017-05-08 08:07:12,404 -- INFO -- CPython 2.7.13 and PSutil 5.2.2 detected 2017-05-08 08:07:12,416 -- INFO -- Start GlancesStandalone mode 2017-05-08 08:07:12,420 -- CRITICAL -- Error while initializing the sensors plugin ([Errno 2] No such file or directory) 2017-05-08 08:07:12,421 -- ERROR -- Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/glances/stats.py", line 100, in _load_plugin plugin = __import__(plugin_script[:-3]) File "/usr/local/lib/python2.7/site-packages/glances/plugins/glances_sensors.py", line 26, in <module> from glances.plugins.glances_batpercent import Plugin as BatPercentPlugin File "/usr/local/lib/python2.7/site-packages/glances/plugins/glances_batpercent.py", line 38, in <module> psutil.sensors_battery() File "/usr/local/lib/python2.7/site-packages/psutil/__init__.py", line 2263, in sensors_battery return _psplatform.sensors_battery() File "/usr/local/lib/python2.7/site-packages/psutil/_psbsd.py", line 411, in sensors_battery percent, minsleft, power_plugged = cext.sensors_battery() OSError: [Errno 2] No such file or directory 2017-05-08 08:07:12,421 -- CRITICAL -- Error while initializing the batpercent plugin ([Errno 2] No such file or directory) 2017-05-08 08:07:12,421 -- ERROR -- Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/glances/stats.py", line 100, in _load_plugin plugin = __import__(plugin_script[:-3]) File "/usr/local/lib/python2.7/site-packages/glances/plugins/glances_batpercent.py", line 38, in <module> psutil.sensors_battery() File "/usr/local/lib/python2.7/site-packages/psutil/__init__.py", line 2263, in sensors_battery return _psplatform.sensors_battery() File "/usr/local/lib/python2.7/site-packages/psutil/_psbsd.py", line 411, in sensors_battery percent, minsleft, power_plugged = cext.sensors_battery() OSError: [Errno 2] No such file or directory 2017-05-08 08:07:57,029 -- INFO -- Stop Glances
Related changes: https://github.com/giampaolo/psutil/compare/release-5.0.0...release-5.2.2#diff-dabf94c696c08b27cf46a08fdff4adf2R1004 Related issues: https://github.com/giampaolo/psutil/issues/966 It seems like plugins sensors_battery is not support on your system. With glances 2.9.1, It will start normally but generate some warnings like this, It should be ok.
Is this PR still relevant? Current version 2.11.1 --> ports r449629
Compiles fine on 10.3.
(In reply to Danilo G. Baio from comment #13) No further feedback. So I close it as solved. If there still problems, please reopen.