Skip to content

[Proxmox] system.get_hardware_info() fails #271

@rootzoll

Description

@rootzoll

Describe the bug

When running on Proxmox the API seems to run into problems gathering hardware information and throws exceptions - for a v1.11.3 RaspiBlitz the plan is to better support VM setups. At least such errors should be catched to not throw errors in logs for now and return zero values on CPU, temp, etc

*** LAST BLITZAPI LOGS ***
sudo journalctl -u blitzapi -b --no-pager -n20
Feb 20 15:* BTCNode python[26433]: 2024-02-20 15:11:04 | ℹ️ | logging.py:87 | Uvicorn running on http://*.*.*.*:11111 (Press CTRL+C to quit)
Feb 20 15:* BTCNode python[26433]: 2024-02-20 15:11:04 | ⚠️ | utils.py:69 | Key 'system_ram_mb' not found in Redis DB.
Feb 20 15:* BTCNode python[26433]: Task exception was never retrieved
Feb 20 15:* BTCNode python[26433]: future: <Task finished name='Task-8' coro=<_handle_gather_hardware_info() done, defined at /home/blitzapi/blitz_api/app/system/service.py:99> exception=ValueError("invalid literal for int() with base 10: ''")>
Feb 20 15:* BTCNode python[26433]: Traceback (most recent call last):
Feb 20 15:* BTCNode python[26433]:   File "/home/blitzapi/blitz_api/app/system/service.py", line 102, in _handle_gather_hardware_info
Feb 20 15:* BTCNode python[26433]:     info = await get_hardware_info()
Feb 20 15:* BTCNode python[26433]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 20 15:* BTCNode python[26433]:   File "/home/blitzapi/blitz_api/app/system/service.py", line 51, in get_hardware_info
Feb 20 15:* BTCNode python[26433]:     return await system.get_hardware_info()
Feb 20 15:* BTCNode python[26433]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 20 15:* BTCNode python[26433]:   File "/home/blitzapi/blitz_api/app/system/impl/raspiblitz.py", line 308, in get_hardware_info
Feb 20 15:* BTCNode python[26433]:     info["vram_total_bytes"] = int(await redis_get("system_ram_mb")) * 1000 * 1000
Feb 20 15:* BTCNode python[26433]:                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 20 15:* BTCNode python[26433]: ValueError: invalid literal for int() with base 10: ''
Feb 20 15:* BTCNode python[26433]: 2024-02-20 15:11:04 | ✔️ | service.py:39 | Bitcoin repository initialized
Feb 20 15:* BTCNode python[26433]: 2024-02-20 15:11:07 | ✔️ | lnd_grpc.py:285 | Initialization complete.
Feb 20 15:* BTCNode python[26433]: 2024-02-20 15:11:55 | ℹ️ | logging.py:87 | *.*.*.*:45220 - "GET /v1/setup/status HTTP/1.0" 404
Feb 20 15:* BTCNode python[26433]: 2024-02-20 15:11:58 | ℹ️ | logging.py:87 | *.*.*.*:45222 - "POST /v1/system/login HTTP/1.0" 404
Feb 20 15:* BTCNode python[26433]: 2024-02-20 15:12:03 | ℹ️ | logging.py:87 | *.*.*.*:36136 - "POST /v1/system/login HTTP/1.0" 404

I there is a first fix, I can test on my Proxmox instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:nativeAll issues only affecting the python native platform

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions