Bug 743638 - Fails with HOME=/tmp/dir
Fails with HOME=/tmp/dir
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: libreoffice (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Stephan Bergmann
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-05 11:24 EDT by Need Real Name
Modified: 2012-06-19 05:49 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-19 03:54:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
strace logs (281.46 KB, application/zip)
2011-10-05 11:24 EDT, Need Real Name
no flags Details
A script to convert any .xls to .html (1.92 KB, application/octet-stream)
2011-10-05 11:26 EDT, Need Real Name
no flags Details
strace log (645.36 KB, text/plain)
2012-01-22 14:27 EST, Need Real Name
no flags Details
strace attached (54.67 KB, application/zip)
2012-05-16 10:28 EDT, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2011-10-05 11:24:07 EDT
I am using libreoffice for batch conversion .xls -> .html.
Script attached.
When HOME directory is not set 
everything works OK (strace is ss.OK.txt)

soffice_auto -calc -nologo -nofirststartwizard -view -norestore -headless -nolockcheck -unaccept=all 'macro:///Tools.ModuleConvertFile.SaveAsHTML("/tmp/nybits_anytohtml_a9_UoGY.xls","/tmp/nybits_anytohtml_a9_UoGY.xls.html","HTML (StarCalc)")'

but when HOME is set to some directory in /tmp/ 
the conversion fails (strace is ss.FAIL.txt)
there was no such problem in openoffice.


where soffice_auto is just a direct call of soffice.bin
cat /usr/local/bin/soffice_auto 
#!/bin/bash
#/bin/rm -f /tmp/OSL_PIPE*
#strace /usr/lib64/libreoffice/program/soffice.bin "$@"
exec /usr/lib64/libreoffice/program/soffice.bin "$@"
Comment 1 Need Real Name 2011-10-05 11:24:53 EDT
Created attachment 526525 [details]
strace logs

strace log
Comment 2 Need Real Name 2011-10-05 11:26:34 EDT
Created attachment 526526 [details]
A script to convert any .xls to .html
Comment 3 Stephan Bergmann 2011-10-07 03:58:26 EDT
I cannot reproduce this with a recent master build of LibO (towards LibO 3.5).

However, what you should always do is call soffice instead of soffice.bin.
Comment 4 Stephan Bergmann 2011-10-07 04:13:18 EDT
...but can indeed reproduce it with the LibO 3.3.3 in f15
Comment 5 Caolan McNamara 2012-01-10 09:33:17 EST
we bumped f15 to LibO 3.3.4.1-1.fc15, is this still an issue ?
Comment 6 Need Real Name 2012-01-16 11:12:52 EST
Still exist in libreoffice-core-3.4.4.2-7.fc16.x86_64
This is an extremely annoying bug - I cannot use libreoffice 
as a batch converter of files.
Comment 7 Stephan Bergmann 2012-01-16 17:17:28 EST
I can no longer reproduce this, neither with a current build of vanilla libreoffice-3-4 (towards LO 3.4.6) nor with libreoffice-core-3.4.4.2-6.fc16.x86_64, but I'm not entirely sure I try to reproduce it in a way that is relevant to what fails for the submitter, nor in the same way I tried to reproduce it last October.

What I tried now is, with a /tmp/test.xls created:

> rm -rf ~/.libreoffice

> soffice
# "Tools - Macros - Organize Macros - LibreOffice Basic... - Macro from -
# My Macros - Standard - Module1 - Edit", paste (de-XML-ified) text content
# of <script:module> of attached ModuleConvertFile.xba, Save and Quit

> soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")'

> rm /tmp/test.xls.html
# no error (i.e., file had been written)

> mkdir /tmp/HOME

> HOME=/tmp/HOME soffice
# "Tools - Macros - Organize Macros - LibreOffice Basic... - Macro from -
# My Macros - Standard - Module1 - Edit", paste (de-XML-ified) text content
# of <script:module> of attached ModuleConvertFile.xba, Save and Quit

> HOME=/tmp/HOME soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")'

> rm /tmp/test.xls.html
# no error (i.e., file had been written)
Comment 8 Stephan Bergmann 2012-01-16 17:38:11 EST
"Need Real Name," also not sure why you want to set HOME to some temp dir in the first place.  Are you aware of soffice -env:UserInstallation=file:///tmp/foo to let soffice use a non-standard user configuration directory (instead of the default ~/.libreoffice)?
Comment 9 Need Real Name 2012-01-22 14:25:45 EST
in rpm -q libreoffice-core
libreoffice-core-3.4.4.2-7.fc16.x86_64
it is still does not work
cd /tmp/
soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")'

test.xls is successfully converted to test.xls.html
rm test.xls.html
mkdir /tmp/K ; export HOME=/tmp/K/
soffice -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")'

no test.xls.html created

echo $?
0

/usr/lib64/libreoffice/program/soffice.bin  -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")'

same thing
strace /usr/lib64/libreoffice/program/soffice.bin  -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' >/tmp/diag.txt 2>&1


the reason I need to have HOME= set is to run 
10-20 soffice at once in background for batch processing.
soffice does some user account locking, and setting HOME= 
was the only reliable way to achieve this.
 I used all version of soffice and early versions of openoffice 
without a problem.
Comment 10 Need Real Name 2012-01-22 14:27:34 EST
Created attachment 556814 [details]
strace log

diag attached

ls -lstrAF /tmp/K/
total 4
4 drwxrwxr-x. 3 mal mal 4096 Jan 22 14:16 .libreoffice/

strace /usr/lib64/libreoffice/program/soffice.bin  -calc -nologo -nofirststartwizard -view -norestore -headless -nolockckeck -unaccept=all 'macro:///Standard.Module1.SaveAsHTML("/tmp/test.xls","/tmp/test.xls.html","HTML (StarCalc)")' >/tmp/diag.txt 2>&1
Comment 11 Need Real Name 2012-05-16 10:27:23 EDT
In F17 The script stopped working at all.
libreoffice-calc-3.5.2.1-6.fc17.x86_64

strace /usr/lib64/libreoffice/program/soffice.bin -calc -nologo -nofirststartwizard -view -norestore -headless -nolockcheck -unaccept=all 'macro:///Tools.ModuleConvertFile.SaveAsHTML("/tmp/nybits_anytohtml_C4dpWHs.xls","/tmp/nybits_anytohtml_C4dpWHs.xls.html","HTML (StarCalc)")'

consumes 100% CPU and no results in 10 minutes.
Comment 12 Need Real Name 2012-05-16 10:28:27 EDT
Created attachment 584985 [details]
strace attached

strace attached
Comment 13 Stephan Bergmann 2012-06-15 11:50:23 EDT
re comment 9:  Where is your SaveAsHTML BASIC code stored?  Because, if it is stored under "My Macros - Standard - Module1" (see "Tools - Macros - Organize Macros - LibreOffice Basic..."), then it of course won't be available to LibreOffice if you change HOME.  Just to clarify...

re comment 11:  The script still works fine for me on F17.
Comment 14 Need Real Name 2012-06-18 16:28:41 EDT
I put the script to 
/usr/lib64/libreoffice/share/basic/Tools/ModuleConvertFile.xba
because it need to be available for all users
and edited /usr/lib64/libreoffice/share/basic/Tools/script.xlb
to add it to the list.

The script did not work at all after F17 install.
No matter with HOME=/tmp/ set or unset.

Now the script works again. 
Also it now started to work with HOME=/tmp/tempdir/ set!!!
rpm -q --last libreoffice-calc
libreoffice-calc-3.5.4.2-1.fc17               Sat 09 Jun 2012 05:31:13 AM EDT

It definitely did not work a month ago. 
Something very strange.
Comment 15 Stephan Bergmann 2012-06-19 03:54:14 EDT
(In reply to comment #14)
> Also it now started to work with HOME=/tmp/tempdir/ set!!!

So I understand we can close this as NOTABUG now.  (Feel free to reopen if a scenario comes up that still does not work.)
Comment 16 Need Real Name 2012-06-19 05:49:28 EDT
Yes.
Looks this bug was fixed probably at libreoffice-calc-3.5.4.2-1.fc17 update.

Note You need to log in before you can comment on or make changes to this bug.