Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Run command tool returned an error code: 1 even though it runs fine manually

Matteop9
8 - Asteroid

Hi everyone

 

I have read through a lot of posts on the issue and they don't seem to help me in this error.

 

I am trying to use the run command tool to use the google cloud CLI.

 

I have a .bat file that runs with no errors manually, but when I try to run it with the run command tool I get the following error:

 

Error: Run Command (94): The external program "C:\Users\...\gcloud1.bat" returned an error code: 1

 

This is how the tool is setup:

 

Matteop9_1-1618224869801.png

 

The contents of the .bat file is:

 

gsutil ls gs://ocr-example/ > g1.csv

 

Any help would be much appreciated.

8 REPLIES 8
Qiu
20 - Arcturus
20 - Arcturus

@Matteop9 

I dont have the test environment but it should be something like attached.

CA1.PNG

Matteop9
8 - Asteroid

@Qiu 

 

Thanks for the help but I get the same error unfortunately.

 

It seems like it isn't an issue with the .bat file and more Alteryx running it as if I manually run the .bat file it writes the output as expected.

Qiu
20 - Arcturus
20 - Arcturus

@Matteop9 

KIndly check if is there any space in your file path, that is what happened to me.

we need to double quote the path if there is a path and most like that is the reason causing the error.

String Work-r21.PNGString Work-r22.PNG

danilang
19 - Altair
19 - Altair

hi @Matteop9 

 

In your batch file make sure you fully reference all paths, i.e.

 

c:\users\...\gsutil ls gs://ocr-example/ > c:\users\...\g1.csv

 

Alteryx launches batch files in the current directory of the workflow.  Without the full path, the os can't find gsutil.  It also helps if you specify a working directory

 

Dan 

 

 

Matteop9
8 - Asteroid

@Qiu Your second workflow ran fine for me when the double quotes were added but it did not fix the original issue unfortunately. 

Matteop9
8 - Asteroid

Thanks for the help @danilang

 

Fully referencing gsutil still does not fix it, I get the same error message.

 

Interestingly I have been able to get the AWS CLI to work in the run command without having to fully reference it there? (I just used "aws s3 ls" and it did not have this same error) 

PhilipMannering
16 - Nebula
16 - Nebula

What if you try removing a forward slash in the batch script,

gsutil ls gs://ocr-example > g1.csv
Qiu
20 - Arcturus
20 - Arcturus

@Matteop9 
As I have showed in my sample workflow, it wil just fine for a simple Copy Command.

So @PhilipMannering  point out, the script itself might need some tweak to run, even it runs perfectly as you have mentioned.

Labels