{"record":{"id":"13db34f6cc71f195","repo":"juicedata/juicefs","slug":"status-v-message-s","errorCode":null,"errorMessage":"status: %v, message: %s","messagePattern":"status: (.+?), message: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/ufile.go","lineNumber":150,"sourceCode":"\nfunc (u *ufile) parseResp(resp *http.Response, out interface{}) error {\n\tdefer resp.Body.Close()\n\tvar data []byte\n\tif resp.ContentLength <= 0 || resp.ContentLength > (1<<31) {\n\t\td, err := io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdata = d\n\t} else {\n\t\tdata = make([]byte, resp.ContentLength)\n\t\tif _, err := io.ReadFull(resp.Body, data); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"status: %v, message: %s\", resp.StatusCode, string(data))\n\t}\n\terr := json.Unmarshal(data, out)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc copyObj(ctx context.Context, store ObjectStorage, dst, src string) error {\n\tin, err := store.Get(ctx, src, 0, -1)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer in.Close()\n\td, err := io.ReadAll(in)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/ufile.go#L132-L168","documentation":"parseResp reads the whole UFile response body and, when the HTTP status is not 200, returns the raw status code and body as an error. Callers of List, CreateMultipartUpload and ListUploads surface this whenever UFile rejects the request.","triggerScenarios":"UFile API returns non-200: bad signature/credentials (401/403), bucket not found (404), malformed list request, expired token, or 5xx from the UFile service; body is returned verbatim in the message.","commonSituations":"Wrong UFile API private/public key pair; bucket name typo; system bucket mismatch with signature host; clock skew invalidating the UFile signature; rate limiting.","solutions":["Read the message body — it contains UFile's specific error reason","Verify public/private API keys and the bucket's system/space configuration","Re-sign with accurate timestamp; fix host clock skew (NTP)","Retry on 5xx / rate-limit responses with backoff"],"exampleFix":"// before\n// status: 401, message: {\"ErrorCode\":\"Signature does not match\"}\n// after\n// regenerate API key pair and update --access-key/--secret-key","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"_, err := store.List(ctx, prefix, marker, limit, false)\nif err != nil && strings.HasPrefix(err.Error(), \"status:\") {\n\tvar sc int\n\tfmt.Sscanf(err.Error(), \"status: %d\", &sc)\n\tswitch sc { case 401, 403: /* fix keys */; case 429, 500: /* backoff-retry */ }\n}","preventionTips":["Validate UFile public/private keys with a cheap List call first","Keep host clocks synced (NTP) — signatures depend on timestamps","Confirm the bucket belongs to the signing account/project"],"tags":["ufile","http","object-storage","api-error"],"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"}