blitz_api icon indicating copy to clipboard operation
blitz_api copied to clipboard

[Proxmox] system.get_hardware_info() fails

Open rootzoll opened this issue 1 year ago • 1 comments

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.

rootzoll avatar Sep 12 '24 12:09 rootzoll

and replace it with platform=native_python.

sudo journalctl -u blitzapi -n 500 | grep -v "/api/lightning/list-all-tx?reversed=true"

Jan 08 16:35:08 RASPIBLITZ sudo[821]: blitzapi : PWD=/home/blitzapi/blitz_api ; USER=root ; COMMAND=/usr/bin/xxd -ps -u -c 1000 /mnt/hdd/lnd/data/chain/bitcoin/mainnet/admin.macaroon Jan 08 16:35:08 RASPIBLITZ sudo[821]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=109) Jan 08 16:35:08 RASPIBLITZ sudo[821]: pam_unix(sudo:session): session closed for user root Jan 08 16:35:08 RASPIBLITZ blitz.web.api.sh[700]: # '.env' config updates - blitzapi maybe needs to be restarted Jan 08 16:35:08 RASPIBLITZ systemd[1]: Started blitzapi.service - BlitzBackendAPI. Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ℹ️ | logging.py:87 | Started server process [914] Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ℹ️ | logging.py:87 | Waiting for application startup. Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ℹ️ | service.py:33 | Initializing bitcoin repository Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ℹ️ | lnd_grpc.py:249 | Trying to connect to LND daemon ... Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ℹ️ | logging.py:87 | Application startup complete. Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ℹ️ | logging.py:87 | Uvicorn running on http://0.0.0.0:11111 (Press CTRL+C to quit) Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ⚠️ | utils.py:69 | Key 'system_cpu_load' not found in Redis DB. Jan 08 16:35:11 RASPIBLITZ python[914]: Task exception was never retrieved Jan 08 16:35:11 RASPIBLITZ python[914]: future: <Task finished name='Task-7' coro=<_handle_gather_hardware_info() done, defined at /home/blitzapi/blitz_api/app/system/service.py:109> exception=ValueError("could not convert string to float: ''")> Jan 08 16:35:11 RASPIBLITZ python[914]: Traceback (most recent call last): Jan 08 16:35:11 RASPIBLITZ python[914]: File "/home/blitzapi/blitz_api/app/system/service.py", line 112, in _handle_gather_hardware_info Jan 08 16:35:11 RASPIBLITZ python[914]: info = await get_hardware_info() Jan 08 16:35:11 RASPIBLITZ python[914]: ^^^^^^^^^^^^^^^^^^^^^^^^^ Jan 08 16:35:11 RASPIBLITZ python[914]: File "/home/blitzapi/blitz_api/app/system/service.py", line 61, in get_hardware_info Jan 08 16:35:11 RASPIBLITZ python[914]: return await system.get_hardware_info() Jan 08 16:35:11 RASPIBLITZ python[914]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Jan 08 16:35:11 RASPIBLITZ python[914]: File "/home/blitzapi/blitz_api/app/system/impl/raspiblitz.py", line 306, in get_hardware_info Jan 08 16:35:11 RASPIBLITZ python[914]: value = float(load) Jan 08 16:35:11 RASPIBLITZ python[914]: ^^^^^^^^^^^ Jan 08 16:35:11 RASPIBLITZ python[914]: ValueError: could not convert string to float: '' Jan 08 16:35:11 RASPIBLITZ python[914]: 2025-01-08 16:35:11 | ℹ️ | service.py:46 | Bitcoin Core initializing, waiting 10 seconds... Jan 08 16:35:21 RASPIBLITZ python[914]: 2025-01-08 16:35:21 | ℹ️ | service.py:46 | Bitcoin Core initializing, waiting 10 seconds... Jan 08 16:35:31 RASPIBLITZ python[914]: 2025-01-08 16:35:31 | ✅ | service.py:39 | Bitcoin repository initialized Jan 08 16:35:47 RASPIBLITZ python[914]: 2025-01-08 16:35:47 | ℹ️ | lnd_grpc.py:173 | Wallet is locked. Unlock by calling /lightning/unlock-wallet Jan 08 16:36:30 RASPIBLITZ python[914]: /home/blitzapi/blitz_api/venv/lib/python3.11/site-packages/pydantic/main.py:426: UserWarning: Pydantic serializer warnings: Jan 08 16:36:30 RASPIBLITZ python[914]: Expected enum but got LnInitState with value <LnInitState.BOOTSTRAPPIN...strapping_after_unlock'> - serialized value may not be as expected Jan 08 16:36:30 RASPIBLITZ python[914]: return self.pydantic_serializer.to_python( Jan 08 16:36:42 RASPIBLITZ python[914]: 2025-01-08 16:36:42 | ✅ | lnd_grpc.py:285 | Initialization complete.

adevoss avatar Jan 08 '25 15:01 adevoss