Bug 1339237

Summary: OSError: Unable to create user 1234: status=3
Product: [Fedora] Fedora Reporter: cap.filip.dev
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: anaconda-maint-list, g.kaviyarasu, jonathan, mhroncok, MMBEAN, skumari, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:029c8029d1df878966433d173f6d033cc25eb7ae130e35cbc9438803b133c018;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 14:37:58 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:
Attachments:
Description Flags
File: anaconda-tb
none
File: anaconda.log
none
File: environ
none
File: journalctl
none
File: lsblk_output
none
File: lvm.log
none
File: nmcli_dev_list
none
File: os_info
none
File: program.log
none
File: storage.log
none
File: ifcfg.log
none
File: packaging.log none

Description cap.filip.dev 2016-05-24 12:51:18 UTC
Description of problem:
Used Fedora 23 Boxes app for installing F24.
At first I used Live mode and then I started Install to Hard Drive. Automatic settings, language and keyboard is czech. And created user called 1234 at first I typed a password for this user "1234" but the I checked Do not use password for this user or something like that. I have set him as an administrator and clicked install.


Version-Release number of selected component:
anaconda-core-24.13.4-1.fc24.x86_64

The following was filed automatically by anaconda:
anaconda 24.13.4-1 exception report
Traceback (most recent call first):
  File "/usr/lib64/python3.5/site-packages/pyanaconda/users.py", line 354, in createUser
    raise OSError("Unable to create user %s: status=%s" % (user_name, status))
  File "/usr/lib64/python3.5/site-packages/pyanaconda/kickstart.py", line 1773, in execute
    users.createUser(usr.name, **kwargs)
  File "/usr/lib64/python3.5/site-packages/pyanaconda/install.py", line 96, in doConfiguration
    ksdata.user.execute(storage, ksdata, instClass, u)
  File "/usr/lib64/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.5/site-packages/pyanaconda/threads.py", line 253, in run
    threading.Thread.run(self, *args, **kwargs)
OSError: Unable to create user 1234: status=3

Additional info:
cmdline:        /usr/bin/python3  /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-base
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img root=live:CDLABEL=Fedora-WS-Live-24_B-1-6 rd.live.image rd.live.check quiet
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         4.5.2-302.fc24.x86_64
other involved packages: system-python-libs-3.5.1-7.fc24.x86_64
product:        Fedora
release:        Fedora release 24 (Twenty Four)
reproducible:   Not sure how to reproduce the problem
type:           anaconda
version:        24

Comment 1 cap.filip.dev 2016-05-24 12:54:20 UTC
Created attachment 1161030 [details]
File: anaconda-tb

Comment 2 cap.filip.dev 2016-05-24 12:54:37 UTC
Created attachment 1161031 [details]
File: anaconda.log

Comment 3 cap.filip.dev 2016-05-24 12:54:38 UTC
Created attachment 1161032 [details]
File: environ

Comment 4 cap.filip.dev 2016-05-24 12:56:18 UTC
Created attachment 1161033 [details]
File: journalctl

Comment 5 cap.filip.dev 2016-05-24 12:56:20 UTC
Created attachment 1161034 [details]
File: lsblk_output

Comment 6 cap.filip.dev 2016-05-24 12:56:38 UTC
Created attachment 1161036 [details]
File: lvm.log

Comment 7 cap.filip.dev 2016-05-24 12:56:39 UTC
Created attachment 1161037 [details]
File: nmcli_dev_list

Comment 8 cap.filip.dev 2016-05-24 12:56:40 UTC
Created attachment 1161038 [details]
File: os_info

Comment 9 cap.filip.dev 2016-05-24 12:56:45 UTC
Created attachment 1161039 [details]
File: program.log

Comment 10 cap.filip.dev 2016-05-24 12:56:56 UTC
Created attachment 1161040 [details]
File: storage.log

Comment 11 cap.filip.dev 2016-05-24 12:56:57 UTC
Created attachment 1161041 [details]
File: ifcfg.log

Comment 12 cap.filip.dev 2016-05-24 12:56:59 UTC
Created attachment 1161042 [details]
File: packaging.log

Comment 13 cap.filip.dev 2016-05-26 08:12:44 UTC
Bad regex for validation of the username typed/generated.

Comment 14 David Shea 2016-05-26 18:22:46 UTC
(In reply to cap.filip.dev from comment #13)
> Bad regex for validation of the username typed/generated.

To be a pedantic jerk: it was valid when it was created (bug 1139318 changed the behavior), and the condition is no longer regular.

Comment 15 David Shea 2016-05-26 18:38:44 UTC
I point that out not just so I can (In reply to David Shea from comment #14)
> the condition is no longer regular.

I point that out not just so I can be technically correct (the best kind of correct), but because this will make things difficult for the TUI. The GUI spoke can be fixed with something like this:

diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index a21ee6b..37caf25 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -309,6 +309,9 @@ class UserSpoke(FirstbootSpokeMixIn, NormalSpoke, GUISpokeInputCheckHandler):
         self.add_re_check(self.username, re.compile(USERNAME_VALID.pattern + r'|^$'),
                 _("Invalid user name"))
 
+        # If the username is all numbers, reject it
+        self.add_re_check(self.username, re.compile(r'(?!^\d+$)'), _("Invalid user name"))
+
         self.add_re_check(self.fullname, GECOS_VALID, _("Full name cannot contain colon characters"))
 
         # Modify the GUI based on the kickstart and policy information


but in the TUI, the only check done is based on a single regex. So, I dunno, maybe it's time for that to change.

Comment 16 Sinny Kumari 2016-06-16 09:39:16 UTC
Similar problem has been detected:

Problem Description
-------------------
This problem occurs during installation of a recent F24 RC iso image using anaconda.
To reproduce this problem:
* Install latest Fedora iso image (e.g. https://kojipkgs.fedoraproject.org/compose/24/Fedora-24-20160614.0/compose/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-24-1.2.iso) using anaconda interface
* In USER SETTINGS, try USER CREATION and enter in User Name text field 99 or anything other numerical value as username.
* Further, click on Done.

Clicking Done doesn't gives any error message like "Invalid User Name" and hence further installation process continues and
later on error message "OsError: Unable to create user 99" is seen.

Expected Result
-----------------
Anaconda interface should show an error message when an invalid User Name is entered and pressed Done. 

Note: From man page of adduser it says "Usernames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes. They can end with a dollar sign.  In regular expression terms: [a-z_][a-z0-9_-]*[$]?



cmdline:        /usr/bin/python3  /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-base
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img root=live:CDLABEL=Fedora-WS-Live-24-1-2 rd.live.image quiet
hashmarkername: anaconda
kernel:         4.5.5-300.fc24.x86_64
other involved packages: system-python-libs-3.5.1-7.fc24.x86_64
package:        anaconda-core-24.13.7-1.fc24.x86_64
product:        Fedora
reason:         OSError: Unable to create user 99: status=3
release:        Fedora release 24 (Twenty Four)
reproducible:   Not sure how to reproduce the problem
version:        24

Comment 17 11 2016-09-02 19:24:06 UTC
*** Bug 1372823 has been marked as a duplicate of this bug. ***

Comment 18 11 2016-09-03 00:40:48 UTC
Thank you for the nearly immediate response, but I had changed it afterward and now it's all running smoothly ; Sorry to report for something so simple!

Comment 19 Miro Hrončok 2016-10-13 12:01:10 UTC
Similar problem has been detected:

Created user called 16.

cmdline:        /usr/bin/python3  /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-base
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img root=live:CDLABEL=Fedora-WS-Live-24-1-2 rd.live.image rd.live.check quiet
hashmarkername: anaconda
kernel:         4.5.5-300.fc24.x86_64
other involved packages: system-python-libs-3.5.1-7.fc24.x86_64
package:        anaconda-core-24.13.7-1.fc24.x86_64
product:        Fedora
reason:         OSError: Unable to create user 16: status=3
release:        Fedora release 24 (Twenty Four)
reproducible:   Not sure how to reproduce the problem
version:        24

Comment 20 Miro Hrončok 2016-10-13 12:07:30 UTC
Anaconda should validate the username when I enter it to the field, not install all the packages and than fail.

Comment 21 Fedora End Of Life 2017-07-25 20:52:45 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 22 Fedora End Of Life 2017-08-08 14:37:58 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.