Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Problems with systemd-resolved in 1.5.0 #304

Closed
3 tasks done
ma-ochoa opened this issue Jun 25, 2023 · 30 comments · Fixed by #337
Closed
3 tasks done

Bug Report: Problems with systemd-resolved in 1.5.0 #304

ma-ochoa opened this issue Jun 25, 2023 · 30 comments · Fixed by #337
Labels
bug Something isn't working

Comments

@ma-ochoa
Copy link

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

@ma-ochoa ma-ochoa added the bug Something isn't working label Jun 25, 2023
@abirvepete
Copy link

i got the same problems when i try to use the 1.5.0 to isntall it,systemd-resolved stopped me

@Dengor1984
Copy link

Dengor1984 commented Jun 25, 2023

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.

@Skrufen
Copy link

Skrufen commented Jun 25, 2023

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

@st00m
Copy link

st00m commented Jun 25, 2023

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

@rb090
Copy link

rb090 commented Jun 26, 2023

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

@oleksandr-belei
Copy link

oleksandr-belei commented Jun 28, 2023

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.

@rb090
Copy link

rb090 commented Jun 28, 2023

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?

@oleksandr-belei
Copy link

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.

@ikifar2012
Copy link
Member

ikifar2012 commented Jun 29, 2023

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

@Blogshot
Copy link

Blogshot commented Jul 6, 2023

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.

@tripunto
Copy link

tripunto commented Jul 9, 2023

Doesn't seem like systemd-resolved is available in Debian 12?

It seems that version 1.5.0 is only compatible with debian 12, where "YES" you can install systemd-resolved
I tried to install it several times on my raspberry and it didn't work and the one I had only works on localhost... it's impossible to access from another device on my network

I have debian 12 installed on another sd and yes I can install systemd-resolved, but before installing it I want to make a backup... I already downloaded kde plasma 4 times

EDIT: I will have to install version 1.4.3

As soon as I install the systemd-resolves, the DNS stops working and does not resolve any host

ping: checkonline.home-assistant.io: Temporary failure in name resolution [info] Waiting for checkonline.home-assistant.io - network interface might be down... ^Xping: checkonline.home-assistant.io: Temporary failure in name resolution [info] Waiting for checkonline.home-assistant.io - network interface might be down... ^Cdpkg: error processing package homeassistant-supervised (--install): thread installed package homeassistant-supervised script post-installation was interrupted Errors encountered while processing: homeassistant-supervised

EDIT2: after uninstalling systemd-resolved from debian 12, the DNS works again, but it is required and without it it cannot be installed...
so 1.5.0 doesn't work at all

@Skynetnexus
Copy link

Skynetnexus commented Jul 19, 2023

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

@snakuzzo
Copy link

snakuzzo commented Jul 20, 2023

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

@Skynetnexus
Copy link

@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

@RichardPar
Copy link

RichardPar commented Jul 26, 2023

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:~$

@snakuzzo
Copy link

Follow this to bypass the problem.
Is not an issue related to HA Supervised installer...it's related to systemd-resolved package

@RichardPar
Copy link

RichardPar commented Jul 26, 2023

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

@snakuzzo
Copy link

If you follow guidelines, You have to use last Debian stable release (12)

@RichardPar
Copy link

If you follow guidelines, You have to use last Debian stable release (12)

Impossible :D as many SBC boards dont have Debian12 .. only Debian11.

@snakuzzo
Copy link

snakuzzo commented Jul 26, 2023

Try this
Anyway, Debian 11 is officially supported just for 4 months from the latest Deban 12 stable release.

@RichardPar
Copy link

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.

@Reynold29
Copy link

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?

@snakuzzo
Copy link

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

@andygikling
Copy link

andygikling commented Aug 20, 2023

@snakuzzo

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).

@snakuzzo
Copy link

snakuzzo commented Aug 20, 2023

I agree...

But about 192.168.1.1, that was just an example ;)

@ffries
Copy link

ffries commented Aug 29, 2023

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.

@snakuzzo
Copy link

This Is wrong. resolv.conf should not be manually eidted. Read this and this

@imkermichel
Copy link

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

@snakuzzo
Copy link

As I said before...edit resolv.conf is not a best practice

@mjbogusz mjbogusz mentioned this issue Oct 4, 2023
3 tasks
@github-actions
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.