{"record":{"id":"411127c9ee5a8a19","repo":"AlistGo/alist","slug":"make-dir-failed-s","errorCode":null,"errorMessage":"make dir failed: %s","messagePattern":"make dir failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/guangyapan/driver.go","lineNumber":261,"sourceCode":"\t\treturn err\n\t}\n\n\tname := strings.TrimSpace(dirName)\n\tif name == \"\" {\n\t\treturn errors.New(\"dir name is empty\")\n\t}\n\n\tparentID := parentDir.GetID()\n\n\tvar out createDirResp\n\tif err := d.postAPI(ctx, \"/nd.bizuserres.s/v1/file/create_dir\", map[string]any{\n\t\t\"parentId\": parentID,\n\t\t\"dirName\":  name,\n\t}, &out); err != nil {\n\t\treturn err\n\t}\n\tif !strings.EqualFold(strings.TrimSpace(out.Msg), \"success\") {\n\t\treturn fmt.Errorf(\"make dir failed: %s\", strings.TrimSpace(out.Msg))\n\t}\n\treturn nil\n}\n\nfunc (d *GuangYaPan) Rename(ctx context.Context, srcObj model.Obj, newName string) error {\n\tif err := d.ensureAccessToken(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tfileID := strings.TrimSpace(srcObj.GetID())\n\tif fileID == \"\" {\n\t\treturn errors.New(\"file id is empty\")\n\t}\n\tname := strings.TrimSpace(newName)\n\tif name == \"\" {\n\t\treturn errors.New(\"new name is empty\")\n\t}\n","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/guangyapan/driver.go#L243-L279","documentation":"GuangYaPan (光雅盘) MakeDir error: the create_dir endpoint answered HTTP-success but its msg field was not 'success' (case-insensitive), so the driver reports 'make dir failed: <backend msg>'. The backend returns Chinese-language or code-style messages describing why directory creation was rejected.","triggerScenarios":"Calling MakeDir where /nd.bizuserres.s/v1/file/create_dir rejects the request: duplicate directory name, invalid characters in dirName, parent ID not a folder, or account-level restrictions — postAPI succeeds but msg != success.","commonSituations":"Creating a folder that already exists at the same level; names with characters the backend forbids; parent folder ID from a stale cache; account out of folder quota or not entitled to create folders.","solutions":["Read the backend msg in the error text — it names the exact rejection reason","Check whether a folder with the same name already exists at the destination and rename if so","Sanitize folder names (remove forbidden punctuation/emoji) before creating","Refresh the parent listing to confirm parentID is a live directory"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"func safeDirName(name string) bool {\n  trimmed := strings.TrimSpace(name)\n  return trimmed != \"\" && !strings.ContainsAny(trimmed, \"\\\\/:*?\\\"<>|\")\n}","typeGuard":null,"tryCatchPattern":"err := d.MakeDir(ctx, parentDir, name)\nif err != nil {\n  if strings.HasPrefix(err.Error(), \"make dir failed\") {\n    // parse backend msg; on duplicate-exists treat as success for idempotency\n  }\n}","preventionTips":["Check the parent listing for name collisions before creating folders","Sanitize names of filesystem-reserved characters"],"tags":["guangyapan","mkdir","api","backend-error"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}