{"record":{"id":"116ebe787613a701","repo":"AlistGo/alist","slug":"unsupported-storage-driver-for-offline-download-o-116ebe","errorCode":null,"errorMessage":"unsupported storage driver for offline download, only Thunder is supported","messagePattern":"unsupported storage driver for offline download, only Thunder is supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/offline_download/thunder/thunder.go","lineNumber":63,"sourceCode":"\tif err != nil {\n\t\treturn false\n\t}\n\tif _, ok := storage.(*thunder.Thunder); !ok {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (t *Thunder) AddURL(args *tool.AddUrlArgs) (string, error) {\n\t// 添加新任务刷新缓存\n\tt.refreshTaskCache = true\n\tstorage, actualPath, err := op.GetStorageAndActualPath(args.TempDir)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tthunderDriver, ok := storage.(*thunder.Thunder)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unsupported storage driver for offline download, only Thunder is supported\")\n\t}\n\n\tctx := context.Background()\n\n\tif err := op.MakeDir(ctx, storage, actualPath); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tparentDir, err := op.GetUnwrap(ctx, storage, actualPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\ttask, err := thunderDriver.OfflineDownload(ctx, args.Url, parentDir, \"\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to add offline download task: %w\", err)\n\t}\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/offline_download/thunder/thunder.go#L45-L81","documentation":"Thunder.AddURL() type-asserts the storage behind args.TempDir to *thunder.Thunder; only a Thunder (Xunlei) cloud-drive mount can accept offline tasks. Any other driver (local disk, another cloud) fails the assertion and the URL is never submitted.","triggerScenarios":"Adding a URL with tool=thunder while the temp/save dir is on local or non-Thunder storage; Thunder storage unmounted between configuration and use.","commonSituations":"Offline download tool set to Thunder but destination left at the default local path; mount path typo pointing at the wrong storage.","solutions":["Set the download directory to a path on the Thunder storage mount","Or use http/aria2 for local destinations","Confirm the storage driver shows 'Thunder' in the admin storages page"],"exampleFix":"// before\n{ \"tool\": \"thunder\", \"temp_dir\": \"/local/dl\" }\n\n// after\n{ \"tool\": \"thunder\", \"temp_dir\": \"/thunder/dl\" }","handlingStrategy":"type-guard","validationCode":"storage, _, err := op.GetStorageAndActualPath(args.TempDir)\nif err != nil {\n    return err\n}\nif storage.Driver != \"Thunder\" {\n    return fmt.Errorf(\"thunder tool requires a Thunder mount, got %s\", storage.Driver)\n}","typeGuard":"func asThunder(tempDir string) (*thunder.Thunder, error) {\n    storage, _, err := op.GetStorageAndActualPath(tempDir)\n    if err != nil {\n        return nil, err\n    }\n    d, ok := storage.(*thunder.Thunder)\n    if !ok {\n        return nil, fmt.Errorf(\"%s is on %q storage, need Thunder\", tempDir, storage.Driver)\n    }\n    return d, nil\n}","tryCatchPattern":"if _, err := t.AddURL(args); err != nil {\n    if strings.Contains(err.Error(), \"only Thunder is supported\") {\n        return userError(\"select a Thunder storage directory\")\n    }\n    return err\n}","preventionTips":["Match the offline tool to the destination mount's driver at setup","Prefer local tools (http/aria2) for local destinations","Automate the driver/tool compatibility check in the settings UI"],"tags":["thunder","storage-driver","type-assertion","offline-download"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}