Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

blob/s3blob: map S3 403 errors PermissionDenied code#3663

Merged
vangent merged 1 commit intogoogle:masterfrom
stanhu:sh-s3-map-permission-denied
Feb 27, 2026
Merged

blob/s3blob: map S3 403 errors PermissionDenied code#3663
vangent merged 1 commit intogoogle:masterfrom
stanhu:sh-s3-map-permission-denied

Conversation

Copy link
Contributor

stanhu commented Feb 27, 2026

If the S3 credentials used to access a bucket doesn't have the s3:ListBucket credentials, previously the error code would return as Unknown. This commit changes this to PermissionDenied.

If the S3 credentials used to access a bucket doesn't have the
`s3:ListBucket` credentials, previously the error code would return as
`Unknown`. This commit changes this to PermissionDenied.
vangent merged commit 31e3651 into google:master Feb 27, 2026
5 checks passed
gitlab-runner-bot pushed a commit to gitlabhq/gitlab-runner that referenced this pull request Mar 4, 2026
When using S3 with RoleARN, if the file doesn't exist, the Attributes
call returns a 403 Forbidden error instead of 404 Not Found. This can be
confusing because it may indicate either a missing file or incorrect IAM
permissions.

Add special handling for S3 403 errors to provide guidance that the
error may be expected if the file doesn't exist, and reference the
documentation about HeadObject permissions and the s3:ListBucket IAM
policy requirement.

This helps users distinguish between a missing cache file and actual
permission issues with their RoleARN configuration.

For now we use a string comparison because GoCloud returns an Unknown
code until google/go-cloud#3663 is merged.

Relates to https://gitlab.com/gitlab-org/gitlab-runner/-/issues/39105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants