{"record":{"id":"d9bcaebb0a389bd9","repo":"juicedata/juicefs","slug":"list-chunk-prefix-s-s","errorCode":null,"errorMessage":"list chunk prefix %s: %s","messagePattern":"list chunk prefix (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/gc.go","lineNumber":585,"sourceCode":"\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if strings.Contains(strings.TrimPrefix(key, prefix), \"/\") {\n\t\t\t\treturn errors.Errorf(\"delimiter list returned nested object %s\", key)\n\t\t\t}\n\t\t\tmarker = key\n\t\t}\n\t\tif !hasMore {\n\t\t\tbreak\n\t\t}\n\t\ttoken = nextToken\n\t}\n\treturn nil\n}\n\nfunc scanGcChunkObjectsPrefix(ctx context.Context, blob object.ObjectStorage, prefix string, handle func(object.Object) error) error {\n\tobjs, err := object.ListAll(ctx, blob, prefix, \"\", true, false)\n\tif err != nil {\n\t\treturn errors.Errorf(\"list chunk prefix %s: %s\", prefix, err)\n\t}\n\tfor obj := range objs {\n\t\tif obj == nil {\n\t\t\treturn errors.Errorf(\"list chunk prefix %s failed\", prefix)\n\t\t}\n\t\tif err := handle(obj); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc filterGcObject(ctx context.Context, blob object.ObjectStorage, obj object.Object, maxMtime time.Time, scanned *utils.Bar, skipped *utils.DoubleSpinner) (object.Object, bool) {\n\tif obj.IsDir() {\n\t\treturn nil, false\n\t}\n\tif obj.Size() == 0 || obj.Mtime().Unix() == 0 {\n\t\theadObj, err := blob.Head(ctx, obj.Key())","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/gc.go#L567-L603","documentation":"Wrapped error from scanGcChunkObjectsPrefix when object.ListAll (a full paginated listing of one chunk prefix) fails. The prefix and original store error are included. This makes the GC scan for that prefix incomplete, so the error is propagated to abort GC rather than risk misclassifying leaked objects.","triggerScenarios":"`juicefs gc` enumerating chunks/<xx>/ when ListObjects against the bucket fails: auth failure, bucket missing, throttling, network timeout, or unsupported listing options by the backend (ListAll wraps backend errors).","commonSituations":"Expired cloud credentials; minio container down; S3 request-rate throttling on huge prefixes; proxy/firewall dropping long listings; misconfigured storage endpoint in the volume format.","solutions":["Check the underlying error after 'list chunk prefix:' — fix auth/endpoint/bucket accordingly.","Verify credentials with a plain list: `aws s3 ls s3://bucket/chunks/` or `mc ls`.","Retry with fewer parallel listings (`--threads`) to avoid throttling.","Fix network path (proxy/firewall/VPN) if timeouts recur.","Confirm the volume's storage config with `juicefs status` if the endpoint changed."],"exampleFix":"// before: failing due to stale keys\njuicefs gc $META\n// after\nexport AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...\njuicefs gc $META","handlingStrategy":"retry","validationCode":"aws s3 ls s3://$BUCKET/chunks/ --max-items 1 >/dev/null 2>&1 || { echo 'listing failed: check creds/endpoint'; exit 1; }","typeGuard":null,"tryCatchPattern":"if m := regexp.MustCompile(`list chunk prefix ([0-9a-f]{2}): (.*)`).FindStringSubmatch(out); m != nil {\n    // m[1] = failing prefix, m[2] = store error; handle by cause\n}","preventionTips":["Validate credentials and endpoint before GC windows","Bound --threads to avoid prefix throttling","Monitor object-store 5xx rates during maintenance"],"tags":["go","object-storage","s3","gc","listing"],"backgroundTag":"api-request-failed","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}