Error with addon boot_select. How do I remove from config?
ThommyaVV opened this issue · comments
What type of installation are you running?
Desktop
Which Linux OS are you using?
Arch Linux x86_64
Which version of LNXLink has the issue?
2024.1.0
The problem
running lnxlink -c config.yaml
gives me an error with boot_select addon. It gives the error with or without the visudo edit. I'm perfectly willing to remove the addon (I'm also willing to remove any other addon or command). I would like some help understanding the error and how to remove the addon. And I'm also wondering how relevant the connection refused error is.
[Errno 111] Connection refused
Any help appreciated
Logs
INFO:lnxlink:LNXlink 2024.1.0, Python 3.11.6
INFO:lnxlink:Loaded addons: bash, network, speech_recognition, systemd, brightness, power_profile, gpu, screen_onoff, memory, fullscreen, boot_select, notify, media, camera_used, shutdown, battery, required_restart, send_keys, restart, cpu, audio_select, screenshot, update, inference_time, display_env, disk_usage, sys_updates, idle, microphone_used, webcam, suspend, xdg_open, mouse, keep_alive
INFO:lnxlink:No systemd settings found on configuration.
ERROR:lnxlink:Error with command: powerprofilesctl list (/bin/sh: line 1: powerprofilesctl: command not found)
ERROR:lnxlink:Error with addon boot_select, please remove it from your config: [Errno 13] Permission denied: '/boot/grub/grub.cfg', Traceback (most recent call last):
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/lnxlink/main.py", line 65, in init
tmp_addon = addon(self)
^^^^^^^^^^^
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/lnxlink/modules/boot_select.py", line 13, in init
self.options = self._get_grub_entries()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/lnxlink/modules/boot_select.py", line 48, in _get_grub_entries
with open("/boot/grub/grub.cfg", encoding="UTF-8") as file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/boot/grub/grub.cfg'
Traceback (most recent call last):
File "/home/thommy/.local/bin/lnxlink", line 8, in
sys.exit(main())
^^^^^^
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/lnxlink/main.py", line 456, in main
lnxlink = LNXlink(config_file)
^^^^^^^^^^^^^^^^^^^^
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/lnxlink/main.py", line 77, in init
self.setup_mqtt()
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/lnxlink/main.py", line 166, in setup_mqtt
self.client.connect(
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
^^^^^^^^^^^^^^^^
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/paho/mqtt/client.py", line 1044, in reconnect
sock = self._create_socket_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/thommy/.local/share/pipx/venvs/lnxlink/lib/python3.11/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/socket.py", line 851, in create_connection
raise exceptions[0]
File "/usr/lib/python3.11/socket.py", line 836, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Usually all users have read access to the grub.cfg file, so if you want to use this addon you should change it's permissions and restart LNXlink.
chmod +r /boot/grub/grub.cfg
At the setup documentation, it is explained how to exclude modules, but this is an example of some modules that I would suggest disabling:
exclude:
- audio_select
- bash
- battery
- boot_select
- brightness
- fullscreen
- gpio
- gpu
- idle
- inference_time
- keep_alive
- media
- mouse
- network
- notify
- power_profile
- screen_onoff
- screenshot
- send_keys
- speech_recognition
- systemd
- webcam
- xdg_open
EDIT:
I just saw the Connection refused error.
For that you will have to write the correct credentials to connect to the MQTT broker.
You should check the server, port, user, pass and tls configuration values.
Usually all users have read access to the grub.cfg file, so if you want to use this addon you should change it's permissions and restart LNXlink.
chmod +r /boot/grub/grub.cfg
At the setup documentation, it is explained how to exclude modules, but this is an example of some modules that I would suggest disabling:
exclude: - audio_select - bash - battery - boot_select - brightness - fullscreen - gpio - gpu - idle - inference_time - keep_alive - media - mouse - network - notify - power_profile - screen_onoff - screenshot - send_keys - speech_recognition - systemd - webcam - xdg_openEDIT: I just saw the Connection refused error. For that you will have to write the correct credentials to connect to the MQTT broker. You should check the server, port, user, pass and tls configuration values.
Thank you very much sir
If you don't mind, what is the file name of the config file? On arch I have to use pipx, and it uses a different install location I belive.
The config file is created at the location you run the lnxlink command.
If you don't remember on which directory you started it, you can find it from the systemd service as explained on the documentation:
cat ~/.config/systemd/user/lnxlink.service | grep -i ExecStart
On the 2024.2.0 version, the boot_select module will check if the necessary files exist and it won't affect the normal run of the app if they are not found.