Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
However when I attempt to execute the same command from the tSystem component inside a job that runs on the same local machine:
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
Have you tried changing your aws command to include it's full path? I suspect that aws is not in your PATH variable.
yes in the tSystem Component I set the home directory where the aws executable resides . See screen shot, but still to no avail...
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.
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
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...
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.
Thanks Richard. I will try that. Thanks for your help so far.