{"record":{"id":"d786169d0f77e269","repo":"juicedata/juicefs","slug":"check-s-in-s-s","errorCode":null,"errorMessage":"check %s in %s: %s","messagePattern":"check (.+?) in (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/sync/sync.go","lineNumber":1255,"sourceCode":"\t\t\tchecked.Increment()\n\t\t\tcheckedBytes.IncrInt64(obj.Size())\n\t\t}\n\t\tequal := cur.Size() == obj.Size()\n\t\tif equal && !cur.Mtime().Equal(obj.Mtime()) {\n\t\t\t// Head of an object may not return the millisecond part of mtime as List\n\t\t\tequal = cur.Mtime().Unix() == obj.Mtime().Unix() && cur.Mtime().UnixMilli()%1000 == 0\n\t\t}\n\t\tif !equal {\n\t\t\treturn fmt.Errorf(\"%s changed during sync. Original: size=%d, mtime=%s; Current: size=%d, mtime=%s\",\n\t\t\t\tcur.Key(), obj.Size(), obj.Mtime(), cur.Size(), cur.Mtime())\n\t\t}\n\t\tif dstObj, err := dst.Head(ctx, key); err == nil {\n\t\t\tif cur.Size() != dstObj.Size() {\n\t\t\t\treturn fmt.Errorf(\"copied %s size mismatch: original=%d, current=%d\", key, obj.Size(), dstObj.Size())\n\t\t\t}\n\t\t\treturn nil\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"check %s in %s: %s\", key, dst, err)\n\t\t}\n\t} else if errors.Is(err, os.ErrNotExist) {\n\t\treturn fmt.Errorf(\"object %s was removed during sync\", key)\n\t} else {\n\t\treturn fmt.Errorf(\"check %s in %s: %s\", key, src, err)\n\t}\n}\n\nfunc copyLink(src object.ObjectStorage, dst object.ObjectStorage, key string) error {\n\tvar p string\n\tvar err error\n\tif p, err = src.(object.SupportSymlink).Readlink(key); err != nil {\n\t\treturn err\n\t}\n\treturn try(3, func() (err error) {\n\t\t// TODO: use relative path based on option\n\t\tif err := dst.(object.SupportSymlink).Symlink(p, key); err != nil {\n\t\t\tif info, err := dst.Head(ctx, key); err == nil && info.IsSymlink() {","sourceCodeStart":1237,"sourceCodeEnd":1273,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/sync/sync.go#L1237-L1273","documentation":"Wraps a failure to verify the copied object on the DESTINATION during checkChange: dst.Head failed with a non-not-exist error. Sync could not confirm the copy landed correctly, so it reports 'check <key> in <dst>: <err>'.","triggerScenarios":"After src Head confirms the object is unchanged, dst.Head(ctx, key) returns an error other than os.ErrNotExist (permission denied, timeout, 5xx, throttling), producing this wrapped error.","commonSituations":"Destination credentials lack read (Head) permission even though writes succeeded; destination throttling under heavy sync load; destination endpoint temporarily unavailable; proxy/firewall interference.","solutions":["Fix the wrapped error's root cause: grant dst credentials s3:GetObject/Head permission or correct IAM policy.","Retry the sync — transient destination 5xx/throttle errors usually clear.","Reduce --threads or add rate limiting if the destination is throttling Head requests.","Verify dst endpoint/region configuration (correct URL, no stale proxy settings)."],"exampleFix":"# grant Head access on destination\naws s3api put-bucket-policy --bucket dst --policy file://allow-head.json\n# then rerun\njuicefs sync src dst --check-all","handlingStrategy":"retry","validationCode":"// verify destination Head permission before sync\n_, err := dst.Head(ctx, probeKey)\nif err != nil && !errors.Is(err, os.ErrNotExist) {\n  return fmt.Errorf(\"dst Head permission/endpoint problem: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := sync(...); err != nil {\n  if strings.Contains(err.Error(), fmt.Sprintf(\"check %s in\", key)) && !strings.Contains(err.Error(), \"was removed\") {\n    return retryWithBackoff(sync, 3) // transient dst Head failure\n  }\n  return err\n}","preventionTips":["Pre-flight a Head probe against the destination with the sync credentials.","Grant s3:GetObject/HeadObject (or equivalent) on the destination.","Throttle sync concurrency if the destination throttles Head requests.","Validate endpoint/region/proxy settings before long syncs."],"tags":["sync","verification","destination"],"backgroundTag":"http-error-response","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"}