Bug 1838859 - user from kickstart is not created on ostreesetup based install
Summary: user from kickstart is not created on ostreesetup based install
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-21 22:50 UTC by Tomas
Modified: 2020-07-08 13:19 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
anaconda.log (28.55 KB, text/plain)
2020-05-21 22:50 UTC, Tomas
no flags Details
dbus.log (2.92 KB, text/plain)
2020-05-21 22:50 UTC, Tomas
no flags Details
program.log (12.88 KB, text/plain)
2020-05-21 22:51 UTC, Tomas
no flags Details
anaconda.log (28.65 KB, text/plain)
2020-06-18 01:13 UTC, Tomas
no flags Details
program.log (7.91 KB, text/plain)
2020-06-18 01:13 UTC, Tomas
no flags Details
dbus.log (2.92 KB, text/plain)
2020-06-18 01:14 UTC, Tomas
no flags Details
syslog (599.46 KB, text/plain)
2020-06-18 01:15 UTC, Tomas
no flags Details
inst.ks (1.68 KB, text/plain)
2020-06-18 01:18 UTC, Tomas
no flags Details
anaconda-tb (991.21 KB, text/plain)
2020-06-18 01:20 UTC, Tomas
no flags Details
anaconda-tb (991.22 KB, text/plain)
2020-06-18 01:24 UTC, Tomas
no flags Details
tmp.tar (1.94 MB, application/x-tar)
2020-06-18 01:27 UTC, Tomas
no flags Details

Description Tomas 2020-05-21 22:50:25 UTC
Created attachment 1690899 [details]
anaconda.log

Created attachment 1690899 [details]
anaconda.log

I'm running silverblue (ostreesetup) kickstart install, it appears as if  
"user" directive from kickstart is not being processed because when anaconda tries to add "sshkey", 
it gets an error:

dasbus.error.DBusError: set_user_ssh_key: user tomas does not exist

When "sshkey" directive is missing, the installation completes ok, but no user is created, even tough create users task doesn't report any errors (anaconda.log): 

22:24:19,704 INF progress: Create users
22:24:19,706 DBG installation: Task completed: Create users (30/41) (1.0 s)

As a workaround in %post section of kickstart I'm using:

echo "Adding new user"
useradd -g wheel tomas
echo "tomas:changeme" | chpasswd

addons:         com_redhat_kdump
cmdline:        /usr/bin/python3  /sbin/anaconda
cmdline_file:   inst.ks=file:/silverblue-xac3c92v.ks console=ttyS0 rd.driver.pre=loop net.ifnames=0 biosdevname=0 inst.repo=http://192.168.122.1:8000/32/x86_64/
hashmarkername: anaconda
kernel:         5.6.6-300.fc32.x86_64
package:        anaconda-32.24.7
packaging.log:  
product:        Fedora
reason:         dasbus.error.DBusError: set_user_ssh_key: user tomas does not exist
release:        Fedora release 32 (Thirty Two)
version:        32

Comment 1 Tomas 2020-05-21 22:50:54 UTC
Created attachment 1690900 [details]
dbus.log

Comment 2 Tomas 2020-05-21 22:51:58 UTC
Created attachment 1690901 [details]
program.log

Comment 3 Tomas 2020-05-22 04:14:02 UTC
Looking at ks-post.log where I manually add the user, I'm seeing some sss_cache errors, thought it might be related...

Adding new user
(Fri May 22 00:50:04:912531 2020) [sss_cache] [confdb_init] (0x0010): Unable to open config database [/var/lib/sss/db/config.ldb]
Could not open available domains
useradd: sss_cache exited with status 5
useradd: Failed to flush the sssd cache.
(Fri May 22 00:50:04:922126 2020) [sss_cache] [confdb_init] (0x0010): Unable to open config database [/var/lib/sss/db/config.ldb]
Could not open available domains
useradd: sss_cache exited with status 5
useradd: Failed to flush the sssd cache.
(Fri May 22 00:50:05:093113 2020) [sss_cache] [confdb_init] (0x0010): Unable to open config database [/var/lib/sss/db/config.ldb]
Could not open available domains
chpasswd: sss_cache exited with status 5
chpasswd: Failed to flush the sssd cache.
(Fri May 22 00:50:05:101894 2020) [sss_cache] [confdb_init] (0x0010): Unable to open config database [/var/lib/sss/db/config.ldb]
Could not open available domains
chpasswd: sss_cache exited with status 5
chpasswd: Failed to flush the sssd cache.

