On the first boot (only), DNS requests from our snap fails. After the reboot, everything works just fine.
We’re using NetworkManager as a renderer, here are its logs of NetworkManager startup
I checked whether /etc/resolv.conf has correct content. It looks like being right. This is extracted from inside the snap service:
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0 trust-ad
DNS name resolution from inside the python service running in the snap looks fine:
[ 896.413701] python3[5950]: urllib3.connectionpool Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xb3b812f8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /api/4504479311986688/store/
I tried to make a DBus call to resolve1, and it fails like this:
[ 874.864453] python3[5950]: screenly.networkprobe Cannot resolve hostname with resolved: g-io-error-quark: GDBus.Error:org.freedesktop.resolve1.NoNameServers: No appropriate name servers or networks for name found (36)
My theory is that on the first boot systemd-networkd configures the network and when NetworkManager takes over the network configuration after netplan apply
and DNS settings break.