Liferay portal server offers a pdf export based on LibreOffice. It requires that LibreOffice is started in headless mode and accepts requests via a socket. Liferay uses com.artofsolving.jodconverter.openoffice to start the conversion.
Starting command of libre office:
/opt/libreoffice5.3/program/soffice.bin --backtrace --headless --nologo --nofirststartwizard --accept="socket,host=127.0.0.1,port=8100;urp"
When starting the a conversion of an article, a html file is written to a temp folder and libreoffice "asked" to create a pdf version of the file. Libreoffice creates an empty pdf file, than hangs with 100% CPU load.
While the process hangs, files like these can be seen:
-rw-r--r-- 1 liferay liferay 0 4. Apr 15:25 document9023065231684639692.pdf
-rw-r--r-- 1 liferay liferay 627114 4. Apr 15:25 document3598502034899325534.html
While libreoffice hangs, all other conversion attempts, don't return either.
Killing the libreoffice process and converting above html file directly works flawless and creates a pdf version of the html page as expected. So it probably has nothing to do with the file itself but with the way the conversion is started.
/opt/libreoffice5.3/program/soffice.bin --headless --convert-to pdf document9023065231684639692.html
I have used strace and gdb to check where it hangs. Apparently the function rtl_cache_wsupdate_all runs in an endless loop and never finishes.
I looked a bit into the code, I guess the destructor of the cache is never called and the relevant flag is never set to true, so the loop in that function never completes. To me, this looks more of a symptom than the root cause, but it might give a hint in the right direction.
Steps to Reproduce:
1. Start LibreOffice in Headless Mode
2. Configure Liferay 6.2 to use Libre Office for pdf export
3. Export an article from Liferay
Sorry, that I can't offer an easier way to reproduce it, but I don't have another way to start a conversion through a socket.
Libre Office hangs without completing the conversion.
Libre Office finishes conversion of the html file and "returns".
User Profile Reset: No
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Thank you for reporting the bug.
it seems you're using an old version of LibreOffice.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Dear Bug Submitter,
This bug has been in NEEDINFO status with no change for at least
6 months. Please provide the requested information as soon as
possible and mark the bug as UNCONFIRMED. Due to regular bug
tracker maintenance, if the bug is still in NEEDINFO status with
no change in 30 days the QA team will close the bug as INSUFFICIENTDATA
due to lack of needed information.
For more information about our NEEDINFO policy please read the
wiki located here:
If you have already provided the requested information, please
mark the bug as UNCONFIRMED so that the QA team knows that the
bug is ready to be confirmed.
Thank you for helping us make LibreOffice even better for everyone!
Dear Bug Submitter,
Please read this message in its entirety before proceeding.
Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):
a) Provide details of your system including your operating
system and the latest version of LibreOffice that you have
confirmed the bug to be present
b) Provide easy to reproduce steps – the simpler the better
c) Provide any test case(s) which will help us confirm the problem
d) Provide screenshots of the problem if you think it might help
e) Read all comments and provide any requested information
Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:
a) respond via email
b) update the version field in the bug or any of the other details
on the top section of our bug tracker