Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone
I have a Windows .BAT batch generated by Tqalend DI 6.4.1 file which I run interactively from Command Shell DOS windows and it works.
This is on Windows 10 latest version.
The Talend jobs take several minutes and up to 30 min to run.
When I schedule the same batch file in Windows Task Scheduler the task stars OK but it immediately returns code 0 (i.e. success) and finishes.
The Talend job inside that batch file does not fun at all (i.e. completes immediately, returning success to the .BAT file).
If there is an error returned from the JAR file I can not see it inside scheduler, it gets swallowed and reported as success back to Windows.
Googling around - the only issue I found was due to mapped disk drive letters and network drives using \\server\share\folder.
To the best of my knowledge my package only use C: drive.
It also connects to HTTP, uses tREST, uses AWS cloud.
I put some debugging code in BAT file which creates a local folder after the JAR file is run just to see if the batch file runs until the last line.
It certainly does run, the folder (MKDIR command) gets created immediately after Talend JAR file is run.
So I am certain that the batch file runs but the Talend JAR file exits immediately.
The PATH is correctly set up, because I put compile and run a Hello World Java program immediately before the Talend JAR file and it compiles, creates .class file successfully.
Have anyone encountered this problem? Any ideas what could be the problem?
thanks
Found the problem.
I searched the Java generated code, there was a reference to the Redshift JDBC driver LOG file which was located on a mapped network drive U:\workspace....
It was something I did not set, Talend DI picked it up from my workspace default settings, so it was a land mine ready to explode, which it did once I run in Windows task scheduler.
Given this happened "behind my back" I did not check this.
I changed the JDBC log file to point to C:\ instead of mapped drive U:\ and it worked.
This is a problem/bug with Java generated by Talend, IMHO.
If Talend Java code not access a mapped drive such as U:\workspace drive running from task scheduler then it must report ERROR code back to the Windows Command shell.
Instead it just exits and it reports exit code 0, success, which task scheduler reports in job history.
Windows task scheduler is also an evil piece of software, because it does not allow the use the mapped disk drive letters but this is the devil we know, it has always been this way.
I hope this helps the next poor unfortunate who is using Windows Task Scheduler with Talend DI Java.
generally it could depend from Your Job design
but first of all - try (if not already) to edit task in scheduler and set start folder to folder where .bat file located
Start in (optional)
thanks, done that, as I said the job runs and it creates files in same batch file where Talend DI JAR file is called, which i used for debugging to see if the batch file executes at all.
so task scheduler finds the batch file, run it, but the actual Talend JAR file execution either crashes but still returns success to the batch file (code=0) or something else prevents JAR file from running at all inside Task scheduler but the error code is still returned success (0).
I was wondering of some Java JVM -D settings needs to be set up when it runs inside Windows Task Scheduler?
As I said, I am using REST API, AWS Cloud.
generally not IF job set in scheduler with same user credentials as it tested in CMD windows
I have many Jobs with AWS, REST and any other functional run from Windows (and 10 and server) - no one of them was not require additional changes.
in other case need check - is this user have access to AWS, folders and etc
thanks, yes, I am running batch job under my own credentials and ticked "use highest privilege" and I have local admin on my Windows 10 PC.
You can add in Job few "dummy" checkpoint - as variant tFileTouch (each with sequence filename)
at the begin, before and after most important steps, and check - where Your job stop
re this:
"I have many Jobs with AWS, REST and any other functional run from Windows (and 10 and server) - no one of them was not require additional changes."
Please clarify one thing for me: do you run the above Talend jobs inside Windows Task Scheduler ?
Thanks!!
@yliu wrote:
re this:
"I have many Jobs with AWS, REST and any other functional run from Windows (and 10 and server) - no one of them was not require additional changes."
Please clarify one thing for me: do you run the above Talend jobs inside Windows Task Scheduler ?
Thanks!!
Yes, my primary Jobs run under Linux (and from TAC and standalone), but I have many tuning on windows, and yes some of them call REST Services, some of them work with AWS
may be You are right, my Jobs located on disk C: and work with remote locations over sftp, so I not test - how it work with UNC
would be good to know