{"record":{"id":"40f4b688e0fb110c","repo":"AlistGo/alist","slug":"upload-url-is-empty","errorCode":null,"errorMessage":"upload URL is empty","messagePattern":"upload URL is empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/baidu_netdisk/util.go","lineNumber":416,"sourceCode":"\t\t\"uploadid\":       uploadId,\n\t\t\"upload_version\": \"2.0\",\n\t}\n\tapiUrl := \"https://d.pcs.baidu.com/rest/2.0/pcs/file\"\n\tvar resp UploadServerResp\n\t_, err := d.request(apiUrl, http.MethodGet, func(req *resty.Request) {\n\t\treq.SetQueryParams(params)\n\t}, &resp)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tvar uploadUrl string\n\tif len(resp.Servers) > 0 {\n\t\tuploadUrl = resp.Servers[0].Server\n\t} else if len(resp.BakServers) > 0 {\n\t\tuploadUrl = resp.BakServers[0].Server\n\t}\n\tif uploadUrl == \"\" {\n\t\treturn \"\", errors.New(\"upload URL is empty\")\n\t}\n\treturn uploadUrl, nil\n}\n\n// func encodeURIComponent(str string) string {\n// \tr := url.QueryEscape(str)\n// \tr = strings.ReplaceAll(r, \"+\", \"%20\")\n// \treturn r\n// }\n\nfunc DecryptMd5(encryptMd5 string) string {\n\tif _, err := hex.DecodeString(encryptMd5); err == nil {\n\t\treturn encryptMd5\n\t}\n\n\tvar out strings.Builder\n\tout.Grow(len(encryptMd5))\n\tfor i, n := 0, int64(0); i < len(encryptMd5); i++ {","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/baidu_netdisk/util.go#L398-L434","documentation":"Returned by the Baidu Netdisk driver when the pre-create response contains neither Servers nor BakServers entries, so there is no superfile upload endpoint to PUT chunks to. The allocation succeeded but no upload URL was provided.","triggerScenarios":"Calling the precreate/superfile2 upload flow where resp.Servers and resp.BakServers are both empty arrays — typically when the server response shape changed, the response was an unrecognized error, or the region/ISP allocation returned no servers.","commonSituations":"Baidu changed the pre-create response schema (newer driver needed); account is rate-limited or in an abnormal state so precreate returns partial data; network egress via proxy caused server list omission.","solutions":["Enable debug logging and inspect the full precreate response body for an embedded error code","Update alist to the latest version (response-schema changes are fixed driver-side)","Retry after a short cooldown; transient allocation failures do occur","Check the Baidu account status (quota, app authorization) in the netdisk client"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"url, err := d.getUploadUrl(...)\nif err != nil && strings.Contains(err.Error(), \"upload URL is empty\") {\n    time.Sleep(backoff) // allocation may be transient\n    url, err = d.getUploadUrl(...)\n}","preventionTips":["Retry with backoff; server allocation is sometimes transient","Keep the driver version current for response-schema fixes","Log full precreate responses when triaging uploads"],"tags":["baidu-netdisk","upload","api-error","chunked-upload"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}