Bug 1559680 - Realm join via kickstart during install fails with 'This computer's host name is not set correctly', but it is
Summary: Realm join via kickstart during install fails with 'This computer's host name...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 28
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker
Depends On:
Blocks: F28BetaBlocker
TreeView+ depends on / blocked
 
Reported: 2018-03-23 02:17 UTC by Adam Williamson
Modified: 2018-03-29 19:21 UTC (History)
14 users (show)

Fixed In Version: anaconda-28.22.2-7.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-29 19:21:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2018-03-23 02:17:51 UTC
In current Rawhide and Fedora 28, the openQA test which tests enrolment into a FreeIPA domain via kickstart during install fails, e.g.:

https://openqa.fedoraproject.org/tests/209813

anaconda's program.log shows this:

12:31:09,463 INF program: Running... realm join --install /mnt/sysimage --verbose --one-time-password=monkeys ipa001.domain.local
12:31:09,763 INF program: * Resolving: _ldap._tcp.ipa001.domain.local
12:31:09,764 INF program: * Resolving: ipa001.domain.local
12:31:09,764 INF program: * Performing LDAP DSE lookup on: 10.0.2.100
12:31:09,765 INF program: * Successfully discovered: domain.local
12:31:09,765 INF program: realm: Couldn't join realm: This computer's host name is not set correctly.

however, the hostname *was* (at least, anaconda claims so) set to 'client001.domain.local' a minute earlier, according to anaconda.log:

12:30:15,387 INF network: setting installation environment host name to client001.domain.local

So, either anaconda isn't actually setting the host name correctly, or realm isn't noticing that anaconda has changed it, or something.

The test which tests enrolment via realmd *after* install - which does 'hostnamectl set-hostname client003.domain.local' then calls 'realm join' - *does* work:

https://openqa.fedoraproject.org/tests/209817

Given that, I'm tentatively assigning this to anaconda, but CCing realmd maintainers.

Proposing as a Beta blocker, per Basic criterion "It must be possible to join the system to a FreeIPA or Active Directory domain at install time and post-install, and the system must respect the identity, authentication and access control configuration provided by the domain" - https://fedoraproject.org/wiki/Basic_Release_Criteria#Remote_authentication . The 'at install time' part of that criterion explicitly covers this scenario.

Comment 1 Sumit Bose 2018-03-23 08:21:47 UTC
realmd prints this error under the following conditions:

        /* Check the host name */
        ret = gethostname (hostname, sizeof (hostname));
        if (ret < 0 || g_ascii_strcasecmp (hostname, "localhost") == 0 ||
            g_ascii_strncasecmp (hostname, "localhost.", 10) == 0 ||
            hostname[0] == '.') {
                g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BAD_HOSTNAME,
                                                       "This computer's host name is not set correctly.");
                return TRUE;
        }

So either gethostname() failed or the returned name starts with 'localhost' or a '.'.

HTH

bye,
Sumit

Comment 2 Radek Vykydal 2018-03-26 13:15:32 UTC
This should be fixed by porting this patch to F28:
https://github.com/rhinstaller/anaconda/pull/1385/files

From what I've looked at it seems that on rawhide (where the patch is already applied in anaconda-29.5-1.fc) the server_realmd_join_kickstart test fails for other reasons (eg https://openqa.fedoraproject.org/tests/210632).

Comment 3 Radek Vykydal 2018-03-26 13:19:30 UTC
(In reply to Adam Williamson from comment #0)

> The test which tests enrolment via realmd *after* install - which does
> 'hostnamectl set-hostname client003.domain.local' then calls 'realm join' -
> *does* work:
> 
> https://openqa.fedoraproject.org/tests/209817
> 

From /var/log/anaconda/journal.log:

Mar 22 16:30:15 localhost.localdomain anaconda[1867]: anaconda: installation: Queue started: Network configuration (2/8)
Mar 22 16:30:15 localhost.localdomain anaconda[1867]: anaconda: progress: Writing network configuration
Mar 22 16:30:15 localhost.localdomain anaconda[1867]: anaconda: installation: Task started: Network configuration (11/21)
Mar 22 16:30:15 localhost.localdomain anaconda[1867]: anaconda: network: setting installation environment host name to client001.domain.local
Mar 22 16:30:15 localhost.localdomain org.fedoraproject.Anaconda.Modules.Network[1963]: DEBUG:anaconda.modules.network.network:Current hostname cannot be set.
Mar 22 16:30:15 localhost.localdomain anaconda[1867]: anaconda: installation: Task completed: Network configuration (11/21) (0.0 s)

Comment 4 Stephen Gallagher 2018-03-26 13:33:06 UTC
I'm +1 blocker on this, for the record.

Comment 5 Mohan Boddu 2018-03-26 13:36:14 UTC
+1 blocker

Comment 6 Adam Williamson 2018-03-26 15:46:54 UTC
Radek: thanks. Note, the test you linked to isn't really a failure, openQA uses 'soft fail' as the term for the mushy state between 'complete pass' and 'complete fail', that particular test is 'soft failed' because everything worked, but AVCs showed up along the way (which we have the tests set to specifically look for and treat as a 'soft fail' if it happens, so we can catch the AVCs and file bugs). Aside from the AVCs, everything worked OK in that run.

Can you prepare a build and update of anaconda with this fix, since it seems highly likely to be accepted as a blocker? Thanks!

Comment 7 Patrick Uiterwijk 2018-03-26 16:10:00 UTC
+1 blocker

Comment 8 Fedora Update System 2018-03-26 17:10:01 UTC
anaconda-28.22.2-7.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-34ea87ba41

Comment 9 Geoffrey Marr 2018-03-26 18:41:36 UTC
Discussed during the 2018-03-26 blocker review meeting: [1]

The decision to classify this bug as an AcceptedBlocker was made as it violates the following blocker criteria:

"It must be possible to join the system to a FreeIPA or Active Directory domain at install time and post-install, and the system must respect the identity, authentication and access control configuration provided by the domain" (in all cases where a correct hostname is not set via DHCP)

[1] https://meetbot.fedoraproject.org/fedora-blocker-review/2018-03-26/f28-blocker-review.2018-03-26-16.01.txt

Comment 10 Fedora Update System 2018-03-26 20:52:16 UTC
anaconda-28.22.2-7.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-34ea87ba41

Comment 11 Stephen Gallagher 2018-03-27 14:50:06 UTC
This passed for the manual AD client kickstart test[*] I just ran against the Beta candidate. It appears that openqa's test also passed for FreeIPA. So this is probably VERIFIED, but I'll leave that up to Adam to make the final call.


[*](https://fedoraproject.org/wiki/QA:Testcase_realmd_join_kickstart)

Comment 12 Adam Williamson 2018-03-27 16:08:42 UTC
robot says "yes"

Comment 13 Fedora Update System 2018-03-29 19:21:54 UTC
anaconda-28.22.2-7.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


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