Bug 1096545

Summary: userWindow.py:435:on_userWin_ok_button_clicked:RuntimeError: couldn't open `/var/spool/mail/user': No such file or directory
Product: [Fedora] Fedora Reporter: Raphael Groner <projects.rg>
Component: system-config-usersAssignee: Nils Philippsen <nphilipp>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 20CC: mitr, nphilipp, projects.rg
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: system-config-users-1.3.6-1.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-23 16:05:37 UTC Type: Bug
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
backtrace
none
backtrace none

Description Raphael Groner 2014-05-11 22:56:15 UTC
Created attachment 894477 [details]
backtrace

Description of problem:
userWindow.py:435:on_userWin_ok_button_clicked:RuntimeError: »/var/spool/mail/build« konnte nicht geöffnet werden: Datei oder Verzeichnis nicht gefunden

Version-Release number of selected component (if applicable):
system-config-users-1.3.5-1.fc20

How reproducible:
yes

Steps to Reproduce:
1. run system-config-users from a terminal
2. click on "create user" and enter some credentials
3. click on OK

Actual results:
The main window doesn't show the new user in list, abrt reports a crash, when try to add users the dialog is shown with grayed items.

Expected results:
A new user gets added to list immediately without the need to restart system-config-users.

Additional info:
$ system-config-users 
Traceback (most recent call last):
  File "/usr/share/system-config-users/userWindow.py", line 435, in on_userWin_ok_button_clicked
    self.parent.ADMIN.addUser(userEnt, mkhomedir=True)
RuntimeError: »/var/spool/mail/test2« konnte nicht geöffnet werden: Datei oder Verzeichnis nicht gefunden

cmdline: /usr/bin/python /usr/share/system-config-users/system-config-users.py

ls: cannot access /var/spool/mail: No such file or directory

$ mount |grep spool
tmpfs on /var/spool type tmpfs (rw,relatime,rootcontext=system_u:object_r:var_spool_t:s0,seclabel,size=367532k,gid=7)

Comment 1 Raphael Groner 2014-05-11 23:05:58 UTC
Created attachment 894478 [details]
backtrace

Comment 2 Nils Philippsen 2014-05-23 09:05:51 UTC
I wonder why /var/spool is a (probably empty) tmpfs on your system. Is this running from hard disk, or from live media?

Comment 3 Raphael Groner 2014-05-24 12:21:32 UTC
The system is running from hard disk. I mount /var/spool as tmpfs in /etc/fstab, as suggested in various articles for SSD optimizations. It's not completely empty. Notice the following special mount option as suggested in büg #1069845: "rootcontext=system_u:object_r:var_spool_t:s0".

$ mount |grep spool
tmpfs on /var/spool type tmpfs (rw,relatime,rootcontext=system_u:object_r:var_spool_t:s0,seclabel,size=367532k,gid=7)

$ ls /var/spool
cron  cups

I wonder what should create /var/spool/mail.

Comment 4 Raphael Groner 2014-09-07 18:50:59 UTC
ping?

Comment 5 Nils Philippsen 2014-10-20 15:21:04 UTC
Sorry for not getting back to you earlier.

(In reply to Raphael Groner from comment #3)
> I mount /var/spool as tmpfs in /etc/fstab, as suggested in various articles for SSD optimizations.

IMO, that optimization is bogus: At least on Fedora, the directory entries in /var/spool aren't volatile -- it's just a bunch of directories belonging to packages, so they only get written when a package is updated. There's no throw-away content which you would prevent from being written onto the SSD by making /var/spool a tmpfs.

> I wonder what should create /var/spool/mail.

Despite that yours is an unsupported configuration, this question is actually easy enough to answer: if you need some files or directories in a tmpfs, then you have to drop configuration into /etc/tmpfiles.d which takes care of creating the respective files or directories during the boot process. Mind that you need to do that for all directories that could potentially live in /var/spool, so you have to check all installed packages, and re-check if you install new ones (or if you're particularly unlucky, after updating installed packages where the new version brings a new directory there). If you ask me, that's too much hassle :D.

Anyway, I'll patch s-c-users so it at least catches the exception, presents the error message to the user and then bails out (as the result isn't deterministic at that point, the user needs to clean up things manually).

Comment 6 Fedora Update System 2014-10-21 21:15:19 UTC
system-config-users-1.3.6-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/system-config-users-1.3.6-1.fc21

Comment 7 Fedora Update System 2014-10-21 21:15:25 UTC
system-config-users-1.3.6-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/system-config-users-1.3.6-1.fc20

Comment 8 Fedora Update System 2014-10-21 21:15:30 UTC
system-config-users-1.3.6-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/system-config-users-1.3.6-1.fc19

Comment 9 Fedora Update System 2014-10-22 19:13:07 UTC
Package system-config-users-1.3.6-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-users-1.3.6-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-13452/system-config-users-1.3.6-1.fc21
then log in and leave karma (feedback).

Comment 10 Raphael Groner 2014-10-23 16:05:37 UTC
(In reply to Nils Philippsen from comment #5)
Thanks for the explanation. I understand the point about a conflict with tmpfs features and the initial idea and expectation in package logic of /var folders to be kept persistently over reboots.

Comment 11 Fedora Update System 2014-11-01 01:31:09 UTC
system-config-users-1.3.6-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2014-11-01 01:39:41 UTC
system-config-users-1.3.6-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2014-11-01 16:54:21 UTC
system-config-users-1.3.6-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.