Six Stars

tWaitForFile doesn't work as expected on UNIX

Hi,

I created a simple job using 'tWaitForFile' and 'tFileCopy'. The file watcher is set to run infinitely and iterate every 10 seconds. If matching file arrives in the directory, the file gets copied to destination directory using 'tFileCopy'. This job is working as expected on Windows. 

Upon deploying this job to UNIX env and executing the ".sh" file, the job doesn't even pick the file from the directory. The 'ps' command shows the job is running continuously as expected. Can anyone help in this regard?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

As you have introduced a tInfiniteLoop you may also replace tWaitForFile by tFileExists (if you know the name) or tFileList. You should have the expected result.

TRF
15 REPLIES
Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

Hi,
Something about the permissions for the source/target folder or the file itself?

TRF
Six Stars

Re: tWaitForFile doesn't work as expected on UNIX

There are no permission issues on either the folder and files. I am placing the file manually in the source directory and then expecting this job to do the rest.

Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

Double check the permissions for the target folder.
Also, try to trace the file pathname at the différent steps.

TRF
Six Stars

Re: tWaitForFile doesn't work as expected on UNIX

I created another job without 'tWaitForFile' component to make sure there's no permission issue. The file gets copied into the target directory successfully.

Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

Can you share the component configuration? Maybe a problem with file mask or the source folder path.
Else, perhaps Talend guys will be most inspired.

TRF
Six Stars

Re: tWaitForFile doesn't work as expected on UNIX

PFA

Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

Hum... seems to be a $1,000,000 question!


TRF
Six Stars

Re: tWaitForFile doesn't work as expected on UNIX

Is this something to do with Open Studio Vs Enterprise edition? I read somewhere over web that trigger functionality is available only in Enterprise edition.

Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

Based on the documentation there is no limitation for this component https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/9NaCQViWaqc8tnoxlpM6HA
What you have on the Enterprise edition is the capability to start a job as soon a file is detected.
Maybe Sabrina @xdshi could help on this topic

TRF
Six Stars

Re: tWaitForFile doesn't work as expected on UNIX

Meanwhile, I was trying another approach as tinfiniteloop -> twaitforfile -> tCopyFile (on Windows)

The moment I manually copy the file in the source directory, the job fails with the following error:

image.pngimage.png

 

The basic setting for

1. tinfiniteloop "Wait at each iteration = 1000ms"

2. twaitforfile "Time between iterations = 1s", "Max number of iterations = 1" and "Trigger action when - a file is created". The file mask is "*.txt".

 

Any idea what would cause this error?

Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

Can you share the tfilecopy configuration?

TRF
Six Stars

Re: tWaitForFile doesn't work as expected on UNIX

image.png

Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

Well, I can't try for the moment.
What if you change the delay of tInfiniteLoop for example to 1300ms?

TRF
Twelve Stars TRF
Twelve Stars

Re: tWaitForFile doesn't work as expected on UNIX

As you have introduced a tInfiniteLoop you may also replace tWaitForFile by tFileExists (if you know the name) or tFileList. You should have the expected result.

TRF
Six Stars

Re: tWaitForFile doesn't work as expected on UNIX

Thanks, it worked using tFileList approach.