aws / aws/aws-cli

aws s3 rm doesn't indicate failure on invalid files

Open
#6,926 3 comments 3 reactions 0 assignees View on GitHub
documentation feature-request p3 s3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### Describe the bug

There is no indication of failure when you try to remove a file that doesn't exist. When you successfully remove a file with the command
`aws s3 rm s3://bucket/file-that-DOES-exist` you receive the message `delete: s3://bucket/file-that-DOES-exist` in stdout along with exit code 0.

When you ATTEMPT to remove a file with the command
`aws s3 rm s3://bucket/file-that-DOES-NOT-exist` you receive the message `delete: s3://bucket/file-that-DOES-NOT-exist` in stdout along with exit code 0.

### Expected Behavior

aws cli should return a non-zero exit code along with and error message in stderr indicating that the specified file does not exist.

### Current Behavior

Attempting to delete a file that doesn't exist gives you the exit code 0 and `delete: s3://bucket/file-that-doesnt-exist` in stdout leaving no indication of failure.

### Reproduction Steps

Attempt to remove a file that doesn't exist:
`aws s3 rm s3://bucket/file-that-DOES-NOT-exist`

In stdout you will receive:
`delete: s3://bucket/file-that-DOES-NOT-exist`

Check exit code:
`echo $?`

You will receive:
`0`

### Possible Solution

aws cli should return a non-zero exit code along with and error message in stderr indicating that the specified file does not exist.

### Additional Information/Context

_No response_

### CLI version used

aws-cli/2.6.2 Python/3.9.11 Linux/5.13.0-40-generic exe/x86_64.ubuntu.20 prompt/off

### Environment details (OS name and version, etc.)

Linux dev 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.