{"record":{"id":"2f303165c5e6d5ee","repo":"AlistGo/alist","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/kodbox/driver.go","lineNumber":105,"sourceCode":"\t\t\tpath,\n\t\t\td.authorization)}, nil\n}\n\nfunc (d *KodBox) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error) {\n\tvar resp *CommonResp\n\tnewDirPath := filepath.Join(parentDir.GetPath(), dirName)\n\n\t_, err := d.request(http.MethodPost, \"/?explorer/index/mkdir\", func(req *resty.Request) {\n\t\treq.SetResult(&resp).SetFormData(map[string]string{\n\t\t\t\"path\": newDirPath,\n\t\t})\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcode := resp.Code.(bool)\n\tif !code {\n\t\treturn nil, fmt.Errorf(\"%s\", resp.Data)\n\t}\n\n\treturn &model.ObjThumb{\n\t\tObject: model.Object{\n\t\t\tPath:     resp.Info.(string),\n\t\t\tName:     dirName,\n\t\t\tIsFolder: true,\n\t\t\tModified: time.Now(),\n\t\t\tCtime:    time.Now(),\n\t\t},\n\t}, nil\n}\n\nfunc (d *KodBox) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error) {\n\tvar resp *CommonResp\n\t_, err := d.request(http.MethodPost, \"/?explorer/index/pathCuteTo\", func(req *resty.Request) {\n\t\treq.SetResult(&resp).SetFormData(map[string]string{\n\t\t\t\"dataArr\": fmt.Sprintf(\"[{\\\"path\\\": \\\"%s\\\", \\\"name\\\": \\\"%s\\\"}]\",","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/kodbox/driver.go#L87-L123","documentation":"Raised by KodBox driver MakeDir after the POST to /?explorer/index/mkdir succeeded at HTTP level but the API's application-level Code flag came back false. KodBox's CommonResp.Code is an any (bool on success); when false, Data carries a human-readable server message which is passed through verbatim as the error text.","triggerScenarios":"Creating a directory via MakeDir where the KodBox server rejects it: newDirPath already exists, parent path invalid, insufficient permission, or session/token issues that were not the specific '10001' re-auth case.","commonSituations":"Duplicate folder names, wrong root path in the mount config, KodBox user lacking write permission on the target folder, or an expired accessToken whose failure code is not handled by the token-refresh branch.","solutions":["Check the message in resp.Data (surfaced as the error text) — it is the KodBox server's own reason (e.g. 'already exists', 'no permission')","Verify the parent path exists and the configured KodBox user can create folders there via the KodBox web UI","Re-login / refresh credentials: force re-auth by reloading the storage so getToken() runs again"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := d.MakeDir(ctx, parent, name); err != nil {\n    if strings.Contains(err.Error(), \"exist\") { // server passthrough text\n        // treat as idempotent success: fetch existing dir\n    }\n    return err\n}","preventionTips":["List the parent directory first and skip creation when the folder name already exists","Keep the KodBox token fresh (reload storage) before batch operations","Log the passthrough message verbatim — it is the server's authoritative reason"],"tags":["kodbox","api-error","mkdir","passthrough","openlist"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}