Skip to content

cli: fall back to unsigned S3 reads without credentials - #1808

Open
amacneil wants to merge 6 commits into
mainfrom
cursor/cli-s3-unsigned-fallback-e63f
Open

cli: fall back to unsigned S3 reads without credentials#1808
amacneil wants to merge 6 commits into
mainfrom
cursor/cli-s3-unsigned-fallback-e63f

Conversation

@amacneil

@amacneil amacneil commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Changelog

S3 reads without AWS credentials no longer hang on the EC2 metadata service; the CLI falls back to unsigned requests, and --no-sign-request forces unsigned requests to S3, GCS, or Azure.

Docs

Updated website/docs/guides/cli.md (global help text and the Credentials section).

Description

Without AWS credential environment variables, object_store fell through to the EC2 instance metadata service and applied its data-plane retry budget. On a machine that is not using IMDS credentials that produced a multi-second hang and an opaque error naming 169.254.169.254.

This change:

  • Adds global --no-sign-request (same spelling as the AWS CLI and s5cmd) to force unsigned requests to S3, GCS, or Azure. The flag is global and parses after the subcommand, e.g. mcap info --no-sign-request s3://....
  • For S3 only, when no credential env vars are present, probes IMDS once with a one-second timeout. If the probe fails, the request is sent unsigned so public buckets work with no configuration. GCS and Azure keep their own credential fallbacks unless the flag is set.
  • Honors AWS_EC2_METADATA_DISABLED=true and maps AWS_EC2_METADATA_SERVICE_ENDPOINT onto AWS_METADATA_ENDPOINT so the probe and credential fetch agree.
  • On unsigned S3 403s, explains that credentials come from environment variables only (not ~/.aws/credentials or SSO).

This does not fully address #1803. The reporter's bucket is authenticated and their keys live in ~/.aws/credentials (the Go CLI 0.0.62 read that file; object_store does not). Exporting keys with aws configure export-credentials unblocks them today. A follow-up should read the shared AWS credentials file; that is out of scope here.

Region is not required (object_store defaults to us-east-1); set AWS_REGION when the bucket is elsewhere.

Credential detection for the auto-unsigned path mirrors AmazonS3Builder::build in object_store 0.13.2. Re-check that list when bumping object_store; a missed branch would force unsigned on a source that should sign.

Testing

  • Public bucket, no AWS_* credentials: mcap info finishes in well under a few seconds with no IMDS hang (verified against local MinIO).
  • Private bucket, no credentials: returns quickly with 403 Forbidden and "The request was sent unsigned..." (verified against local MinIO).
  • Private bucket with AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY set: mcap info succeeds (verified against local MinIO).
  • mcap info --no-sign-request with credentials still set: unsigned 403 guidance; flag wins over keys (verified against local MinIO).

Related: #1803

Open in Web Open in Cursor 

Without AWS credentials, object_store probed the EC2 metadata service
with aggressive retries, hanging for seconds on typical developer
machines. Probe IMDS once with a one-second timeout and, if it does not
answer, send the request unsigned. Add --no-sign-request to force that.

Fixes: #1803

Co-authored-by: adrian <adrian@foxglove.dev>
claude[bot]

This comment was marked as outdated.

Lead with the fact that the request was unsigned so the message stays
accurate when the user passed --no-sign-request with credentials set.

Co-authored-by: adrian <adrian@foxglove.dev>
claude[bot]

This comment was marked as outdated.

cursoragent and others added 2 commits August 13, 2026 16:29
Group env helpers before IMDS probe helpers, place should_skip_signature
after its callees, and cluster related unit tests the same way.

Co-authored-by: adrian <adrian@foxglove.dev>
The flag is global and parses in either position; putting it after `info`
matches other examples like `--time-format` and `--allow-remote-scan`.

Co-authored-by: adrian <adrian@foxglove.dev>
claude[bot]

This comment was marked as outdated.

Say "object store URLs" and name S3, GCS, and Azure on
--no-sign-request so help does not read like the crate name.

Co-authored-by: adrian <adrian@foxglove.dev>
claude[bot]

This comment was marked as outdated.

@amacneil
amacneil marked this pull request as ready for review August 13, 2026 17:56
Co-authored-by: adrian <adrian@foxglove.dev>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants