{"record":{"id":"6a2a5e5f829155eb","repo":"AlistGo/alist","slug":"resolve-root-folder-path-failed-folder-q-not-fou","errorCode":null,"errorMessage":"resolve root folder path failed: folder %q not found under /","messagePattern":"resolve root folder path failed: folder %q not found under /","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/guangyapan/driver.go","lineNumber":522,"sourceCode":"\t\tif err := d.postAPI(ctx, \"/nd.bizuserres.s/v1/file/get_file_list\", body, &resp); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tfor _, item := range resp.Data.List {\n\t\t\tseen++\n\t\t\tif item.ResType == 2 && item.FileName == name {\n\t\t\t\treturn item.FileID, nil\n\t\t\t}\n\t\t}\n\t\tif len(resp.Data.List) < pageSize {\n\t\t\tbreak\n\t\t}\n\t\tif resp.Data.Total > 0 && seen >= resp.Data.Total {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif parentID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"resolve root folder path failed: folder %q not found under /\", name)\n\t}\n\treturn \"\", fmt.Errorf(\"resolve root folder path failed: folder %q not found under parent %s\", name, parentID)\n}\n\nfunc (d *GuangYaPan) ensureAccessToken(ctx context.Context) error {\n\tif strings.TrimSpace(d.AccessToken) != \"\" {\n\t\treturn nil\n\t}\n\tif strings.TrimSpace(d.RefreshToken) == \"\" {\n\t\tif d.canSMSLogin() {\n\t\t\treturn d.loginBySMSCode(ctx)\n\t\t}\n\t\tif d.PhoneNumber != \"\" {\n\t\t\treturn errors.New(\"not logged in yet: please fill verify_code and save storage to finish SMS login\")\n\t\t}\n\t\treturn errors.New(\"access token is empty\")\n\t}\n\treturn d.refreshToken(ctx)","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/guangyapan/driver.go#L504-L540","documentation":"Thrown while resolving the configured RootPath: the driver paginated through the children of the root directory (/) and no folder named `name` was found, so parentID stayed empty. It is a path-configuration error surfaced by resolveRootFolderID, not an API failure.","triggerScenarios":"Init/directory listing calls resolveRootFolderID for the first path segment of RootPath and, after scanning all pages (loop exits when page is short or seen >= total), no entry matches that name under /.","commonSituations":"RootPath in the storage config references a folder that was renamed or deleted on GuangYaPan; typo or leading/trailing slash in RootPath; the folder exists but is invisible because the account lacks permission or the API pagination total is inaccurate.","solutions":["Verify the exact folder name exists directly under / on GuangYaPan (web UI) and fix RootPath to match.","Remove stray slashes/spaces from RootPath; use a path like /backup not backup/ or //backup.","Re-check that the logged-in account can see that folder.","If the folder genuinely must exist, create it under / first or point RootPath at /."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before saving storage config, confirm the path is clean\np := strings.TrimSpace(cfg.RootPath)\np = strings.Trim(p, \"/\")\nif p == \"\" || strings.Contains(p, \"//\") {\n    return errors.New(\"root_folder_path must be a clean path like /backup\")\n}","typeGuard":null,"tryCatchPattern":"if err := storage.Init(ctx); err != nil {\n    if strings.Contains(err.Error(), \"resolve root folder path failed\") {\n        // config error: show the user which folder name failed, do not retry\n        return fmt.Errorf(\"check root_folder_path: %w\", err)\n    }\n}","preventionTips":["Validate RootPath format at configuration time.","After renaming/moving folders on the provider, update RootPath immediately.","Test storage config before enabling schedules that depend on it."],"tags":["root-path","folder-not-found","configuration","guangyapan"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}