Bug 743638 - Fails with HOME=/tmp/dir
Summary: Fails with HOME=/tmp/dir
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: libreoffice
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Stephan Bergmann
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-05 15:24 UTC by Need Real Name
Modified: 2012-06-19 09:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-19 07:54:14 UTC
Type: ---
Embargoed:


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

Description Need Real Name 2011-10-05 15:24:07 UTC
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 15:24:53 UTC
Created attachment 526525 [details]
strace logs

strace log

Comment 2 Need Real Name 2011-10-05 15:26:34 UTC
Created attachment 526526 [details]
A script to convert any .xls to .html

Comment 3 Stephan Bergmann 2011-10-07 07:58:26 UTC
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 08:13:18 UTC
...but can indeed reproduce it with the LibO 3.3.3 in f15

Comment 5 Caolan McNamara 2012-01-10 14:33:17 UTC
we bumped f15 to LibO 3.3.4.1-1.fc15, is this still an issue ?

Comment 6 Need Real Name 2012-01-16 16:12:52 UTC
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 22:17:28 UTC
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 22:38:11 UTC
"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 19:25:45 UTC
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 19:27:34 UTC
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 14:27:23 UTC
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 14:28:27 UTC
Created attachment 584985 [details]
strace attached

strace attached

Comment 13 Stephan Bergmann 2012-06-15 15:50:23 UTC
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 20:28:41 UTC
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 07:54:14 UTC
(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 09:49:28 UTC
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.