Fix nil pointer panic in S3 DeleteObjects error logging#11
Draft
Copilot wants to merge 12 commits into
Draft
Conversation
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update aws-sdk-go to aws-sdk-go-v2
Migrate from deprecated aws-sdk-go v1 to aws-sdk-go-v2
Jan 23, 2026
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
…dates Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot
AI
changed the title
Migrate from deprecated aws-sdk-go v1 to aws-sdk-go-v2
Complete AWS SDK v1 to v2 migration - fix test failures and json/v2 import
Feb 4, 2026
The issue was that when using S3-compatible services (MinIO, Ceph, etc.), wal-g was trying to detect the AWS region by calling GetBucketLocation, which would fail with 403 errors because these services don't support this operation the same way AWS does. Root cause: In storage.go, the BaseEndpoint is set on the S3 client options AFTER the session is created. During session creation, detectAWSRegion was checking awsCfg.BaseEndpoint which was always nil, causing it to incorrectly attempt region detection via GetBucketLocation for MinIO endpoints. Fix: Pass the endpoint from config directly to detectAWSRegion instead of relying on awsCfg.BaseEndpoint. Now the function properly detects non-AWS endpoints and uses "us-east-1" as the default region without making API calls. This fixes the Redis AOF backup test failure where MinIO endpoint was being used but region detection was attempting GetBucketLocation. Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot
AI
changed the title
Complete AWS SDK v1 to v2 migration - fix test failures and json/v2 import
Fix region detection for S3-compatible services in AWS SDK v2 migration
Feb 4, 2026
The DeleteObjects method was panicking when logging errors for objects without version IDs. This occurred because: 1. When versioning is disabled, ObjectIdentifier structs are created without VersionId (line 555: only Key is set) 2. Error logging code (line 463) unconditionally dereferenced VersionId 3. This caused a nil pointer panic during delete operations Fix: Check if VersionId is nil before dereferencing it in error logs. Use "none" as the version string when VersionId is not present. This fixes the panic in wal-g_pg_backup_mark_impermanent_test where delete operations on non-versioned buckets would crash. Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot
AI
changed the title
Fix region detection for S3-compatible services in AWS SDK v2 migration
Fix nil pointer panic in S3 DeleteObjects error logging
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During AWS SDK v2 migration,
types.ObjectIdentifier.VersionIdchanged from value to*string. Error logging inDeleteObjectsunconditionally dereferenced this pointer, causing panics when deleting from non-versioned buckets.Changes
VersionIdin error logVersionIdis nilResolves panic in
wal-g_pg_backup_mark_impermanent_testand other delete operations on non-versioned buckets.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.