Issue
- We have configured the text extraction functionality in an external process using the configuration:
text.extraction.fork.process.enabled=truetext.extraction.fork.process.mime.types=application/x-tika-ooxml,application/pdf
- But when we try to execute a reindexation process, the execution of the external process is not working, following error is thrown:
2023-01-13 11:05:00.849 ERROR [default-13][FileImpl:483] com.liferay.petra.process.ProcessException: java.io.IOException: Broken pipe
com.liferay.petra.process.ProcessException: java.io.IOException: Broken pipe
at com.liferay.petra.process.local.LocalProcessExecutor.execute(LocalProcessExecutor.java:122)
at com.liferay.portal.util.FileImpl.lambda$extractText$0(FileImpl.java:441)
at com.liferay.registry.internal.RegistryImpl.callService(RegistryImpl.java:71)
at com.liferay.portal.util.FileImpl.extractText(FileImpl.java:437)
at com.liferay.portal.kernel.util.FileUtil.extractText(FileUtil.java:165)
at com.liferay.portal.kernel.search.DocumentImpl.addFile(DocumentImpl.java:159)
at com.liferay.document.library.internal.search.spi.model.index.contributor.DLFileEntryModelDocumentContributor.contribute(DLFileEntryModelDocumentContributor.java:114)
[ommited]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.IOException: Broken pipe
at java.base/java.io.FileOutputStream.writeBytes(Native Method)
at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:127)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1873)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.write(ObjectOutputStream.java:1844)
at java.base/java.io.ObjectOutputStream.write(ObjectOutputStream.java:708)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1873)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(ObjectOutputStream.java:1911)
at java.base/java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1572)
at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at com.liferay.petra.process.local.LocalProcessExecutor.execute(LocalProcessExecutor.java:97)
How can I fix this error?
Environment
- Liferay DXP 7.3
Resolution
- The text extraction functionality in an external process executes the
javaprocess that is available in the system PATH of the Liferay user. - The reported error
com.liferay.petra.process.ProcessException: java.io.IOException: Broken pipecan be produced if the java binary that is available in the system PATH is not the same as the java binary used by the application server. - To check this:
- Open a shell session using the same system user used to execute the application server
- Execute
which javato locate the available java binary in the PATH environment (usewhere javain Windows environments) - Execute
ps -ef | grep javato get the java binary path used by the application server (use Task Manager in Windows) - Check that both java binary paths are the same.
- If they don't match, to fix it, change the system PATH configuration in order to point to the same java binary as the one of the application server or change the configuration to the application server if it is using the wrong java binary