LibreQoE / LibreQoS

A Quality of Experience and Smart Queue Management system for ISPs. Leverage CAKE to improve network responsiveness, enforce bandwidth plans, and reduce bufferbloat.
https://libreqos.io/
GNU General Public License v2.0
416 stars 47 forks source link

v1.5-beta: improvement of lqos_scheduler startup needed #512

Open interduo opened 3 months ago

interduo commented 3 months ago

Checking journal show that after reboot there lqos_scheduler tries to do too much before lqosd starts. Maybe we should just check if /run/lqos/bus is running if not just waiting sometime?

I attached segment of lqos_scheduler logfile bellow:

Jul 03 09:22:32 libreqos-beta systemd[1]: Started lqos_scheduler.service.
Jul 03 09:22:33 libreqos-beta python3[994]: thread '<unnamed>' panicked at lqos_python/src/lib.rs:263:70:
Jul 03 09:22:33 libreqos-beta python3[994]: called `Result::unwrap()` on an `Err` value: Socket (typically /run/lqos/bus) not found. Check that lqosd is running, and you ha>
Jul 03 09:22:33 libreqos-beta python3[994]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Jul 03 09:22:33 libreqos-beta python3[994]: Running Python Version 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0]
Jul 03 09:22:33 libreqos-beta python3[994]: refreshShapers starting at 03/07/2024 07:22:33
Jul 03 09:22:33 libreqos-beta python3[994]: First time run since system boot.
Jul 03 09:22:33 libreqos-beta python3[994]: Validating input files 'ShapedDevices.csv' and 'network.json'
Jul 03 09:22:34 libreqos-beta python3[994]: Traceback (most recent call last):
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/scheduler.py", line 62, in <module>
Jul 03 09:22:34 libreqos-beta python3[994]:     importAndShapeFullReload()
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/scheduler.py", line 55, in importAndShapeFullReload
Jul 03 09:22:34 libreqos-beta python3[994]:     refreshShapers()
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/LibreQoS.py", line 448, in refreshShapers
Jul 03 09:22:34 libreqos-beta python3[994]:     if (validateNetworkAndDevices() == True):
Jul 03 09:22:34 libreqos-beta python3[994]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/LibreQoS.py", line 130, in validateNetworkAndDevices
Jul 03 09:22:34 libreqos-beta python3[994]:     rustValid = validate_shaped_devices()
Jul 03 09:22:34 libreqos-beta python3[994]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 03 09:22:34 libreqos-beta python3[994]: pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: Socket (typically /run/lqos/bus) not found. Check that>
Jul 03 09:22:34 libreqos-beta systemd[1]: lqos_scheduler.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 09:22:34 libreqos-beta systemd[1]: lqos_scheduler.service: Failed with result 'exit-code'.
Jul 03 09:22:34 libreqos-beta systemd[1]: lqos_scheduler.service: Consumed 2.018s CPU time.
Jul 03 09:22:35 libreqos-beta systemd[1]: lqos_scheduler.service: Scheduled restart job, restart counter is at 1.
Jul 03 09:22:35 libreqos-beta systemd[1]: Started lqos_scheduler.service.
Jul 03 09:22:35 libreqos-beta python3[1434]: Not using LTS weights. Using weights from ShapedDevices.csv
Jul 03 09:22:33 libreqos-beta python3[994]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Jul 03 09:22:33 libreqos-beta python3[994]: Running Python Version 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0]
Jul 03 09:22:33 libreqos-beta python3[994]: refreshShapers starting at 03/07/2024 07:22:33
Jul 03 09:22:33 libreqos-beta python3[994]: First time run since system boot.
Jul 03 09:22:33 libreqos-beta python3[994]: Validating input files 'ShapedDevices.csv' and 'network.json'
Jul 03 09:22:34 libreqos-beta python3[994]: Traceback (most recent call last):
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/scheduler.py", line 62, in <module>
Jul 03 09:22:34 libreqos-beta python3[994]:     importAndShapeFullReload()
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/scheduler.py", line 55, in importAndShapeFullReload
Jul 03 09:22:34 libreqos-beta python3[994]:     refreshShapers()
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/LibreQoS.py", line 448, in refreshShapers
Jul 03 09:22:34 libreqos-beta python3[994]:     if (validateNetworkAndDevices() == True):
Jul 03 09:22:34 libreqos-beta python3[994]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 03 09:22:34 libreqos-beta python3[994]:   File "/opt/libreqos/src/LibreQoS.py", line 130, in validateNetworkAndDevices
Jul 03 09:22:34 libreqos-beta python3[994]:     rustValid = validate_shaped_devices()
Jul 03 09:22:34 libreqos-beta python3[994]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 03 09:22:34 libreqos-beta python3[994]: pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: Socket (typically /run/lqos/bus) not found. Check that