{"record":{"id":"070c23ee5ca59e48","repo":"AlistGo/alist","slug":"wukong-detail-failed-code-d-message-s","errorCode":null,"errorMessage":"wukong detail failed: code=%d message=%s","messagePattern":"wukong detail failed: code=(.+?) message=(.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/wukong/driver.go","lineNumber":164,"sourceCode":"\n\tvar resp rawResp\n\t_, err := d.client.R().\n\t\tSetContext(ctx).\n\t\tSetQueryParams(map[string]string{\n\t\t\t\"aid\":             d.Aid,\n\t\t\t\"device_platform\": \"web\",\n\t\t\t\"language\":        d.Language,\n\t\t}).\n\t\tSetBody(map[string]any{\n\t\t\t\"file_id_list\": []any{asIDValue(fileID)},\n\t\t}).\n\t\tSetResult(&resp).\n\t\tPost(\"/netdisk/user_file/detail\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.Code != 0 {\n\t\treturn nil, fmt.Errorf(\"wukong detail failed: code=%d message=%s\", resp.Code, resp.Message)\n\t}\n\n\turl := extractDetailMainURL(resp.Data)\n\tif url == \"\" {\n\t\turl = extractURL(resp.Data)\n\t}\n\tif url == \"\" {\n\t\treturn nil, errs.NotImplement\n\t}\n\n\treturn &model.Link{\n\t\tURL: url,\n\t\tHeader: http.Header{\n\t\t\t\"Referer\": []string{webReferer},\n\t\t\t\"Cookie\":  []string{d.Cookie},\n\t\t},\n\t}, nil\n}","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/wukong/driver.go#L146-L182","documentation":"The Wukong driver's Link path posts file IDs to /netdisk/user_file/detail and requires code 0. Non-zero codes with their server message are wrapped as 'wukong detail failed'. This happens before URL extraction, so no download link is produced even though the file lists fine.","triggerScenarios":"Requesting a download link for a file whose detail endpoint rejects the ID — file deleted between List and Link, expired auth, or link-generation not permitted for that file state.","commonSituations":"Copy/download jobs racing deletions, tokens expiring mid-job, or files in a state (e.g. uploading, violating policy) where the API refuses link issuance.","solutions":["Refresh login/credentials and retry the link request.","Re-list the parent folder to confirm the file still exists; if deleted, remove the stale entry (clear path cache).","If the API consistently refuses one file, test it in the official wukong client — policy-restricted files cannot be linked."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"link, err := d.getLink(fileID)\nif err != nil && strings.Contains(err.Error(), \"wukong detail failed\") {\n    // re-list parent to confirm file still exists, refresh login, retry once\n    if _, lerr := d.listDir(fatherID); lerr != nil { return lerr }\n    link, err = d.getLink(fileID)\n}","preventionTips":["Re-validate file existence after long-running jobs before linking","Refresh credentials on detail failures","Test policy-restricted files in the official client to confirm linkability"],"tags":["wukong","api-error","link","download"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}