Download it now!
Bug 56284 - soffice fails to start unless ~/.config exists and is writable
Summary: soffice fails to start unless ~/.config exists and is writable
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Michaël Lefèvre
URL:
Whiteboard: target:4.3.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2012-10-22 16:09 UTC by Marc Weber
Modified: 2016-02-18 16:37 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
gdb session (5.07 KB, text/plain)
2013-05-15 20:09 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Weber 2012-10-22 16:09:37 UTC
On nixos we have a custom installation. If ~/.config does not exist there is a message "The application cannot be started. An internal error has occured".

These message appear on the console:

[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed! 
Warning: failed to read path from javaldx

and using google it is possible to find the solution (create ~/.config or make sure its writable) - still it would be nicer if everything just worked out of the box.

Adding code ensuring that this directory exists and is writable should be an easy task.
Comment 1 Julien Nabet 2012-10-22 21:00:35 UTC
I reproduce this but above all but it seems normal.
I don't understand how come you don't have ~/.config with write permissions?
This directory contains the config file from a lot of applications.
Comment 2 Marc Weber 2012-10-22 21:07:55 UTC
I created a new user account - and there was no ~/.config at all.
Then I was lost with an unhelpful message for a short period of time.

I think its wrong to depend on a foreign application creating it - that's it.
Maybe its a distribution issue - too. Should .config exist in /etc/skel ?
Then the issue would be void, too
Comment 3 Julien Nabet 2012-10-22 21:13:31 UTC
(In reply to comment #2)
> I created a new user account - and there was no ~/.config at all.
> Then I was lost with an unhelpful message for a short period of time.
Ok I understand better now.

> I think its wrong to depend on a foreign application creating it - that's it.
> Maybe its a distribution issue - too. Should .config exist in /etc/skel ?
> Then the issue would be void, too
I don't know for the rest. Anyway, it could interesting to have an useful message.
Comment 4 Julien Nabet 2012-10-23 20:47:08 UTC
Michael: I reproduced the behaviour but how should LO acts?
- create ~/.config with adhoc permissions itself?
- popup a message indicating there's no ~/.config or permissions don't allow to write in it?
- other?
Comment 5 Marc Weber 2012-10-23 21:28:19 UTC
Which options are there?

a) create /etc/skel/.config - so that .config is create whenever a new user is created (doesn't seem to be common)

b) make libreoffice create that directory (700 because .config might contain sensible data - and it is what ubuntu seems to do (?))
This would solve this problem once and forever for this project only

c) Is it the task of libreoffice to create the directory? Or should the bug report forwarded to whatever library libreoffice is using to access .config?

I don't know. Software should just work - and b) will accomplish this for LibreOffice forever.

I'd not change the permission if the directory already exists.

chrome, htop both create it and set 700.
inkscape creates it and sets 711

I could test more applications - but that will not change the fact that just creating it and setting it to 700 makes everything work.
Comment 6 Julien Nabet 2012-10-24 06:00:36 UTC
Marc: thank you for your feedback.
Just to put it clear (because it wasn't said explicitly), my previous comment was for Michael Meeks that I put in copy of this tracker.
Comment 7 bfoman (inactive) 2013-05-13 10:21:44 UTC
NEW as confirmed in comment 1.
Comment 8 Michael Meeks 2013-05-13 10:48:24 UTC
To find the earliest use of ~/.config I guess we should put a breakpoint in __cxa_throw and run without the directory existing :-)

I -imagine- this is from desktop/source/app or desktop/source/deployment - but of course it could easily be in configmgr.cxx.

It'd be good to have a stack-trace for that.

It seems like: sal/osl/unx/security.c is prolly a good place to look at first:

#define DOT_CONFIG "/.config"

static sal_Bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax)
{
    sal_Char *pStr = getenv("XDG_CONFIG_HOME");

    if (pStr == NULL || strlen(pStr) == 0 || access(pStr, 0) != 0)


Patches most welcome (turned it into an easy-hack) - thanks !
Comment 9 Julien Nabet 2013-05-15 20:09:10 UTC
Created attachment 79365 [details]
gdb session

Here's a gdb session with bt
Comment 10 Björn Michaelsen 2013-10-04 18:46:57 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 11 Stephan Bergmann 2013-10-07 16:54:45 UTC
FYI, at least current master towards LO 4.2 on Linux:

* If there is no ~/.config, LO silently creates ~/libreoffice/4 instead of ~/.config/libreoffice/4 and uses that.  This is probably a bug.

* If ~/.config is a directory that is not accessible (no rwx flags) LO refuses to start with a "The application cannot be started. An internal error occurred." error box and does not create anything.

* If ~/.config is a directory that is not writeable (just r-x flags) LO refuses to start with a "The application cannot be started. User installation could not be completed." error box and does not create anything.

* If ~/.config is a file instead of a directory LO refuses to start with a "The application cannot be started. The configuration file '/.../program/bootstraprc' is corrupt." error box (whose wording does make sense, given that bootstraprc's UserIntsallation=$SYSUSERCONFIG/libreoffice/4 points at a "broken" path) and does not create anything.
Comment 12 Robinson Tryon (qubit) 2013-10-19 01:24:04 UTC
Removing comma from whiteboard (please use a space to delimit values in this field)
https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Whiteboard#Getting_Started
Comment 13 Michaël Lefèvre 2014-03-20 21:17:41 UTC
Submitted a revised patch for review to gerrit.

https://gerrit.libreoffice.org/8630

I'm adding this comment to let other know what i've done.
Comment 14 Commit Notification 2014-03-24 09:42:25 UTC
Michaël Lefèvre committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5b4b6b2aad548cdc27ba2aa7d87ff584ec7e97dd

fdo#56284 : soffice fails to start unless ~/.config exists and is writable



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Robinson Tryon (qubit) 2015-12-16 00:09:24 UTC
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp TopicCleanup )
[NinjaEdit]
Comment 16 Robinson Tryon (qubit) 2016-02-18 16:37:20 UTC
Remove LibreOffice Dev List from CC on EasyHacks
(curtailing excessive email to list)
[NinjaEdit]