{"record":{"id":"8e43016642d58606","repo":"AlistGo/alist","slug":"get-upload-config-failed-s","errorCode":null,"errorMessage":"get upload_config failed: %s","messagePattern":"get upload_config failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/doubao/util.go","lineNumber":398,"sourceCode":"\t\t\treturn nil\n\t\t}\n\n\t\t// 100028 凭证过期\n\t\tif configResp.ResponseMetadata.Error.CodeN == 100028 && !tokenRefreshed {\n\t\t\tlog.Debugln(\"[doubao] Upload token expired, re-fetching...\")\n\t\t\tnewToken, err := d.initUploadToken()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to refresh token: %w\", err)\n\t\t\t}\n\n\t\t\td.UploadToken = newToken\n\t\t\ttokenRefreshed = true\n\t\t\tuploadUrl, params = configureParams()\n\n\t\t\treturn retry.Error{errors.New(\"token refreshed, retry needed\")}\n\t\t}\n\n\t\treturn fmt.Errorf(\"get upload_config failed: %s\", configResp.ResponseMetadata.Error.Message)\n\t})\n\n\treturn err\n}\n\n// uploadNode 上传 文件信息\nfunc (d *Doubao) uploadNode(uploadConfig *UploadConfig, dir model.Obj, file model.FileStreamer, dataType string) (UploadNodeResp, error) {\n\treqUuid := uuid.New().String()\n\tvar key string\n\tvar nodeType int\n\n\tmimetype := file.GetMimetype()\n\tswitch dataType {\n\tcase VideoDataType:\n\t\tkey = uploadConfig.InnerUploadAddress.UploadNodes[0].Vid\n\t\tif strings.HasPrefix(mimetype, \"audio/\") {\n\t\t\tnodeType = AudioType // 音频类型\n\t\t} else {","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/doubao/util.go#L380-L416","documentation":"The Doubao upload-config request returned a ResponseMetadata error other than 100028 (which is handled by token refresh), and the driver surfaces the backend's Message verbatim. This is the generic failure path for obtaining the upload address (host, store URI, slice size) required before any bytes are sent.","triggerScenarios":"Calling getUploadConfig with a token whose Alice/Samantha credentials lack upload permission, a data type the backend rejects, quota/rate errors, or any non-100028 backend error code; also reached when 100028 occurs a second time after one refresh (tokenRefreshed already true).","commonSituations":"Cookie valid enough for listing but not for uploads; account storage full; too many concurrent uploads; Doubao app/API version change introducing new required parameters.","solutions":["Read the Message text — Doubao messages are usually descriptive (quota, permission, invalid params)","Retry after re-login if the message hints at auth even though code != 100028","Reduce concurrent upload threads (uploadThread setting) if the message indicates throttling","If it persistently fails with a fresh login, check the driver repo for API-contract updates"],"exampleFix":"// before\nreturn fmt.Errorf(\"get upload_config failed: %s\", configResp.ResponseMetadata.Error.Message)\n// after\nreturn fmt.Errorf(\"get upload_config failed: code=%d msg=%s (request_id: %s)\",\n\tconfigResp.ResponseMetadata.Error.CodeN,\n\tconfigResp.ResponseMetadata.Error.Message,\n\tconfigResp.ResponseMetadata.RequestId)","handlingStrategy":"try-catch","validationCode":"if _, err := d.GetUserInfo(ctx); err != nil {\n\treturn fmt.Errorf(\"doubao session invalid before upload: %w\", err)\n}","typeGuard":"func isUploadConfigError(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"get upload_config failed\")\n}","tryCatchPattern":"if isUploadConfigError(err) {\n\tmsg := extractMessage(err)\n\tif containsAny(msg, \"limit\", \"frequent\") { return backoffRetry(60*time.Second) }\n\tif containsAny(msg, \"auth\", \"login\") { return relogin() }\n\treturn fail(err)\n}","preventionTips":["Pre-flight a cheap authenticated call before large uploads","Throttle concurrent uploads below provider limits","Keep driver updated after Doubao app releases"],"tags":["doubao","upload","api-error","config"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}