#10703·aws-cli

Regression in 2.37.2: `aws s3 cp` fails with an empty `aws: [ERROR]:` on newly auto-resolved CRT hosts when no region is configured

Author: Abhishek-NumeralCreated Sep 29, 2026Updated Sep 29, 2026

Describe the bug

This is a regression in 2.37.2. With default configuration, the same command on the same host worked in 2.37.1 and earlier. Nothing changes on the user's side. Upgrading the CLI alone turns a working aws s3 cp into aws: [ERROR]: with exit code 255 and no message.

#10685 (in 2.37.2) added c7g, m7g, r7g, c8g, m8g and other families to CRT_AUTO_RESOLVE_INSTANCE_FAMILIES. On those hosts the default transfer client changed from classic to CRT. If no region can be resolved, the CRT path then crashes before sending a request:

  • S3TransferManagerFactory._resolve_region() returns None.
  • _create_crt_client() passes that to awscrt.s3.S3Client.
  • That constructor does assert isinstance(region, str) (awscrt/s3.py:349, awscrt 0.37.0).
  • A bare AssertionError has no message, so the CLI prints only aws: [ERROR]:.

Before 2.37.2 these hosts auto-resolved to the classic client. With no region, classic uses us-east-1 and follows S3's redirect to the bucket's region, so the same command worked.

Region-less environments on these hosts include Docker builds and containers that can't reach IMDS. aws s3api commands aren't affected, because they don't use the transfer client.

CLI version Auto-resolved client on c7g.large (default config, no region) Result
2.37.1 classic request reaches S3
2.37.2 crt AssertionError → aws: [ERROR]:, exit 255
2.37.4 crt AssertionError → aws: [ERROR]:, exit 255

Expected Behavior

The same behavior as 2.37.1: the transfer proceeds. At minimum, the command should fail with a clear error such as "You must specify a region".

Current Behavior

$ aws s3 cp --no-progress s3://amzn-s3-demo-bucket/key /tmp/out
aws: [ERROR]:
$ echo $?
255

With --debug:

DEBUG - Auto resolved s3 transfer client to: crt
Traceback (most recent call last):
  File "awscli/clidriver.py", line 604, in main
  File "awscli/lazy.py", line 43, in __call__
  File "awscli/customizations/commands.py", line 153, in __call__
  File "awscli/customizations/commands.py", line 207, in __call__
  File "awscli/customizations/s3/subcommands.py", line 1075, in _run_main
  File "awscli/customizations/s3/subcommands.py", line 1122, in _get_transfer_manager
  File "awscli/customizations/s3/factory.py", line 186, in create_transfer_manager
  File "awscli/customizations/s3/factory.py", line 219, in _try_create_crt_transfer_manager
  File "awscli/customizations/s3/factory.py", line 429, in _create_crt_transfer_manager
  File "awscli/s3transfer/crt.py", line 596, in get_crt_client
  File "awscli/customizations/s3/factory.py", line 414, in <lambda>
  File "awscli/customizations/s3/factory.py", line 475, in _create_crt_client
  File "awscli/s3transfer/crt.py", line 226, in create_s3_crt_client
  File "awscrt/s3.py", line 349, in __init__
AssertionError
aws: [ERROR]:

Reproduction Steps

This runs the same command under default configuration on 2.37.1 and 2.37.2, using the official CLI image and AWS's documented example credentials. awscrt reads the instance type from DMI, so the container fakes /sys/devices/virtual/dmi/id to look like a c7g.large. It fails at client construction, before any request, so neither real credentials nor a real bucket is needed.

bash
mkdir -p /tmp/bb && docker run --rm -v /tmp/bb:/out public.ecr.aws/docker/library/busybox:musl cp /bin/busybox /out/

for v in 2.37.1 2.37.2; do
  docker run --rm --privileged -v /tmp/bb:/bb:ro \
    -e AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE \
    -e AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY \
    --entrypoint sh public.ecr.aws/aws-cli/aws-cli:$v -c '
      /bb/busybox mount -t tmpfs tmpfs /sys/devices/virtual &&
      mkdir -p /sys/devices/virtual/dmi/id &&
      echo "Amazon EC2" > /sys/devices/virtual/dmi/id/sys_vendor &&
      echo c7g.large > /sys/devices/virtual/dmi/id/product_name &&
      aws --version &&
      aws s3 cp --debug s3://amzn-s3-demo-bucket/key /tmp/out 2>&1 |
        grep -E "Auto resolved|^AssertionError|aws: \[ERROR\]|fatal error"'
done

Output:

aws-cli/2.37.1 Python/3.14.6 Linux/7.0.14-linuxkit docker/aarch64.amzn.2023
... DEBUG - Auto resolved s3 transfer client to: classic
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden
aws-cli/2.37.2 Python/3.14.6 Linux/7.0.14-linuxkit docker/aarch64.amzn.2023
... DEBUG - Auto resolved s3 transfer client to: crt
AssertionError
aws: [ERROR]:

The 403 is expected with example credentials; it shows 2.37.1 reaches S3. Setting AWS_DEFAULT_REGION makes 2.37.2 behave like 2.37.1.

Possible Solution

Any of these would help, roughly from most to least compatible:

  1. During auto-resolve, don't choose CRT when the region can't be resolved: return False from _is_eligible_for_crt_client() and fall back to classic. This restores the 2.37.1 behavior for these hosts.
  2. Default the CRT path to us-east-1 like the classic client, and let the region-redirect support from #10623 handle buckets in other regions. I haven't tested this path.
  3. At minimum, raise a descriptive error in _resolve_region() / _create_crt_client() instead of passing None to awscrt.

Separately, clidriver could print the exception type when str(exc) is empty. aws: [ERROR]: on its own gives users nothing to search for.

Additional Information/Context

  • Why it worked before: the region handling in the CRT path is unchanged since at least 2.30.0. Before 2.37.2 it was only reachable if you opted into CRT or ran on a small set of specialized instance types. #10685 made it the default path on common general-purpose instance families.
  • It will get wider: per the rollout schedule in #10676, auto-resolve reaches 6th-gen families on 9/29, 5th-gen on 10/1, t-family on 10/6, and all hosts, including non-EC2, on 10/8. Each step will move more region-less environments (Docker builds, CI runners, containers that can't reach IMDS, workstations without a configured region) from working to failing on upgrade.
  • Related: #10676, #10674, #10685, #10702, #10623

CLI version used

  • Works: aws-cli/2.37.1
  • Fails: aws-cli/2.37.2 and aws-cli/2.37.4 (Python/3.14.6, bundled awscrt 0.37.0)

Environment details (OS name and version, etc.)

Official public.ecr.aws/aws-cli/aws-cli containers (Amazon Linux 2023), linux/arm64, with a simulated c7g.large DMI.