{"record":{"id":"799ffdd576e90863","repo":"AlistGo/alist","slug":"paths-is-required","errorCode":null,"errorMessage":"paths is required","messagePattern":"paths is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/alias/driver.go","lineNumber":34,"sourceCode":"type Alias struct {\n\tmodel.Storage\n\tAddition\n\tpathMap     map[string][]string\n\tautoFlatten bool\n\toneKey      string\n}\n\nfunc (d *Alias) Config() driver.Config {\n\treturn config\n}\n\nfunc (d *Alias) GetAddition() driver.Additional {\n\treturn &d.Addition\n}\n\nfunc (d *Alias) Init(ctx context.Context) error {\n\tif d.Paths == \"\" {\n\t\treturn errors.New(\"paths is required\")\n\t}\n\td.pathMap = make(map[string][]string)\n\tfor _, path := range strings.Split(d.Paths, \"\\n\") {\n\t\tpath = strings.TrimSpace(path)\n\t\tif path == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tk, v := getPair(path)\n\t\td.pathMap[k] = append(d.pathMap[k], v)\n\t}\n\tif len(d.pathMap) == 1 {\n\t\tfor k := range d.pathMap {\n\t\t\td.oneKey = k\n\t\t}\n\t\td.autoFlatten = true\n\t} else {\n\t\td.oneKey = \"\"\n\t\td.autoFlatten = false","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/alias/driver.go#L16-L52","documentation":"Thrown by the Alias driver's Init when the Addition.Paths configuration field is empty. The alias driver mounts other storages' sub-paths under virtual names, and without at least one 'name: target-path' pair there is nothing to mount, so initialization refuses to proceed.","triggerScenarios":"Adding an Alias storage mount with an empty or whitespace-only Paths field; Paths containing only blank lines (they are all skipped, leaving pathMap empty even though the initial string check passed only for the fully-empty case).","commonSituations":"UI form submitted without filling the paths textarea; config migration/export dropped the multi-line field; YAML/JSON storage config where newline-separated paths got collapsed to empty; trailing-whitespace-only entries after editing.","solutions":["Fill Paths with at least one line in the format 'alias_name: /mounted-storage/sub/path' (one per line) and re-save the storage","Trim the field and verify it contains a non-empty line before calling Init/driver add","If paths were lost during config migration, restore them from a storage-config backup before restarting"],"exampleFix":"# before (Addition.Paths)\n\"\"\n\n# after — one mapping per line\nphotos: /onedrive/Pictures\nwork: /s3ftp/shared/reports","handlingStrategy":"validation","validationCode":"// Validate Paths before adding the Alias storage\nlines := strings.Split(strings.TrimSpace(addition.Paths), \"\\n\")\nvalid := 0\nfor _, l := range lines {\n    if strings.TrimSpace(l) != \"\" && strings.Contains(l, \":\") {\n        valid++\n    }\n}\nif valid == 0 {\n    return errors.New(\"paths is required: add at least one 'name: /storage/sub' line\")\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Treat Paths as mandatory in any config UI; disable save while it is empty","Smoke-test alias storages after config import/migration — multiline fields are the first to be lost","Document the exact 'alias: target' line format next to the field"],"tags":["alias","driver-config","init","validation"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}