aws / aws/aws-cli

Error exit value doesn't quite match what `help return-codes` describe

Open
#8,766 1 comment 0 reactions 0 assignees View on GitHub
bug configure p2
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### Describe the bug

According to `aws help return-codes`:

```text
* "1" -- Limited to "s3" commands, at least one or more s3 transfers
failed for the command executed.

[...]

* "253" -- The system environment or configuration was invalid. While
the command provided may be syntactically valid, missing
configuration or credentials prevented the command from running.
```

However,

```bash
$ cd ~/.aws
$ rm config credentials
$ aws configure get region
$ echo $?
1
$
```

[The same behavior occurs no matter what config key is being requested, including section-qualified names like `default.region`.]

### Expected Behavior

I would have expected **either** an exit code of 253, **or** for the builtin documentation for return-code=1 to be better (since obviously this happens for more than just S3 transfer commands).

### Current Behavior

This probably falls into "documentation bug" rather than "documentation is correct and CLI configuration parser is buggy". However, the description for doc bugs in the github issue-reporting form only mentioned User Guide and API docs, so dunno how you want to categorize this.

### Reproduction Steps

Remove the config file (and optionally point `AWS_CONFIG_FILE` at a nonexistent file, as per #7714), then run any of the `aws configure get` commands. Compare the return code with that described in the builtin help.

### Possible Solution

_No response_

### Additional Information/Context

Obviously a low-priority problem. Dunno which you consider to be authoritative ("code to the doc spec" versus "docs describe what actually exists"), but somewhere there's a mismatch. :-)

### CLI version used

aws-cli/2.17.0 Python/3.11.8 Windows/10 exe/AMD64

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

Windows 10 but the builtin docs are presumably the same everywhere

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.