Opened 5 years ago

#1387 new defect

run-program returns wrong exit code for aws cli when aws cli returns no output

Reported by: brooks Owned by:
Priority: normal Milestone:
Component: other Version: trunk
Keywords: Cc:


Configure aws cli on a linux machine, and access the cli s3 commands as follows. In my case, the S3 bucket "lensbox" exists, but the bucket+prefix "lensbox/x" does not exist. Note that aws documentation ( specifies "no output" in the case of listing all keys having a prefix that does not exist.

On AWS linux

(run-program "aws" '("s3" "ls" "s3://lensbox/")) has exit code 0 because this bucket exists. When I use with-output-to-string then it shows the listing; i.e. all good.

(run-program "aws" '("s3" "ls" "s3://lensbox/x")) has exit code 1

But, at the linux command line

aws s3 ls s3://lensbox/x

returns nothing, but does not generate an error

I also checked the run-program error output by doing

(run-program "aws" '("s3" "ls" "s3://lensbox/x") :error *standard-output*)

and it shows no error, but exits with code = 1.

Thanks for your attention. Martin Brooks

Change History (0)

Note: See TracTickets for help on using tickets.