Comment 4 Vendula Poncova 2020-06-02 10:31:19 UTC
Please, attach all logs (especially the file named syslog) from the installation. You can find them during the installation in /tmp or on the installed system in /var/log/anaconda/. Also the kickstart file would be very useful.

Comment 5 Tomas 2020-06-18 01:13:20 UTC
Created attachment 1697878 [details]
anaconda.log

Comment 6 Tomas 2020-06-18 01:13:51 UTC
Created attachment 1697879 [details]
program.log

Comment 7 Tomas 2020-06-18 01:14:11 UTC
Created attachment 1697880 [details]
dbus.log

Comment 8 Tomas 2020-06-18 01:15:34 UTC
Created attachment 1697881 [details]
syslog

As requested adding syslog, apologies for not including it from the start

Comment 9 Tomas 2020-06-18 01:18:44 UTC
Created attachment 1697882 [details]
inst.ks

Comment 10 Tomas 2020-06-18 01:20:31 UTC
Created attachment 1697883 [details]
anaconda-tb

Comment 11 Tomas 2020-06-18 01:24:59 UTC
Created attachment 1697884 [details]
anaconda-tb

Comment 12 Tomas 2020-06-18 01:27:06 UTC
Created attachment 1697885 [details]
tmp.tar

files in /tmp dir during the install

Comment 13 Vladimír Slávik 2020-06-30 13:51:07 UTC
Hello Colin, do you have any ideas about this?

Comment 14 Colin Walters 2020-07-02 00:18:57 UTC
Not offhand; first is this a regression?  Did it work at one point?

Could it be the sshkey and useradd sections are processed serially and the useradd needs to be first?

Does Anaconda not invoke `/usr/sbin/useradd` as a subprocess anymore?  Are there logs from that?

Comment 15 Vendula Poncova 2020-07-02 16:41:01 UTC
From syslog:

00:28:23,124 WARNING org.fedoraproject.Anaconda.Modules.Users:DEBUG:anaconda.modules.users.users:A new user list has been set: [UserData(gecos='', gid=-1, groups=['wheel', 'users'], homedir='', is_crypted=False, lock=False, name='tomas', password_set=True, shell='', uid=-1)]

00:56:02,768 WARNING org.fedoraproject.Anaconda.Modules.Users:INFO:anaconda.threading:Running Thread: AnaTaskThread-CreateUsersTask-1 (140503120205568)
00:56:02,772 WARNING org.fedoraproject.Anaconda.Modules.Users:INFO:program:Running... groupadd -R /mnt/sysroot users
00:56:02,803 NOTICE audit:ADD_GROUP pid=3997 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:kernel_t:s0 msg='op=add-group acct="users" exe="/usr/sbin/groupadd" hostname=? addr=? terminal=? res=failed'
00:56:02,804 WARNING org.fedoraproject.Anaconda.Modules.Users:INFO:program:groupadd: group 'users' already exists
00:56:02,806 WARNING org.fedoraproject.Anaconda.Modules.Users:DEBUG:program:Return code: 9
00:56:02,806 WARNING org.fedoraproject.Anaconda.Modules.Users:WARNING:anaconda.modules.users.installation:Group users already exists
00:56:02,806 WARNING org.fedoraproject.Anaconda.Modules.Users:INFO:anaconda.threading:Thread Done: AnaTaskThread-CreateUsersTask-1 (140503120205568)

It looks like Anaconda fails to determine that the group 'users' already exists, so it will try to create it itself. That fails and aborts the rest of the installation task that is supposed to create the user 'tomas'. We should make the logic more robust.

Anyway, the bug doesn't seem to be related to the RPM OSTree payload.


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