Skip to content

feat(libstore/aws-creds): route AWS CRT logs through Nix logger#15059

Merged
xokdvium merged 2 commits into
NixOS:masterfrom
lovesegfault:fix-aws-logs
Jan 25, 2026
Merged

feat(libstore/aws-creds): route AWS CRT logs through Nix logger#15059
xokdvium merged 2 commits into
NixOS:masterfrom
lovesegfault:fix-aws-logs

Conversation

@lovesegfault
Copy link
Copy Markdown
Member

Motivation

Previously AWS CRT logs went directly to stderr via ApiHandle::InitializeLogging,
causing log spam that didn't respect Nix's verbosity settings.

This implements a custom aws_logger using the aws-c-common C API that:

  • Routes all AWS logs through nix::logger
  • Maps AWS log levels conservatively (ERROR/WARN -> lvlInfo) since the SDK
    treats expected conditions like missing IMDS as errors
  • Prefixes messages with (aws) for clarity
  • Respects Nix's verbosity flags (-v, -vv, etc.)

Context

Fixes: #14880


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Comment thread src/libstore/aws-creds.cc Outdated
Comment thread src/libstore/aws-creds.cc Outdated
Comment thread src/libstore/aws-creds.cc
Comment thread src/libstore/aws-creds.cc Outdated
Comment thread src/libstore/aws-creds.cc Outdated
Comment thread src/libstore/aws-creds.cc Outdated
Comment thread src/libstore/aws-creds.cc Outdated
Comment thread tests/nixos/s3-binary-cache-store.nix Outdated
lovesegfault and others added 2 commits January 25, 2026 19:40
Previously AWS CRT logs went directly to stderr via ApiHandle::InitializeLogging,
causing log spam that didn't respect Nix's verbosity settings.

This implements a custom aws_logger using the aws-c-common C API that:
- Routes all AWS logs through nix::logger
- Maps AWS log levels conservatively (ERROR/WARN -> lvlInfo) since the SDK
  treats expected conditions like missing IMDS as errors
- Prefixes messages with (aws) for clarity
- Respects Nix's verbosity flags (-v, -vv, etc.)
@xokdvium xokdvium added the backport 2.33-maintenance Automatically creates a PR against the branch label Jan 25, 2026
@xokdvium xokdvium added this pull request to the merge queue Jan 25, 2026
Merged via the queue into NixOS:master with commit ed9d8af Jan 25, 2026
15 checks passed
@internal-nix-ci
Copy link
Copy Markdown

Backport failed for 2.33-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.33-maintenance
git worktree add -d .worktree/backport-15059-to-2.33-maintenance origin/2.33-maintenance
cd .worktree/backport-15059-to-2.33-maintenance
git switch --create backport-15059-to-2.33-maintenance
git cherry-pick -x 3b8b764e29475d9677471fcf52c1eb2e09eaf723 e3b788b4ca839987937f1a348bdbb5772c40c798

@lovesegfault lovesegfault added backport 2.33-maintenance Automatically creates a PR against the branch and removed backport 2.33-maintenance Automatically creates a PR against the branch labels Jan 27, 2026
@internal-nix-ci
Copy link
Copy Markdown

Successfully created backport PR for 2.33-maintenance:

philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Feb 7, 2026
## Bug fixes

- Fix destruction of DerivationBuilder implementations (NixOS/nix#15072)
- Don't report cancelled goals as failures (NixOS/nix#14972)
- Fix `linux` build on fresh `glibc` and `gcc` (NixOS/nix#15011)

## S3 binary cache improvements

- Add AWS SSO support for S3 authentication (NixOS/nix#14645)
- Respect `AWS_PROFILE` environment variable (NixOS/nix#14645)
- Add STS support for default profile (NixOS/nix#14645)
- Skip `Accept-Encoding` header for S3 SigV4 requests (NixOS/nix#15048)
- Restart source before upload retries (NixOS/nix#15047)
- Route AWS CRT logs through Nix logger (NixOS/nix#15059)

The glibc 2.42 build fix patch is dropped as it is now included upstream.

https://github.com/NixOS/nix/releases/tag/2.33.2
jfroche added a commit to supabase/postgres that referenced this pull request Feb 10, 2026
2.33.2 has a fix to improve aws logs: NixOS/nix#15059

It should suppress logging error like:

```
[AuthCredentialsProvider] - Failed to resolve role arn during sts web identity provider initialization.
```

Note that it doesn't prevent the copy operation from succeeding, so it's not a critical issue, but it does make logs cleaner and easier to read.
github-merge-queue Bot pushed a commit to supabase/postgres that referenced this pull request Feb 10, 2026
* fix: create AWS config file to suppress post-build-hook errors

The post-build-hook runs `nix copy --to s3://...` which now uses libcurl AWS authentication since the last 2.33 release (see https://releases.nixos.org/nix/nix-2.33.0/manual/release-notes/rl-2.33.html#s3-improvements).
It attempts to read /root/.aws/config for profile configuration, but only /root/.aws/credentials was created by `aws configure set` (credential keys write to the credentials file, not the config file). This produced errors in CI logs:

  [ERROR] static: Failed to open file. path:'/root/.aws/config'
  [ERROR] Failed to build config profile collection from file

Setting the region via `aws configure set region` creates the config file, resolving the missing file errors.

* feat: upgrade nix to 2.33.2

2.33.2 has a fix to improve aws logs: NixOS/nix#15059

It should suppress logging error like:

```
[AuthCredentialsProvider] - Failed to resolve role arn during sts web identity provider initialization.
```

Note that it doesn't prevent the copy operation from succeeding, so it's not a critical issue, but it does make logs cleaner and easier to read.
encima pushed a commit to supabase/postgres that referenced this pull request Feb 23, 2026
* fix: create AWS config file to suppress post-build-hook errors

The post-build-hook runs `nix copy --to s3://...` which now uses libcurl AWS authentication since the last 2.33 release (see https://releases.nixos.org/nix/nix-2.33.0/manual/release-notes/rl-2.33.html#s3-improvements).
It attempts to read /root/.aws/config for profile configuration, but only /root/.aws/credentials was created by `aws configure set` (credential keys write to the credentials file, not the config file). This produced errors in CI logs:

  [ERROR] static: Failed to open file. path:'/root/.aws/config'
  [ERROR] Failed to build config profile collection from file

Setting the region via `aws configure set region` creates the config file, resolving the missing file errors.

* feat: upgrade nix to 2.33.2

2.33.2 has a fix to improve aws logs: NixOS/nix#15059

It should suppress logging error like:

```
[AuthCredentialsProvider] - Failed to resolve role arn during sts web identity provider initialization.
```

Note that it doesn't prevent the copy operation from succeeding, so it's not a critical issue, but it does make logs cleaner and easier to read.
brittonr pushed a commit to brittonr/nix that referenced this pull request Apr 1, 2026
feat(libstore/aws-creds): route AWS CRT logs through Nix logger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.33-maintenance Automatically creates a PR against the branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nix copy to s3: [AuthCredentialsProvider] - Failed to resolve role arn during sts web identity provider initialization.

5 participants