RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1048520 - dns lookup not working during package installation
Summary: dns lookup not working during package installation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Radek Vykydal
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-04 20:26 UTC by Kay Williams
Modified: 2015-03-05 13:57 UTC (History)
5 users (show)

Fixed In Version: anaconda-19.31.87-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:57:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
anaconda.ifcfg.log (3.60 KB, text/plain)
2014-01-06 23:05 UTC, Kay Williams
no flags Details
anaconda.log (8.83 KB, text/x-log)
2014-01-06 23:05 UTC, Kay Williams
no flags Details
anaconda.packaging.log (111.57 KB, text/plain)
2014-01-06 23:06 UTC, Kay Williams
no flags Details
anaconda.program.log (24.58 KB, text/x-log)
2014-01-06 23:06 UTC, Kay Williams
no flags Details
anaconda.storage.log (72.86 KB, text/x-log)
2014-01-06 23:07 UTC, Kay Williams
no flags Details
anaconda.xlog (18.29 KB, text/plain)
2014-01-06 23:09 UTC, Kay Williams
no flags Details
syslog (65.88 KB, text/plain)
2014-01-06 23:09 UTC, Kay Williams
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0312 0 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2015-03-05 17:35:22 UTC

Description Kay Williams 2014-01-04 20:26:50 UTC
Description of problem:

In rhel7, rpm scriptlets are unable to resolve hostnames during system installation. This is happening because no /etc/resolv.conf exists in the install chroot. When an /etc/resolv.conf file is manually created in the install chroot (e.g. within a scriptlet), dns resolution works as expected.

This issue is new in rhel7. In rhel6, an appropriate /etc/resolv.conf file existed without extra work by the rpm (presuming dns is configured using anaconda command line or kickstart parameters).

How reproducible:

We have tried with both virt-install and boot.iso install with the same result.

Steps to Reproduce:
1. Create an rpm package with a post-install script that attempts to access network resources using a dns hostname (e.g. use curl to download a file from the internet). Have the scriptlet exit with an error status if network access fails.
2. Include the package in a custom spin. (Using kickstart should work as well).
3. Perform a system installation.
4. View /var/log/anaconda/anaconda.packaging.log to see a scriptlet failed error.

Actual results:
Scriptlet fails attempting to resolve the hostname.

Expected results:
Hostname resolution completes without error.

Notes:
1. If the scriptlet is modified to access the network resource using an ipaddress rather than a hostname, install completes without error.

Comment 2 Brian Lane 2014-01-06 17:01:43 UTC
Please include the logs from /tmp/*log as individul text/plain attachments.

I'm going to move this to NetworkManager, it should be handling the writing of /etc/resolv.conf when they network comes up.

Comment 3 Kay Williams 2014-01-06 23:05:36 UTC
Created attachment 846330 [details]
anaconda.ifcfg.log

Comment 4 Kay Williams 2014-01-06 23:05:57 UTC
Created attachment 846331 [details]
anaconda.log

Comment 5 Kay Williams 2014-01-06 23:06:20 UTC
Created attachment 846332 [details]
anaconda.packaging.log

Comment 6 Kay Williams 2014-01-06 23:06:40 UTC
Created attachment 846333 [details]
anaconda.program.log

Comment 7 Kay Williams 2014-01-06 23:07:14 UTC
Created attachment 846334 [details]
anaconda.storage.log

Comment 8 Kay Williams 2014-01-06 23:09:22 UTC
Created attachment 846335 [details]
anaconda.xlog

Comment 9 Kay Williams 2014-01-06 23:09:44 UTC
Created attachment 846336 [details]
syslog

Comment 10 Kay Williams 2014-01-06 23:15:58 UTC
In the attached anaconda.packaging.log, the scriptlet failed error occurs at line 1553 after the package test.7-4.el7.noarch attempts the following command:

curl http://google.com

Comment 11 Radek Vykydal 2014-01-07 10:03:36 UTC
I think the problem here is that (unlike in rhel6) /etc/resolv.conf is not copied to chroot.

Comment 13 Kay Williams 2014-05-01 15:11:14 UTC
Hello, any chance we can get a fix for this for rhel7?  It is still broken in the release candidate.

For rhel6, we have rpms with simple post scripts to download external content. 

Without a fix, the rhel7 rpm logic is more complex.

1. Install a script that downloads external content.
2. Install a systemd service that runs once to execute the script.
3. Use a post script that determines if we are running under anaconda.
4. If so, enable the systemd service so that it runs at first boot.
5. Else, simply run the script.

Comment 14 Radek Vykydal 2014-05-02 11:32:16 UTC
I've prepared updates image for rhel7 rc2 (should work with rhel7 rc too) containing patch which copies /etc/resolv.conf to target system root before installing packages:

It can by applied for testing by adding boot option:

updates=http://rvykydal.fedorapeople.org/updates.chrootresolv.img

Does it fix the issue for you?

Comment 15 Kay Williams 2014-05-05 19:37:19 UTC
Yes, it works. Thank you!

Comment 17 Alexander Todorov 2014-12-01 12:47:48 UTC
Verified with anaconda-19.31.111-1. Here's my test.spec for reference.

Summary: Test package
Name:    test
Version: 1
Release: 1%{?dist}
License: GPLv2+
Group:   Applications/System
URL:     http://fedoraproject.org/wiki/Anaconda

Requires: curl


%description
Test package.

%prep
echo > /dev/null

%build
echo > /dev/null

%install
mkdir -p %{buildroot}/opt

%files
%dir /opt/

%post

curl http://google.com


%changelog
* Mon Dec 01 2014 Alexander Todorov <atodorov.com> - 1-1
- test

Comment 19 errata-xmlrpc 2015-03-05 13:57:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0312.html


Note You need to log in before you can comment on or make changes to this bug.