tfiledelete Strange behaviour

Eight Stars

tfiledelete Strange behaviour

Hi All,

I want to delete some zip files after my Job completition process. I am taking a Path like "C:/Users/aghosh46/Desktop/SRCFILES" in the context Variable of Parent Job. and Now Passing that Value to ChildJob for File Deletions in tpostjob. Here in tfilelist giving Directory Name as context.FilePath+"/". In tfiledelete using filelist's Global Variable Current Filepath. Strange Part is when tpostjob starting that FileDeletion Child Job is failing saying Filename.zip can not be deleted. Whereas In a testJob without any contexts The Job is deleting the Zip Files.Dont know where I am missing something.

 

Eight Stars

Re: tfiledelete Strange behaviour

Six Stars

Re: tfiledelete Strange behaviour

I cannot reproduce the issue. Maybe remove the +"/" ?

Eight Stars

Re: tfiledelete Strange behaviour

getting error some thing like in attached.One More thing in tfilelist I gave context.filepath+"/" in my testJob. In there also it is working perfectly fine. @shong

Six Stars

Re: tfiledelete Strange behaviour

Also, if your parent job is passing the directory, it would more than likely pass it using "\" instead of "/." Under advanced settings in the tFileList, check "Format file path to slash(/) style"

Eight Stars

Re: tfiledelete Strange behaviour

Hi @yilengli,

From My Parent job Directory passing like Value "C:/Users/aghosh46/Desktop/SRCFILES" which is in context.filepath. Now This will be a user given Path.One More thing In the FileWatcher Component tWaitforFile I am using FilePath as context.filepath+"/" which is working absolutely fine. I have tried using that settings also which U mentioned.I also removed "/" in the tfilelist Directory. Not working still. Smiley Sad still that same error is coming 

Exception in component tFileDelete_1 (J_CON_NADL_BRAND_EXTRACT_FILEDELETE)
java.lang.RuntimeException: File C:\Users\aghosh46\Desktop\SRCFILES\AVEENO_EMAIL_CAMP_SEND_OPENS_11012017_TO_12312017.zip can not be deleted.

 

Eight Stars

Re: tfiledelete Strange behaviour

Eight Stars

Re: tfiledelete Strange behaviour

One thing i am not able to understand here is the Job is not taking the slash /. It is always picking the opposite one.
Nine Stars

Re: tfiledelete Strange behaviour

Hi,

 

Please provide your job screen if possible.

 

Regards,

Veeru Boppudi
Six Stars

Re: tfiledelete Strange behaviour

It is taking the slash /, but its printing the actual path recognized by the operating system. The "/" is just a java preference because "\" is an escape character.

Thirteen Stars

Re: tfiledelete Strange behaviour

@abhi90, you need to verify the the folder/file does have right permessionsto delete from Talend and also can you check that zip folder has not corrupted. just for your information,you need to configure below way.Untitled.png

Manohar B
Eight Stars

Re: tfiledelete Strange behaviour

Hi @manodwhb@yilengli@vboppudi@rhall_2_0,

I have attached my settings in this comment.Still the problem persists.

Sixteen Stars

Re: tfiledelete Strange behaviour

This *could* be related to the timing of the call. Does this work if not connected to a tPostJob?

Eight Stars

Re: tfiledelete Strange behaviour

Hi @rhall_2_0,

Yes when I am testing in my test job there it's perfectly working fine. Even I tried the same context settings and everything.There it is perfectly working fine.

Sixteen Stars

Re: tfiledelete Strange behaviour

Connect it to a tPostJob in your test job and see if it fails. If it does, then you have found a bug.

Eight Stars

Re: tfiledelete Strange behaviour

Hi @rhall_2_0,

Yes You are right. This is a Bug. when I connected it to my tpostjob of my TestJob It failed again. Where as FilePath is printing. 

Hi @shong@xdshi@agershenson 

Please let me know How to open this Issue in Bugtracker. I have attached settings,JobLog with this Comments.One More thing I tried tfiledelete in my SubJobs of main Job. There also it is not working.

 

Eight Stars

Re: tfiledelete Strange behaviour

One More thing add over here.

When I am using tfilelist and tfiledelete in my Parent without creating a ChildJob then after 35 File Deletion same issue is coming in tfiledelete. which should not be the case.

Eight Stars

Re: tfiledelete Strange behaviour

Hi All,

 

@shong@xdshi@agershenson can u let me know how to open a bug?

Eight Stars

Re: tfiledelete Strange behaviour

One thing to update over here is,

My Delete Job is working deactivating other Child Jobs keeping old files. But when I am activating the SubJobs the .zip files Talend is creating in runtime tfiledelete is failing only that time.

@rhall_2_0

Eight Stars

Re: tfiledelete Strange behaviour

it is happening in Talend 6.4

Eight Stars

Re: tfiledelete Strange behaviour

Hi Admins,

Can you please confirm it as 6.4 Bug that tfiledelete can't delete files which is been created during the JobRun in tpostjob? @yilengli @rhall_2_0

Thirteen Stars

Re: tfiledelete Strange behaviour

@abhi90,i was using 6.4 DI and able to delete the file using tPostJob,which has created in Job run.

Manohar B
Sixteen Stars

Re: tfiledelete Strange behaviour

It's clearly not a 6.4 bug then. Thanks for pointing this out @manodwhb

Eight Stars

Re: tfiledelete Strange behaviour

Hi @manodwhb,

Have you used tfilelist? and used tfilelist Current FilePath before deleting it for deleting the files

Community Manager

Re: tfiledelete Strange behaviour

Hi abhi90
I can't reproduce this issue on version 6.4.1. Why don't you pass the current file name to child job for deleting?
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
I see you only pass the current folder path to child job. There might be a design issue in your job.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Eight Stars

Re: tfiledelete Strange behaviour

Hi @shong,

The files are generating in Runtime(During JobRun) by Talend. The Delete Job should be in PostJob. and My requirement is to delete the .zip files created by Child Jobs Flows in Parent Job. So in tpostjob I have scan that Directory and iterate tfilelist current filepath.

Community Manager

Re: tfiledelete Strange behaviour

Hi abhi90


Can you export your testing job which can reproduce the issue and send it to me vie email?


Regards

Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Eight Stars

Re: tfiledelete Strange behaviour

Hi @shong,

Sure I will send u the Job tonight with the details. can you please provide me your email address? 

Eight Stars

Re: tfiledelete Strange behaviour

Hi @shong,

Can You please tell me your any mailid in which I can send u the Job

Eight Stars

Re: tfiledelete Strange behaviour

Hi @shong,

I have sent u my Job which is having issue. it is built in 6.4.1 Big Data