Bug 89520 - over-complicated error messages from failed mount
Summary: over-complicated error messages from failed mount
Status: NEW
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Martin Pitt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-10 17:44 UTC by Stanislav Brabec
Modified: 2015-03-10 17:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Stanislav Brabec 2015-03-10 17:44:32 UTC
When error occurs, messages that are presented to the desktop environment, are over-complicated, unreadable by ordinary users, and additionally, they are untranslated.

Example:

Use insert exFAT volume into a system with no support for exFAT.

Current error message (with most parts untranslatable):
Error mounting /dev/sdb1 at /run/media/ill/9C33-6BBD: Command-line `mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb1" "/run/media/ill/9C33-6BBD"' exited with non-zero exit status 32: mount: unknown filesystem type 'exfat'

Expected error message: translatable
Mount failed: unknown filesystem type 'exfat'

The descriptive error message could be provided as details or simply logged into syslog.


Details:

"Error mounting /dev/sdb1 at /run/media/ill/9C33-6BBD: " comes from udisks2: udiskslinuxfilesystem.c: handle_mount() and it is untranslatable.

"Command-line `mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb1" "/run/media/ill/9C33-6BBD"' exited with non-zero exit status 32: " comes from udisks2: udisksspawnedjob.c: udisks_spawned_job_spawned_job_completed_default() and it is untranslatable.

"mount: " comes from warnx() in glibc via util-linux mount command, and it is not intended to be translated. Desktop user does not need to know what it is.

unknown filesystem type 'exfat'
This string comes from util-linux mount command. It is the core of the error message, which should be presented to user, and it is translatable.


Regarding util-linux and warnx(). util-linux currently has no support for providing machine parseable error messages.

If you are interested only in the error message, you can choose from following:
- initiate util-linux mount change to provide errors in a different format.

- simply cut string before ": and trailing EOL (in the current version of warnx() in glibc, these parts are not translatable, and string before ":" will always be "mount" in this context.

- Create small preload library with custom warnx. (If you are interested, I can write one using https://github.com/openSUSE/dlwrap.)


Note: Well, things are even worse, because desktop environment add their own strings as well. So in fact, user sees for example:

An error occurred while accessing '59.0 GiB Removable Media', the system responded: The requested operation has failed: Error mounting /dev/sdb1 at /run/media/ill/9C33-6BBD: Command-line `mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb1" "/run/media/ill/9C33-6BBD"' exited with non-zero exit status 32: mount: unknown filesystem type 'exfat'

Downstream bug: https://bugzilla.opensuse.org/show_bug.cgi?id=868069


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.