{"record":{"id":"e1e8ca2e2d1ff534","repo":"juicedata/juicefs","slug":"errmsg","errorCode":null,"errorMessage":"${errMsg}","messagePattern":"\\$\\{errMsg\\}","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/ufile.go","lineNumber":354,"sourceCode":"}\n\nfunc (u *ufile) ListUploads(ctx context.Context, marker string) ([]*PendingPart, string, error) {\n\tquery := url.Values{}\n\tquery.Add(\"muploadid\", \"\")\n\tquery.Add(\"prefix\", \"\")\n\tquery.Add(\"marker\", marker)\n\tquery.Add(\"limit\", strconv.Itoa(1000))\n\tresp, err := u.request(ctx, \"GET\", \"?\"+query.Encode(), nil, nil)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tvar out ufileListMultipartUploadsResult\n\t// FIXME: invalid auth\n\tif err := u.parseResp(resp, &out); err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tif out.RetCode != 0 {\n\t\treturn nil, \"\", errors.New(out.ErrMsg)\n\t}\n\tparts := make([]*PendingPart, len(out.DataSet))\n\tfor i, u := range out.DataSet {\n\t\tparts[i] = &PendingPart{u.FileName, u.UploadId, time.Unix(int64(u.StartTime), 0)}\n\t}\n\treturn parts, out.NextMarker, nil\n}\n\nfunc newUFile(endpoint, accessKey, secretKey, token string) (ObjectStorage, error) {\n\tif !strings.Contains(endpoint, \"://\") {\n\t\tendpoint = fmt.Sprintf(\"https://%s\", endpoint)\n\t}\n\treturn &ufile{RestfulStorage{DefaultObjectStorage{}, endpoint, accessKey, secretKey, \"UCloud\", ufileSigner}}, nil\n}\n\nfunc init() {\n\tRegister(\"ufile\", newUFile)\n}","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/ufile.go#L336-L372","documentation":"ufile.ListUploads surfaces UFile's own API error text: when the ListMultipartUploads response carries a non-zero RetCode, the value of ErrMsg is returned as the error (the ${errMsg} placeholder). It is a pass-through of a server-side UFile error.","triggerScenarios":"Calling ListUploads when the UFile API rejects the request — invalid auth/signature, wrong bucket, or any UFile-specific RetCode != 0.","commonSituations":"Expired or wrong UCloud API credentials; listing uploads on a bucket the account cannot access; UFile service-side errors returned inside a 200 response.","solutions":["Check UCloud public/private keys and bucket/region configuration","Read the returned ErrMsg text — it names the actual UFile API problem (e.g. authorization failure)","Re-sign/re-authenticate if credentials were rotated","Retry later if ErrMsg indicates a server-side issue"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify credentials/bucket up front\nif ufileAccessKey == \"\" || ufileBucket == \"\" {\n\treturn fmt.Errorf(\"missing UFile credentials or bucket\")\n}","typeGuard":null,"tryCatchPattern":"parts, marker, err := store.ListUploads(ctx)\nif err != nil {\n\t// ErrMsg from UFile is in err — log and check auth/bucket config\n\tlogger.Errorf(\"list uploads: %v\", err)\n}","preventionTips":["Keep UCloud API keys valid and rotated before expiry","Confirm bucket name and region match between config and console","Log the full ErrMsg to identify the specific UFile RetCode"],"tags":["ufile","api-error","listing"],"backgroundTag":"api-error-response","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}