Bug 2258648

Summary: fedora-toolbox:39 has a dangling /etc/resolv.conf symlink on hosts without systemd-resolved(8)
Product: [Fedora] Fedora Reporter: Scott Williams <vwfoxguru>
Component: toolboxAssignee: Debarshi Ray <debarshir>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 39CC: debarshir, go-sig, harrymichal, ogutierr, patrick, sumukher
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: toolbox-0.0.99.5-2.fc39 toolbox-0.0.99.5-1.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-18 01:46:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Scott Williams 2024-01-16 19:30:19 UTC
Is not using systemd-resolved on the host, creating a Fedora 39 toolbox environment creates a bad symlink such that no DNS resolutions are possible.  This is a regression from previous versions of Fedora+toolbox as this has worked going back to at least Fedora 36.

This is observed in Fedora 39 Workstation that was upgraded from Fedora 38.  The issue was only observed after upgrading to Fedora 39 and creating a new Fedora 39 toolbox environment.

Reproducible: Always

Steps to Reproduce:
1. Disable systemd-resolved on host (ie, use dns=default in NetworkManager conf's [main] and disable systemd-resolved service that unfortunately doesn't play well with my ISP)
2. Create fresh toolbos: `toolbox create` `toolbox enter`
3. Attempt to dnf install/search
Actual Results:  
Errors during downloading metadata for repository 'fedora':
  - Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-39&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]
Error: Failed to download metadata for repo 'fedora': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-39&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]


Expected Results:  
Resolution in the container environment matches host's effective resolv.conf settings.

$ ls -l /etc/resolv.conf 
lrwxrwxrwx. 1 root root 39 Nov 27 23:50 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

is a broken symlink.

Workaround in toolbox:
sudo unlink /etc/resolv.conf
sudo vi /etc/resolv.conf (Add in nameservers manually)

Comment 1 Fedora Update System 2024-01-16 23:04:47 UTC
FEDORA-2024-1505a8df50 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-1505a8df50

Comment 2 Fedora Update System 2024-01-16 23:04:54 UTC
FEDORA-2024-f303015b75 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2024-f303015b75

Comment 3 Debarshi Ray 2024-01-16 23:07:57 UTC
This was reported earlier as:
https://github.com/containers/toolbox/issues/1410

The root cause is a regression in the fedora-toolbox images for Fedora >= 39, but it can also be worked around by making toolbox(1) more robust when setting up /etc/resolv.conf in the container.

The fedora-toolbox:40 image has already been fixed, and toolbox-0.0.99.5 has the workaround in place.  We will soon backport the fix to fedora-toolbox:39.

Comment 4 Fedora Update System 2024-01-18 01:46:39 UTC
FEDORA-2024-1505a8df50 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2024-01-21 04:21:48 UTC
FEDORA-2024-f303015b75 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.