Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu_hz_current not available on NetBSD #2792

Closed
0-wiz-0 opened this issue May 19, 2024 · 4 comments
Closed

cpu_hz_current not available on NetBSD #2792

0-wiz-0 opened this issue May 19, 2024 · 4 comments

Comments

@0-wiz-0
Copy link

0-wiz-0 commented May 19, 2024

Describe the bug
I've tried updating the pkgsrc package for Glances to 4.0.5. It fails on startup.

To Reproduce
Start glances, see:

Traceback (most recent call last):
  File "/usr/pkg/bin/glances-3.12", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/glances/__init__.py", line 173, in main
    start(config=core.get_config(), args=core.get_args())
  File "/usr/pkg/lib/python3.12/site-packages/glances/__init__.py", line 121, in start
    mode.serve_forever()
  File "/usr/pkg/lib/python3.12/site-packages/glances/standalone.py", line 184, in serve_forever
    while self.__serve_once():
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/glances/standalone.py", line 156, in __serve_once
    ret = not self.screen.update(self.stats, duration=adapted_refresh)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/glances/outputs/glances_curses.py", line 1186, in update
    self.flush(stats, cs_status=cs_status)
  File "/usr/pkg/lib/python3.12/site-packages/glances/outputs/glances_curses.py", line 1167, in flush
    self.display(stats, cs_status=cs_status)
  File "/usr/pkg/lib/python3.12/site-packages/glances/outputs/glances_curses.py", line 658, in display
    self.__display_top(__stat_display, stats)
  File "/usr/pkg/lib/python3.12/site-packages/glances/outputs/glances_curses.py", line 825, in __display_top
    stat_display["quicklook"] = stats.get_plugin('quicklook').get_stats_display(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/glances/plugins/plugin/model.py", line 916, in get_stats_display
    ret = {'display': display_curse, 'msgdict': self.msg_curse(args, max_width=max_width), 'align': align_curse}
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/glances/plugins/quicklook/__init__.py", line 198, in msg_curse
    self._hz_to_ghz(self.stats['cpu_hz_current']), self._hz_to_ghz(self.stats['cpu_hz'])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pkg/lib/python3.12/site-packages/glances/plugins/quicklook/__init__.py", line 304, in _hz_to_ghz
    return hz / 1000000000.0
           ~~~^~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

Environement (please complete the following information)

  • Operating System (lsb_release -a or OS name/version): NetBSD 10.99.10/amd64
  • Glances & psutil versions: 4.0.5, psutil 5.9.8
  • How do you install Glances (Pypi package, script, package manager, source): I'm trying to update the pkgsrc package
  • Glances test (only available with Glances 3.1.7 or higher):
===============================================================================
Glances �[94m4.0.5�[0m (/usr/pkg/lib/python3.12/site-packages/glances/__init__.py)
Python �[94m3.12.3�[0m (/usr/pkg/bin/python3.12)
PsUtil �[94m5.9.8�[0m (/usr/pkg/lib/python3.12/site-packages/psutil/__init__.py)
===============================================================================
�[94malert         �[92m[OK]   �[94m 0.00001s 
�[0m[]�[0m
�[94mamps          �[92m[OK]   �[94m 0.00003s 
�[0m[]�[0m
�[94mcloud         �[92m[OK]   �[94m 0.00003s 
�[0m{}�[0m
�[94mconnections   �[92m[OK]   �[94m 0.00070s 
�[0m{'ESTABLISHED': 16,
 'LISTEN': 27,
 'SYN_RECV': 0,
 'SYN_SENT': 2,
 'initiated': 2,
 'net_connections_enabled': True,
 'nf_conntrack_enabled': False,
 'terminated': 2}�[0m
�[94mcontainers    �[92m[OK]   �[94m 0.00003s 
�[0m{}�[0m
�[94mcore          �[92m[OK]   �[94m 0.00001s 
�[0m{'log': 32, 'phys': None}�[0m
�[94mcpu           �[92m[OK]   �[94m 0.00016s 
�[0m{'cpucore': 32,
 'ctx_switches': 0,
 'ctx_switches_gauge': 4097818594,
 'idle': 99.8,
 'interrupts': 0,
 'interrupts_gauge': 1461388609,
 'irq': 0.0,
 'nice': 0.0,
 'soft_interrupts': 0,
 'soft_interrupts_gauge': 2461901955,
 'syscalls': 0,
 'syscalls_gauge': 4173595328,
 'system': 0.0,
 'time_since_update': 2.0160107612609863,
 'total': 0.0,
 'user': 0.1}�[0m
�[94mdiskio        �[92m[OK]   �[94m 0.00043s �[93mkey=disk_name �[0m
[{'disk_name': 'ld0',
  'key': 'disk_name',
  'read_bytes': 0,
  'read_bytes_gauge': 2212591237632,
  'read_count': 0,
  'read_count_gauge': 49868465,
  'time_since_update': 2.0260801315307617,
  'write_bytes': 0,
  'write_bytes_gauge': 2696534724608,
  'write_count': 0,
  'write_count_gauge': 76179873}, ...]�[0m
�[94mfolders       �[92m[OK]   �[94m 0.00001s 
�[0m[]�[0m
�[94mfs            �[92m[OK]   �[94m 0.00362s �[93mkey=mnt_point �[0m
[{'device_name': '/dev/dk1',
  'free': 573299527680,
  'fs_type': 'ffs',
  'key': 'mnt_point',
  'mnt_point': '/',
  'percent': 29.0,
  'size': 850163281920,
  'used': 234355593216}, ...]�[0m
�[94mgpu           �[92m[OK]   �[94m 0.00001s 
�[0m[]�[0m
�[94mhelp          �[92m[OK]   �[94m 0.00000s 
�[0mNone�[0m
�[94mip            �[92m[OK]   �[94m 0.00001s 
�[0m{}�[0m
�[94mirq           �[92m[OK]   �[94m 0.00001s 
�[0m[]�[0m
�[94mload          �[92m[OK]   �[94m 0.00001s 
�[0m{'cpucore': 32, 'min1': 0.005859375, 'min15': 0.14794921875, 'min5': 0.0791015625}�[0m
�[94mmem           �[92m[OK]   �[94m 0.00005s 
�[0m{'active': 108795240448,
 'available': 23609212928,
 'buffers': 5150003200,
 'cached': 108881412096,
 'free': 23609212928,
 'inactive': 44318720,
 'percent': 82.2,
 'shared': 0,
 'total': 132422701056,
 'used': 108813488128,
 'wired': 18247680}�[0m
�[94mmemswap       �[92m[OK]   �[94m 0.00002s 
�[0m{'free': 479523782144,
 'percent': 0.1,
 'sin': 0,
 'sout': 2300011905024,
 'time_since_update': 2.029528856277466,
 'total': 480118513152,
 'used': 594731008}�[0m
�[94mnetwork       �[92m[OK]   �[94m 0.00052s �[93mkey=interface_name �[0m
[{'alias': None,
  'bytes_all': 0,
  'bytes_all_gauge': 0,
  'bytes_all_rate_per_sec': 0.0,
  'bytes_recv': 0,
  'bytes_recv_gauge': 0,
  'bytes_recv_rate_per_sec': 0.0,
  'bytes_sent': 0,
  'bytes_sent_gauge': 0,
  'bytes_sent_rate_per_sec': 0.0,
  'interface_name': 'rge0',
  'key': 'interface_name',
  'speed': 0,
  'time_since_update': 2.013787031173706}, ...]�[0m
�[94mnow           �[92m[OK]   �[94m 0.00002s 
�[0m{'custom': '2024-05-19 14:20:27 CEST', 'iso': '2024-05-19T14:20:27+02:00'}�[0m
�[94mpercpu        �[92m[OK]   �[94m 0.00006s �[93mkey=cpu_number �[0m
[{'cpu_number': 0,
  'idle': 0.0,
  'irq': 0.0,
  'key': 'cpu_number',
  'nice': 0.0,
  'system': 0.0,
  'total': 100.0,
  'user': 0.0}, ...]�[0m
�[94mports         �[92m[OK]   �[94m 0.00007s 
�[0m[]�[0m
�[94mprocesscount  �[92m[OK]   �[94m 0.00293s 
�[0m{'pid_max': 0, 'running': 1, 'sleeping': 76, 'thread': 649, 'total': 77}�[0m
�[94mprocesslist   �[92m[OK]   �[94m 0.00004s 
�[0m[]�[0m
�[94mpsutilversion �[92m[OK]   �[94m 0.00001s 
�[0m'5.9.8'�[0m
�[94mquicklook     �[92m[OK]   �[94m 0.00011s 
�[0m{'cpu': 0.0,
 'cpu_hz': None,
 'cpu_hz_current': None,
 'cpu_log_core': 32,
 'cpu_name': 'AMD Ryzen 9 7950X 16-Core Processor',
 'cpu_phys_core': None,
 'load': 0.5,
 'mem': 82.2,
 'percpu': [{...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...},
            {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...}, {...},
            {...}, {...}],
 'swap': 0.1}�[0m
�[94mraid          �[92m[OK]   �[94m 0.00001s 
�[0m{}�[0m
�[94msensors       �[92m[OK]   �[94m 0.00000s 
�[0m[]�[0m
�[94msmart�[0m         [NA]�[0m�[0m
�[94msystem        �[92m[OK]   �[94m 0.00000s 
�[0m{'hostname': 'exadelic.gatalith.at',
 'hr_name': 'NetBSD 10.99.10 64bit',
 'os_name': 'NetBSD',
 'os_version': '10.99.10',
 'platform': '64bit'}�[0m
�[94muptime        �[92m[OK]   �[94m 0.00002s 
�[0m{'seconds': 1036073}�[0m
�[94mversion       �[92m[OK]   �[94m 0.00001s 
�[0m'4.0.5'�[0m
�[94mwifi          �[92m[OK]   �[94m 0.00001s 
�[0m[]�[0m
===============================================================================
Total time to update all stats: �[94m0.01006s�[0m
===============================================================================
@nicolargo
Copy link
Owner

Workaround (waiting for the fix): disable the quicklook plugin: (--disable-plugin quicklook).

@nicolargo nicolargo added this to the Glances 4.1.0 milestone May 25, 2024
@nicolargo nicolargo changed the title Glances 4.0.5 fails to start on NetBSD cpu_hz_current not available on NetBSD May 25, 2024
@nicolargo
Copy link
Owner

Should be corrected in the develop branch.

Please @0-wiz-0 can you test the develop branch ?

@nicolargo
Copy link
Owner

Will be released in Glances 4.0.7.

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jun 5, 2024

The 4.0.7 release works fine, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants