FS#58873 - [systemd] systemd-sysusers failing to create system users with no helpful log

Attached to Project: Arch Linux
Opened by Mathieu (AgentMat) - Tuesday, 05 June 2018, 06:43 GMT
Last edited by Doug Newgard (Scimmia) - Monday, 01 October 2018, 14:57 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Christian Hesse (eworm)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:

systemd-sysusers is failing at startup and when launched manually, and provided log does not help to find the issue.

$ journalctl -u systemd-sysusers
-- Logs begin at Sat 2015-02-14 11:06:16 CET, end at Tue 2018-06-05 08:38:14 CEST. --
Apr 04 09:39:46 Gnosis systemd-sysusers[235]: Failed to write files: Invalid argument
Apr 04 09:39:46 Gnosis systemd[1]: systemd-sysusers.service: Main process exited, code=exited, status=1/FAILURE
Apr 04 09:39:46 Gnosis systemd[1]: systemd-sysusers.service: Failed with result 'exit-code'.
Apr 04 09:39:46 Gnosis systemd[1]: Failed to start Create System Users.
-- Reboot --
Apr 18 09:05:11 Gnosis systemd[1]: systemd-sysusers.service: Main process exited, code=exited, status=1/FAILURE
Apr 18 09:05:11 Gnosis systemd[1]: systemd-sysusers.service: Failed with result 'exit-code'.
Apr 18 09:05:11 Gnosis systemd[1]: Failed to start Create System Users.
-- Reboot --
May 12 10:30:50 Gnosis systemd-sysusers[227]: Failed to write files: Invalid argument


$ systemctl list-units --state=failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● systemd-sysusers.service loaded failed failed Create System Users

LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.




Launching the update manually produces the same error:

$ sudo systemd-sysusers
Creating group render with gid 992.
Creating group cups with gid 209.
Creating user cups (cups helper user) with uid 209 and gid 209.
Failed to write files: Invalid argument

file permission looks fine

$ ls -l /etc/passwd /etc/group
-rw-r--r-- 1 root root 985 Mar 17 08:48 /etc/group
-rw-r--r-- 1 root root 1637 Mar 17 08:48 /etc/passwd


After manually adding the groups and user, systemd-sysusers has nothing left to do but still reports a failure :

$ sudo systemd-sysusers
Failed to write files: Invalid argument



Additional info:
* package version(s)
systemd 238.133-1
* config and/or log files etc.


Steps to reproduce:

I suppose the issue is specific to my installation. The failure is reported every reboot; starting systemd-sysusers manually also always shows the error.
This task depends upon

Closed by  Doug Newgard (Scimmia)
Monday, 01 October 2018, 14:57 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Config issues
Comment by dan (dansman) - Friday, 06 July 2018, 00:17 GMT
Hi

I have the same problem.

[code]systemctl list-units --state=failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● systemd-sysusers.service loaded failed failed Create System Users[/code]

[code]sudo systemd-sysusers
Creating group adbusers with gid 969.
Creating group render with gid 968.
Failed to write files: Invalid argument[/code]

[code]ls -l /etc/passwd /etc/group
-rw-r--r-- 1 root root 932 Jul 5 10:17 /etc/group
-rw-r--r-- 1 root root 1599 Jul 5 10:17 /etc/passwd[/code]

[quote=Mathieu]After manually adding the groups and user, systemd-sysusers has nothing left to do but still reports a failure :

$ sudo systemd-sysusers
Failed to write files: Invalid argument

Steps to reproduce:

I suppose the issue is specific to my installation. The failure is reported every reboot; starting systemd-sysusers manually also always shows the error.[/quote]

Same here.
Comment by loqs (loqs) - Friday, 06 July 2018, 00:36 GMT Comment by dan (dansman) - Friday, 06 July 2018, 00:54 GMT
I have a problem with
Creating temporary files...error: command failed to execute correctly
as well.

Is it possible that the "Creating tempor ... " problem interrupt systemd-sysusers?

Comment by Daniel Albarral (albarralnunez) - Saturday, 21 July 2018, 11:20 GMT
Same here, I'm experimenting both problems.
I discover the problem installing sddm, the installer was not able to create the system user.

When I was installing sddm I had the following output:
https://pastebin.com/zdGQwBPg

Finally I realized that the PKGBUILD was running the following command successfully:
install -Dm644 "$srcdir"/sddm.sysusers "$pkgdir"/usr/lib/sysusers.d/sddm.conf

The error comes when it tries to run:

systemd-sysusers

Creating group vboxsf with gid 109.
Creating group vboxusers with gid 108.
Creating group gitlab-runner with gid 107.
Creating user gitlab-runner (GitLab Runner) with uid 107 and gid 107.
Creating group sddm with gid 973.
Creating user sddm (Simple Desktop Display Manager) with uid 973 and gid 973.
Failed to write files: Invalid argument


Comment by Jeff (jgmdev) - Friday, 28 September 2018, 20:03 GMT
I'm having the same issue with the realtime-privileges package...

Output:
Creating group realtime with gid 994.
Failed to write files: Invalid argument
Comment by loqs (loqs) - Friday, 28 September 2018, 20:17 GMT
Please read through https://bbs.archlinux.org/viewtopic.php?id=240076
Then check that every entry in /etc/group is properly formatted
Comment by Mathieu (AgentMat) - Friday, 28 September 2018, 23:04 GMT
Indeed there was a typo in my /etc/group "proc:x:26:polkitd:" instead of "proc:x:26:polkitd" (without the extra ":"). Fixing /etc/group fixed the issue on my side. I'm pretty sure I never manually edited /etc/group, so I'm wondering what could have introduced the typo.

Many thanks !
Comment by Jeff (jgmdev) - Saturday, 29 September 2018, 16:20 GMT
Thanks @loqs! So many months facing this issue and it was also an error 'users:x:100:http:myuser' instead of 'users:x:100:http,myuser'.

I just wonder why grpck doesn't catches this... Maybe this should be improved in the grpck tool, wonder where can this issue be reported? Also the systemd-sysusers binary should be more explicit about what is causing it to fail...
Comment by loqs (loqs) - Saturday, 29 September 2018, 17:04 GMT
I would suggest opening a RFE (Request For Enhancement) with upstream systemd asking for systemd-sysusers to provide more informative failure output. https://github.com/systemd/systemd/issues
grpck from shadow upstream seems similar to https://github.com/shadow-maint/shadow/issues/94

Loading...