tFileExcelOutput component giving Permission denied exception

One Star

tFileExcelOutput component giving Permission denied exception

Hi All,
I am working on talend 5.6.2 data services through big data.
I writing a data to excel using tFileExcelOutput component and running the job from unix env using sh file.
I am running the job parallel from two UNIX terminal with two diff users.
Job from second window is getting failed with the below error

Exception in component tFileOutputExcel_2
java.lang.RuntimeException: java.io.IOException: Permission denied
       at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:628)
       at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:645)
       at org.talend.ExcelTool.prepareXlsxFile(ExcelTool.java:131)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_4Process(ConfigCheck_Copy.java:4478)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_3Process(ConfigCheck_Copy.java:11962)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_8Process(ConfigCheck_Copy.java:11350)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_12Process(ConfigCheck_Copy.java:10652)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_13Process(ConfigCheck_Copy.java:10244)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_1Process(ConfigCheck_Copy.java:9873)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlConnection_1Process(ConfigCheck_Copy.java:9322)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tHDFSConnection_2Process(ConfigCheck_Copy.java:18039)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tJava_3Process(ConfigCheck_Copy.java:18300)
       at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy$6.run(ConfigCheck_Copy.java:18922)
Caused by: java.io.IOException: Permission denied
       at java.io.UnixFileSystem.createFileExclusively(Native Method)
       at java.io.File.createNewFile(File.java:1006)
       at java.io.File.createTempFile(File.java:1989)
       at org.apache.poi.util.TempFile$DefaultTempFileCreationStrategy.createTempFile(TempFile.java:105)
       at org.apache.poi.util.TempFile.createTempFile(TempFile.java:60)
       at org.apache.poi.xssf.streaming.SheetDataWriter.createTempFile(SheetDataWriter.java:80)
       at org.apache.poi.xssf.streaming.SheetDataWriter.<init>(SheetDataWriter.java:63)
       at org.apache.poi.xssf.streaming.SheetDataWriter.<init>(SheetDataWriter.java:68)
       at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheetDataWriter(SXSSFWorkbook.java:292)
       at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:69)
       at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:624)
       ... 12 more

Even a small help is appreciated. Thanks in advance.
Moderator

Re: tFileExcelOutput component giving Permission denied exception

Hi,
Does the user have the read and execute permission on application?
If not, have you tried to add read/execution right on the desired ?TalendOpenStudio-*? binary to see if it is working well?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tFileExcelOutput component giving Permission denied exception

Hi,
Thanks for reply.
I am able to debug it. Problem is talend is creating a temporary directory named "poifiles" in systems temp space for creating ".xlsx" file.
If we run the job with two users parallelly, then second user's process is trying to create "poifiles" which is already created and used by first user's process. So the second process has to wait until the first process completes its work and delete that temp directory created by it.
So, Now how can i go forward with this. It seems to be bug which i think so.
Thanks.
Employee

Re: tFileExcelOutput component giving Permission denied exception

Hello,
You can workaround this problem by explicitly setting the -Djava.io.tempdir, in the Talend component there is no
hard coding about the tmp somewhere.
The problem should be coming from the libraries, it is storing the file that you mention in your system java temp folder
which on linux by default is /tmp.
To avoid the problem in your scenario you need to set the -Djava.io.tempdir=$ROOT_PATH at the job level before exporting
as jobscript, so any person running the job will use the folder where the job is as a java temp directory.
Hope this help you.
Thanks,
Five Stars

Re: tFileExcelOutput component giving Permission denied exception

Hi @adiallo

 

How to set the -Djava.io.tempdir=$ROOT_PATH at the job level before exporting
as jobscript ?

 

Thank's

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now