suzieq icon indicating copy to clipboard operation
suzieq copied to clipboard

[Bug]: sq-poller failed to run on MacOS in Docker

Open greenfox878 opened this issue 8 months ago • 5 comments

Suzieq version

0.23.0

Install Type

container

Python version

whatever is bundled with your container

Impacted component

sq-poller

Steps to Reproduce

docker run -it -v ./parquet-db:/home/suzieq/parquet -v ./suzieq-cfg.yml:/home/suzieq/.suzieq/suzieq-cfg.yml --name sq-poller netenglabs/suzieq:0.23.0
suzieq@40e46586b5f9:~$ sq-poller -I /home/suzieq/.suzieq/suzieq-cfg.yml

Expected Behavior

sq-poller run w/o crash

Observed Behavior

sq-poller crashed with the error:

2024-06-01 15:48:55,445 - suzieq.poller.controller - WARNING - log level INFO
2024-06-01 15:48:55,446 - suzieq.poller.controller - CRITICAL - 'NoneType' object has no attribute 'min'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/suzieq/poller/sq_poller.py", line 50, in start_controller
    log_suzieq_info('Poller Controller', logger, show_more=True)
  File "/usr/local/lib/python3.8/site-packages/suzieq/shared/utils.py", line 1213, in log_suzieq_info
    cpu_info += f'freq. {cpu_freq.min:.2f}Mhz - {cpu_freq.max:.2f}Mhz'
AttributeError: 'NoneType' object has no attribute 'min'

Screenshots

Additional Context

Actually, it is not an suzieq bug, but psutil bug [macOS] cpu_freq() fails on arm64 The issue appears inside docker container even on latest psutil version:

suzieq@5ac8068b56c0:~$ pip freeze | grep psu
psutil==5.9.8
suzieq@5ac8068b56c0:~$ ipython
Python 3.8.14 (default, Oct  5 2022, 11:57:30)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import psutil
In [2]: psutil.cpu_freq()
In [3]: exit
suzieq@5ac8068b56c0:~$ python -V
Python 3.8.14
suzieq@5ac8068b56c0:~$

greenfox878 avatar Jun 01 '24 15:06 greenfox878