bkbilly / lnxlink

🖥 Effortlessly manage your Linux machine using MQTT.
https://bkbilly.gitbook.io/lnxlink
MIT License
276 stars 30 forks source link

stuck in an upgrade loop #96

Closed Baggypants closed 7 months ago

Baggypants commented 8 months ago

What type of installation are you running?

Desktop

Which Linux OS are you using?

(venv) baggypants@raspberrypi:~/lnxlink-pip $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)" NAME="Raspbian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Which version of LNXLink has the issue?

lnxlink 2024.3.0

Describe the problem

lnxlink seems to be stuck in an upgrade loop for the past day or so. It's trying to upgrade pycairo, when a version of pycairo already exists

(venv) baggypants@raspberrypi:~/lnxlink-pip $ pip3 list installed | grep pycairo
pycairo                          1.26.0

Additional context

No response

Configuration

(venv) baggypants@raspberrypi:~/lnxlink-pip $ cat config.yaml
mqtt:
  prefix: lnxlink
  clientId: pimodelb
  server: 10.0.0.14
  port: 1883
  auth:
    user: homeautomation
    pass: 
    tls: false
    keyfile: ''
    certfile: ''
    ca_certs: ''
  discovery:
    enabled: true
  lwt:
    enabled: true
    qos: 1
    retain: true
    connectMsg: 'ON'
    disconnectMsg: 'OFF'
update_interval: 5
modules: null
custom_modules: null
exclude:
- audio_select
- gpu
- screen_onoff
- screenshot
- xdg_open
- webcam
- display
- fullscreen
- camera_used
- media
- notify
- boot_select
- speech_recognition
- idle
- battery
- power_profile
- gpio
- update
settings:
  systemd: null
  gpio:
    inputs: null
    outputs: null
  hotkeys: null
  statistics: https://analyzer.bkbilly.workers.dev
hass_url: null
hass_api: null

Logs

2024-03-01 11:33:22,655 [3212:MainThread.system_monitor.exit_gracefully.69] [INFO]  stopped gracefully
2024-03-01 11:33:22,659 [3212:MainThread.__main__.temp_connection_callback.257] [INFO]  Power Down detected.
2024-03-01 11:33:22,957 [3212:MainThread.__main__.disconnect.241] [INFO]  Disconnected from MQTT.
2024-03-01 11:34:08,161 [2847:MainThread.config_setup.validate_config.81] [INFO]  Added missing configuration option: hass_url
2024-03-01 11:34:08,216 [2847:MainThread.config_setup.validate_config.81] [INFO]  Added missing configuration option: hass_api
2024-03-01 11:34:08,227 [2847:MainThread.config_setup.validate_config.81] [INFO]  Added missing configuration option: settings.hotkeys
2024-03-01 11:34:08,242 [2847:MainThread.config_setup.validate_config.81] [INFO]  Added missing configuration option: settings.statistics
2024-03-01 11:34:09,153 [2847:MainThread.__main__.__init__.45] [INFO]  LNXlink 2024.3.0, Python 3.11.2
2024-03-01 11:34:09,955 [2847:MainThread.helpers.import_install_package.47] [INFO]  Installing 'pycairo>=1.24.0'...
2024-03-01 11:35:09,762 [2909:MainThread.__main__.__init__.45] [INFO]  LNXlink 2024.3.0, Python 3.11.2
2024-03-01 11:35:10,109 [2909:MainThread.helpers.import_install_package.47] [INFO]  Installing 'pycairo>=1.24.0'...
2024-03-01 11:36:11,685 [2971:MainThread.__main__.__init__.45] [INFO]  LNXlink 2024.3.0, Python 3.11.2
2024-03-01 11:36:12,044 [2971:MainThread.helpers.import_install_package.47] [INFO]  Installing 'pycairo>=1.24.0'...
2024-03-01 11:36:43,412 [3002:MainThread.__main__.__init__.45] [INFO]  LNXlink 2024.3.0, Python 3.11.2
2024-03-01 11:36:43,760 [3002:MainThread.helpers.import_install_package.47] [INFO]  Installing 'pycairo>=1.24.0'...
2024-03-01 11:37:14,427 [3033:MainThread.__main__.__init__.45] [INFO]  LNXlink 2024.3.0, Python 3.11.2
2024-03-01 11:37:14,769 [3033:MainThread.helpers.import_install_package.47] [INFO]  Installing 'pycairo>=1.24.0'...
2024-03-01 11:37:45,123 [3064:MainThread.__main__.__init__.45] [INFO]  LNXlink 2024.3.0, Python 3.11.2
2024-03-01 11:37:45,470 [3064:MainThread.helpers.import_install_package.47] [INFO]  Installing 'pycairo>=1.24.0'...
2024-03-01 11:38:16,230 [3095:MainThread.__main__.__init__.45] [INFO]  LNXlink 2024.3.0, Python 3.11.2
Baggypants commented 8 months ago

looks like this is happening

(venv) baggypants@raspberrypi:~/lnxlink-pip/venv/lib/python3.11/site-packages/lnxlink $ /home/baggypants/lnxlink-pip/venv/bin/lnxlink -c /home/baggypants/lnxlink-pip/config.yaml
INFO:lnxlink:LNXlink 2024.3.0, Python 3.11.2
INFO:lnxlink:Installing 'pycairo>=1.24.0'...
Traceback (most recent call last):
  File "/home/baggypants/lnxlink-pip/venv/bin/lnxlink", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/baggypants/lnxlink-pip/venv/lib/python3.11/site-packages/lnxlink/__main__.py", line 528, in main
    monitor_suspend = MonitorSuspend(lnxlink.temp_connection_callback)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/baggypants/lnxlink-pip/venv/lib/python3.11/site-packages/lnxlink/system_monitor.py", line 18, in __init__
    self._requirements()
  File "/home/baggypants/lnxlink-pip/venv/lib/python3.11/site-packages/lnxlink/system_monitor.py", line 61, in _requirements
    "cairo": import_install_package("pycairo", ">=1.24.0", "cairo"),
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/baggypants/lnxlink-pip/venv/lib/python3.11/site-packages/lnxlink/modules/scripts/helpers.py", line 62, in import_install_package
    return __import__(syspackage)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/baggypants/lnxlink-pip/venv/lib/python3.11/site-packages/cairo/__init__.py", line 1, in <module>
    from ._cairo import *  # noqa: F401,F403
    ^^^^^^^^^^^^^^^^^^^^^
ImportError: libcairo.so.2: cannot open shared object file: No such file or directory
Baggypants commented 8 months ago

Fixed by running apt install libcairo2

bkbilly commented 8 months ago

It seems that it's trying to import the pycairo, but it has a system dependency error so it assumes it's not installed. I'll fix this logic on the next release to log the error and make it easier to identify the issue.

bkbilly commented 7 months ago

All the necessary libraries, including the libcairo2-dev exists on the installation script, so I'll consider this fixed.