Bug Report: Problems with systemd-resolved in 1.5.0
ma-ochoa opened this issue ยท 29 comments
OS Version
Debian 12
System Information
Linux silver-ha 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux
What happened?
Trying to perform a clean installation of HA Supervised, problems occur with the functioning of the systemd-resolved package
In certain scenarios the system runs out of DNS resolution and install fails.
I attach a link that describes the problem (I'm sorry that it's in Spanish, I couldn't find it in English)
https://moss.sh/es/configuracion-problematica-systemd-resolved/
Machine Type
generic-x86-64
Installer output
No response
Relevant log output
No response
ADR
- I have read through the ADR and have confirmed that my system is compliant with the requirements
- I understand that if my system is found to not be compliant, my issue will be closed immediately without further investigation
Code of Conduct
- I have read and agree to the Home Assistant Code of Conduct
i got the same problems when i try to use the 1.5.0 to isntall it,systemd-resolved stopped me
i have the same error on Debian 11.7 and 12:
dpkg: dependency problems prevent configuration of homeassistant-supervised:
homeassistant-supervised depends on systemd-resolved; however:
Package systemd-resolved is not installed.
Getting the same error, unable to get Home Assistant back up and running after a failed upgrade attempt.
Doesn't look like systemd-resolved is available on Debian 12?
apt-get install systemd-resolved
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package systemd-resolved is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'systemd-resolved' has no installation candidate
The dependency in supervised-installer is wrong.
systemd-resolved is part of package: systemd
At least in my Package: systemd Version: 247.3-7+deb11u2
See: dpkg -L systemd | grep systemd-resolve
I have the same issue. I tried to install homeassistant-supervised on Debian 11 with apt install ./homeassistant-supervised.deb
and this are my logs:
root@rpi4-20230102:/tmp# apt install ./homeassistant-supervised.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'homeassistant-supervised' instead of './homeassistant-supervised.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
homeassistant-supervised : Depends: systemd-resolved but it is not installable
E: Unable to correct problems, you have held broken packages.
systemd
is installed on my machine:
root@rpi4-20230102:/tmp# systemd --version
systemd 247 (247.3-7+deb11u2)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified
You can bypass this error by using the command sudo dpkg -i --ignore-depends=systemd-resolved homeassistant-supervised.deb
Or you can create a fake systemd-resolved package using equivs which will satisfy the missing dependency.
- Install equivs
sudo apt install equivs
- Generate a template control file
equivs-control systemd-resolved.control
- Fix the package name
sed -i 's/<package name; defaults to equivs-dummy>/systemd-resolved/g' systemd-resolved.control
- Build the package
equivs-build systemd-resolved.control
- Install it
sudo dpkg -i systemd-resolved_1.0_all.deb
That should satisfy the homeassistant-supervised packageโs dependency.
Thanks a lot @oleksandr-beley ๐ค. dpkg -i --ignore-depends=systemd-resolved homeassistant-supervised.deb
worked for me, I was able to install homeassistant-supervised on Debian 11 ๐. But this is just workaround until the dependency in supervised-installer
will be fixed, correct?
Yes, this is just a temporary workaround. I recommend using the second method because using "--ignore-depends" may generate warnings about missing dependencies on the system.
The dependency in supervised-installer is wrong. systemd-resolved is part of package: systemd At least in my Package: systemd Version: 247.3-7+deb11u2 See: dpkg -L systemd | grep systemd-resolve
It appears that has changed with Debian 12, I had to install it as a separate dependency on my system. That being said my focus right now is on supporting Debian 12 as the ADR states "When a new major version of Debian is released, the previous major version is dropped, with a deprecation time of 4 months."
I could not find easy way to change the dependency's on a per OS basis without generating multiple packages and considering there is only 4 months until deprecation, I think it makes sense to just stick with the workaround for now as any new installs really should be done on Debian 12 at this point. That being said I am always open to suggestions as long as they comply with the ADR
The dependency in supervised-installer is wrong. systemd-resolved is part of package: systemd At least in my Package: systemd Version: 247.3-7+deb11u2 See: dpkg -L systemd | grep systemd-resolve
It appears that has changed with Debian 12, I had to install it as a separate dependency on my system. That being said my focus right now is on supporting Debian 12 as the ADR states "When a new major version of Debian is released, the previous major version is dropped, with a deprecation time of 4 months."
I could not find easy way to change the dependency's on a per OS basis without generating multiple packages and considering there is only 4 months until deprecation, I think it makes sense to just stick with the workaround for now as any new installs really should be done on Debian 12 at this point. That being said I am always open to suggestions as long as they comply with the ADR
To add on this, here is a part of Bookworm's changelog:
systemd-resolved has been split into a separate package.
This new systemd-resolved package will not be installed automatically
I was able to simply do apt install systemd-resolved
and everything worked again.
Following the Home Assistant Supervised installation page, I kicked off a new Debian 12 installation last night and the internet worked until I started installing the dependencies ( one by one ) , as soon as I installed systemd-resolved the DNS broke. The only way I could continue the installation was by running "sudo systemctl stop systemd-resolved".
For me the issue is systemd-resolved is not playing nicely the Debian 12 or one of the other dependencies ( listed below ).
apt install
apparmor
jq
wget
curl
udisks2
libglib2.0-bin
network-manager
dbus
lsb-release
systemd-journal-remote
systemd-resolved -y
If it can help someone...
As @Skynetnexus said, when you install systemd-resolved, it doesn't work fine using stub listener (default option). If you disable stub listener, using another DNS server, it works fine.
So...to bypass the issue...
sudo apt install systemd-resolved
At this time, this breaks name resolution...
sudo nano /etc/systemd/resolved.conf
Uncomment this lines with no stub listener and your DNS server (eg. your router address):
DNS=192.168.1.1
DNSStubListener=no
Save and restart systemd-resolved
sudo systemctl restart systemd-resolved
Now check name resolution and go on with installation
@snakuzzo Thank you so much! Your solution has enabled me to complete the installation of home assistant and I now have a working installation after trying many other solutions.
Unfortunately my internet died again before I could apply my save Home Assistant backup. I am not sure if this was the root cause but I have previously been advised to disable ipv6 inside home assistant ( settings/system/network ) which I did and then to entered the commands below to get the internet going again. The internet is now working, even after multiple reboots.
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service
Is there a planned fix for this? ... Khadas VIM4 only have a Debian11 avaliable at this point in time.
systemd 247 (247.3-7+deb11u2)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified
khadas@Khadas:~$ sudo apt-get install systemd-resolved -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
systemd-resolved : Depends: systemd (= 252.5-2~bpo11+1)
Recommends: libnss-resolve but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
khadas@Khadas:~$
Follow this to bypass the problem.
Is not an issue related to HA Supervised installer...it's related to systemd-resolved
package
Follow this to bypass the problem. Is not an issue related to HA Supervised installer...it's related to
systemd-resolved
package
khadas@Khadas:~$ sudo apt-get install systemd-resolved -y
...
The following packages have unmet dependencies:
systemd-resolved : Depends: systemd (= 252.5-2~bpo11+1)
Recommends: libnss-resolve but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Thanks, I did follow the guide :D .. it fails on the first step. systemd-resolved fails completely ... its trying to install version 252 but the system is actually 247
If you follow guidelines, You have to use last Debian stable release (12)
If you follow guidelines, You have to use last Debian stable release (12)
Impossible :D as many SBC boards dont have Debian12 .. only Debian11.
Try this
Anyway, Debian 11 is officially supported just for 4 months from the latest Deban 12 stable release.
Try this Anyway, Debian 11 is officially supported just for 4 months from the latest Deban 12 stable release.
This failed... there was a 'Too many errors, failing' and then aptitude quits
I rolled back the supervised installer to 1.4.3 and continued.
If you follow guidelines, You have to use last Debian stable release (12)
I'm hella confused. I'm on Debian 11. And it shows no install candidate for systemd. Should I update to Debian 12 and run HA installer to fix this issue?
HA Supervised is officially supported on latest stable release (Debian 12). So...you need to upgrade to Debian 12 (search on googole, there are a lot of guides) and follow official guidelines to install/upgrade HA Supervised installation. When you will installa systemd-resolved and you will got DNS resolution problem, all you have to do is follow these steps
Your solution does work around the issue. However, it has shortcomings:
- It does not work for anyone using a subnet other than 192.168.1.1/24 - there might not be a DNS server at 192.168.1.1 for many people.
- One could also set FallbackDNS=8.8.8.8 in /etc/systemd/resolved.conf and then you'd get Google's DNS which should always work but might be slower for some people.
- According to this, supervised-installer should not be dependent on systemd-resolved in Debian 12 (as suggested previously in this thread) https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#systemd-resolved
A real fix is needed here. In Debian 12, DNS works correctly out of the box. Installing systemd-resolved is what's breaking things. We have two good options to move forward with:
- Make systemd-resolved install correctly on Debian 12.
- When Debian 11 falls out of support here soon, change supervised-installer to not require the systemd-resolved package (hopefully HA Core and other supervised components do not actually require systemd-resolved specifically).
I agree...
But about 192.168.1.1, that was just an example ;)
I installed Debian 12.1 on a PC Engines APU2 board and I was stopped by this issue until I added DNS server to /etc/systemd/resolved.conf. This is quite a simple bug but it will stop all users if not documented in the main documentation.
USE DEBIAN 12, 11 WILL NOT WORK
edit /etc/resolve.conf
set nameserver to 8.8.8.8
save file
systemd-resolved will pickup the change and dns will work again.
login to webinterface and create your account.
when finished reboot you system
As I said before...edit resolv.conf is not a best practice
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment ๐
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.