Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

unable to execute command using tSystem component

Hello

 

I am able to execute the following aws command at my local machine's command prompt:

 

aws s3 ls s3://pmassieh.talend.s3.bucket

 

0683p000009Lt7h.png

 

However when I attempt to execute the same command from the tSystem component inside a job that runs on the same local machine:

 

0683p000009Lt8e.png

 

I get error:

 

'aws' is not recognized as an internal or external command,
operable program or batch file.
.------.
|tLogRow_2|
|=----=|
|output|
|=----=|
|null  |
'------'

[statistics] disconnected
Job s3 ended at 19:11 20/03/2018. [exit code=0]

 

Am I missing anything here ?

 

Appreciate your help

 

Thanks

 

Patrice

Labels (3)
8 Replies
Anonymous
Not applicable
Author

Have you tried changing your aws command to include it's full path? I suspect that aws is not in your PATH variable.

Anonymous
Not applicable
Author

yes in the tSystem Component I set the home directory where the aws executable resides . See screen shot, but still to no avail...

Anonymous
Not applicable
Author

That is the location where cmd is started. I don't believe it will be where cmd's working directory will be when it opens.

Anonymous
Not applicable
Author

How do I find out the commands working directory then ?
Anonymous
Not applicable
Author

I can't test this as i don't have AWS on my machine and I am using a Mac (so the command will be different), but this may work for you....

 

"cmd /c \"c:program files/Amazon/AWSCLI/awscli/aws\" s3 ls s3://" + context.S3_Bucket
Anonymous
Not applicable
Author

Thanks Rich

 

I tried that:

 

"cmd /c \"C:/Program Files/Amazon/AWSCLI/awscli/aws\" s3 ls s3://" + context.S3_Bucket

 

but still getting :

 

'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
.------.
|tLogRow_2|
|=----=|
|output|
|=----=|
|null  |
'------'
[statistics] disconnected
Job s3 ended at 07:33 21/03/2018. [exit code=0]

 

So looks like the space is the issue and is not being recognized...

 

Anonymous
Not applicable
Author

Yes the space in the name is what would cause that, but I was hoping the quotes would prevent that causing an issue. As they would if you were to actually use that command in the command-line. The other thing to try is to add the path to AWS to your PATH operating system variable. Do that, restart Studio and run your original attempt and it should work.

 

The tSystem component is arguably the worst implemented component by Talend. I seldom use it and use Java instead because it makes things unnecessarily complicated. The other thing to try is to prepare a  .bat file (maybe using your Talend job) and call it from the tSystem. Then you simply have to carry out a simple call and leave the .bat to do the hard work. 

Anonymous
Not applicable
Author

Thanks Richard. I will try that. Thanks for your help so far.