Glances failed to start and some other issues - BSD
Hi Guys,
My glances failed to start. When I type "glances", nothing happens. BUT when I type the first Ctrl+C command, the glances open in my terminal.
The keys ESC ou "q" haven't any effect.
If I type Ctrl+c for the second time, glances screen dont close, but glances screen is refreshed.
If I want to close glances screen, I need to press Ctrl+c twice quickly.
The debug log shows error in docker. But FreeBSD does not use docker.
Do you have an idea?
Environment:
- OS: FreeBSD 13.1 p1
- Glances v3.2.7 with PsUtil v5.9.1
- Glances logs file:
2022-08-13 21:13:42,670 -- INFO -- Start Glances 3.2.7 2022-08-13 21:13:42,670 -- INFO -- CPython 3.9.13 (/usr/local/bin/python3.9) and psutil 5.9.1 detected 2022-08-13 21:13:42,698 -- INFO -- Start GlancesStandalone mode 2022-08-13 21:13:42,788 -- WARNING -- Error loading Docker deps Lib. Docker plugin is disabled (No module named 'docker') 2022-08-13 21:13:42,788 -- ERROR -- docker plugin - Can not connect to Docker (name 'docker' is not defined) 2022-08-13 21:13:42,790 -- WARNING -- Missing Python Lib (No module named 'py3nvml'), Nvidia GPU plugin is disabled 2022-08-13 21:13:42,792 -- WARNING -- Missing Python Lib (No module named 'netifaces'), IP plugin is disabled 2022-08-13 21:13:42,802 -- WARNING -- Sparklines module not found (No module named 'sparklines') 2022-08-13 21:13:42,803 -- WARNING -- Missing Python Lib (No module named 'pymdstat'), Raid plugin is disabled 2022-08-13 21:13:42,807 -- WARNING -- Missing Python Lib (No module named 'pySMART'), HDD Smart plugin is disabled 2022-08-13 21:13:42,809 -- WARNING -- Missing Python Lib (No module named 'wifi'), Wifi plugin is disabled 2022-08-13 21:13:42,809 -- WARNING -- Wifi lib is not compliant with Python 3, Wifi plugin is disabled 2022-08-13 21:13:49,508 -- INFO -- Glances stopped (key pressed: CTRL-C) 2022-08-13 21:13:49,508 -- ERROR -- Cannot grab HDD temperature (local variable 'data' referenced before assignment) 2022-08-13 21:13:52,103 -- INFO -- Glances stopped (key pressed: CTRL-C) 2022-08-13 21:13:57,979 -- INFO -- Start Glances 3.2.7 2022-08-13 21:13:57,980 -- INFO -- CPython 3.9.13 (/usr/local/bin/python3.9) and psutil 5.9.1 detected 2022-08-13 21:13:58,011 -- INFO -- Start GlancesStandalone mode 2022-08-13 21:13:58,152 -- WARNING -- Error loading Docker deps Lib. Docker plugin is disabled (No module named 'docker') 2022-08-13 21:13:58,157 -- ERROR -- docker plugin - Can not connect to Docker (name 'docker' is not defined) 2022-08-13 21:13:58,163 -- WARNING -- Missing Python Lib (No module named 'py3nvml'), Nvidia GPU plugin is disabled 2022-08-13 21:13:58,165 -- WARNING -- Missing Python Lib (No module named 'netifaces'), IP plugin is disabled 2022-08-13 21:13:58,181 -- WARNING -- Sparklines module not found (No module named 'sparklines') 2022-08-13 21:13:58,182 -- WARNING -- Missing Python Lib (No module named 'pymdstat'), Raid plugin is disabled 2022-08-13 21:13:58,186 -- WARNING -- Missing Python Lib (No module named 'pySMART'), HDD Smart plugin is disabled 2022-08-13 21:13:58,189 -- WARNING -- Missing Python Lib (No module named 'wifi'), Wifi plugin is disabled 2022-08-13 21:13:58,189 -- WARNING -- Wifi lib is not compliant with Python 3, Wifi plugin is disabled 2022-08-13 21:14:15,398 -- INFO -- Glances stopped (key pressed: CTRL-C) 2022-08-13 21:14:15,399 -- ERROR -- Cannot grab HDD temperature (local variable 'data' referenced before assignment) 2022-08-13 21:15:34,725 -- WARNING -- Update and export time higher than refresh_time. 2022-08-13 21:15:45,173 -- INFO -- Glances stopped (key pressed: CTRL-C) 2022-08-13 21:15:45,173 -- ERROR -- Cannot grab HDD temperature (local variable 'data' referenced before assignment) 2022-08-13 21:15:45,187 -- WARNING -- Update and export time higher than refresh_time. 2022-08-13 21:15:47,574 -- INFO -- Glances stopped (key pressed: CTRL-C)
- Glances test:
Glances 3.2.7 (/usr/local/lib/python3.9/site-packages/glances/init.py) Python 3.9.13 (/usr/local/bin/python3.9) PsUtil 5.9.1 (/usr/local/lib/python3.9/site-packages/psutil/init.py)
alert [OK] 0.00002s [] amps [OK] 0.00009s [] cloud [OK] 0.00006s {'ami-id': 'ami-06a3f5bb77ca2e28e', 'instance-id': 'i-0d6baac200ef5c291', 'instance-type': 't3.large', 'region': 'us-eas connections [OK] 0.00144s {'LISTEN': 32, 'ESTABLISHED': 32, 'SYN_SENT': 0, 'SYN_RECV': 0, 'initiated': 0, 'terminated': 0} core [OK] 0.00026s {'phys': None, 'log': 2} cpu [OK] 0.00028s {'total': 0.9, 'user': 0.3, 'nice': 0.0, 'system': 0.6, 'idle': 99.1, 'irq': 0.0, 'time_since_update': 3.069868326187134 diskio [OK] 0.00029s key=disk_name [{'time_since_update': 3.069929838180542, 'disk_name': 'nda0', 'read_count': 0, 'write_count': 234, 'read_ docker [OK] 0.00006s [] folders [OK] 0.00005s [] fs [OK] 0.00034s key=mnt_point [{'device_name': '/dev/gpt/rootfs', 'fs_type': 'ufs', 'mnt_point': '/', 'size': 103959703552, 'used': 3022 gpu [OK] 0.00004s [] help [OK] 0.00001s None ip [OK] 0.00005s {} irq [OK] 0.00004s [] load [OK] 0.00006s {'min1': 0.251953125, 'min5': 0.28271484375, 'min15': 0.2587890625, 'cpucore': 2} mem [OK] 0.01316s {'total': 8427450368, 'available': 6965321728, 'percent': 17.3, 'used': 1462128640, 'free': 6965321728, 'active': 466829 memswap [OK] 0.00017s {'total': 8589762560, 'used': 0, 'free': 8589762560, 'percent': 0.0, 'sin': 0, 'sout': 19434, 'time_since_update': 3.066 network [OK] 0.00028s key=interface_name [{'interface_name': 'ena0', 'alias': None, 'time_since_update': 3.0668017864227295, 'cumulative_rx': now [OK] 0.00002s 2022-08-13 21:50:30 UTC percpu [OK] 0.00038s key=cpu_number [{'key': 'cpu_number', 'cpu_number': 0, 'total': 0.8, 'user': 0.3, 'system': 0.5, 'idle': 99.2, 'nice': 0 ports [OK] 0.00052s [] processcount [OK] 0.01399s {'total': 92, 'running': 1, 'sleeping': 90, 'thread': 408, 'pid_max': 0} processlist [OK] 0.00017s key=pid [{'memory_percent': 0.40515523093021916, 'memory_info': pmem(rss=34144256, vms=57458688, text=4096, data=4096, s psutilversion [OK] 0.00006s (5, 9, 1) quicklook [OK] 0.01410s {'cpu': 0.9, 'percpu': [{'key': 'cpu_number', 'cpu_number': 0, 'total': 0.8, 'user': 0.3, 'system': 0.5, 'idle': 99.2, ' raid [OK] 0.00080s {} sensors [OK] 0.00011s [] smart [OK] 0.00040s {} system [OK] 0.00001s {'os_name': 'FreeBSD', 'hostname': 'apt322.org', 'platform': '64bit', 'os_version': '13.1-RELEASE-p1', 'hr_name': 'FreeB uptime [OK] 0.00038s {'seconds': 174554} wifi [OK] 0.00005s []
@devnull-hub-lab can you please run Glances in debug mode (-d) and paste/bin us the log file ?
Any other FreeBSD users with the same behavor ?
@nicolargo , thanks for your reply.
When I run $ glance -d, in my terminal, nothing happens. (The same occurs without -d). I wait 3 minutes, and nothing:

But debug log is generated: https://pastebin.com/SyDRgjdT
When I hit Ctrl+c, glance started on my terminal. Debug log is generated: https://pastebin.com/tBQ2Lu6w
If I hit Ctrl+c again, glances isn't stopped, but refreshed. Debug log: https://pastebin.com/PfhwNkS3
Hi @nicolargo
Some news! I trace system calls during glance execution.
The last system call was: __sysctl("hw.ncpu",2,0x8210b4884,0x8210b4878,0x0,0) = 0 (0x0) __sysctlbyname("dev.cpu.0.temperature",21,0x8210b4a6c,0x8210b4a58,0x0,0) ERR#2 'No such file or directory' __sysctlbyname("dev.cpu.1.temperature",21,0x8210b4a6c,0x8210b4a58,0x0,0) ERR#2 'No such file or directory'
I thought it was a problem with the temperature sensors. So, I disabled sensors plugin:
$ glances --disable-plugin sensors
And Glances runs perfectly fine! :)
The sensors are the cause of the problems. But why? Tomorrow I will do more tests.
@nicolargo
I found it. It is related to FreeBSD blackhole. But I cant identify relation between blackhole and sensors. My blackhole settings: net.inet.tcp.blackhole=2 net.inet.udp.blackhole=1
I found other issue (#1202) in 2017, with the same problem, possible related to PSUtil. Maybe can you insert another workaround, like commit 6300af0 ?
What is the best option?
@devnull-hub-lab as a workaround, ou can disable the sensor plugin with the --disable-plugins sensors option.
Hey guys! I have the same issue I've been fighting already a long time. FreeBSD 12.3
I also have following in my sysctl:
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
I can confirm glances --disable-plugin sensors indeed fixes the issue.
@nicolargo probably it's good to mention this behavior somewhere in wiki, so people aware what's going on
Thanks guys!