{"record":{"id":"a8733d9dfefe3050","repo":"kopia/kopia","slug":"could-not-get-versioning-info-for-s","errorCode":null,"errorMessage":"could not get versioning info for %s","messagePattern":"could not get versioning info for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/blob/s3/s3_versioned.go","lineNumber":33,"sourceCode":"\tblob.Metadata\n\n\t// Versioning related information\n\tIsLatest       bool\n\tIsDeleteMarker bool\n\tVersion        string\n}\n\n// versionMetadataCallback is called when processing the metadata for each blob version.\ntype versionMetadataCallback func(versionMetadata) error\n\n// IsVersioned returns whether versioning is enabled in the store.\n// It returns true even if versioning is enabled but currently suspended for the\n// bucket. Notice that when object locking is enabled in a bucket, object\n// versioning is enabled and cannot be suspended.\nfunc (s *s3Storage) IsVersioned(ctx context.Context) (bool, error) {\n\tvi, err := s.cli.GetBucketVersioning(ctx, s.BucketName)\n\tif err != nil {\n\t\treturn false, errors.Wrapf(err, \"could not get versioning info for %s\", s.BucketName)\n\t}\n\n\treturn vi.Enabled(), nil\n}\n\n// getBlobVersions lists all the versions for the blob with the given ID.\nfunc (s *s3Storage) getBlobVersions(ctx context.Context, prefix blob.ID, callback versionMetadataCallback) error {\n\tvar foundBlobs bool\n\n\tif err := s.list(ctx, prefix, true, func(vm versionMetadata) error {\n\t\tfoundBlobs = true\n\n\t\treturn callback(vm)\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\tif !foundBlobs {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/repo/blob/s3/s3_versioned.go#L15-L51","documentation":"Wrapper in S3 IsVersioned: the GetBucketVersioning API call failed, so kopia cannot determine whether bucket versioning is enabled — required before using retention/versioned features; the bucket name is interpolated into the message.","triggerScenarios":"Calling IsVersioned (used before PutBlob with retention/version checks) when the API call fails: no s3:GetBucketVersioning permission, bucket does not exist, wrong region endpoint, or network error.","commonSituations":"IAM policy missing GetBucketVersioning; bucket name typo; using an endpoint pointing to the wrong region; MinIO deployments without versioning support returning errors.","solutions":["Grant s3:GetBucketVersioning to the credentials in use","Verify bucket exists and endpoint/region are correct","Check network connectivity to the S3 endpoint","Inspect errors.Cause(err) for the S3 error code (NoSuchBucket, AccessDenied, etc.)"],"exampleFix":"// before\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":\"s3:GetBucketVersioning\",\"Resource\":\"*\"}]}\n// after\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"s3:GetBucketVersioning\",\"s3:PutObjectRetention\"],\"Resource\":\"*\"}]}","handlingStrategy":"try-catch","validationCode":"if _, err := svc.GetBucketVersioning(&s3.GetBucketVersioningInput{Bucket: aws.String(bucketName)}); err != nil {\n    return fmt.Errorf(\"cannot read versioning status for %s: %w\", bucketName, err)\n}","typeGuard":null,"tryCatchPattern":"versioned, err := store.(interface{ IsVersioned(context.Context) (bool, error) }).IsVersioned(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"AccessDenied\") { /* fix IAM: s3:GetBucketVersioning */ }\n    return err\n}","preventionTips":["Grant s3:GetBucketVersioning to the credentials","Enable versioning (with Object Lock) when creating the bucket","Verify bucket name/region before opening the repository","For MinIO, ensure the deployment supports versioning APIs"],"tags":["aws","s3","versioning","permissions"],"backgroundTag":"http-error-response","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}