{"record":{"id":"64d6e77480cd152b","repo":"AlistGo/alist","slug":"ref-storage-is-not-s","errorCode":null,"errorMessage":"ref: storage is not %s","messagePattern":"ref: storage is not (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/op/storage.go","lineNumber":144,"sourceCode":"\terr = utils.Json.UnmarshalFromString(driverStorage.Addition, storageDriver.GetAddition())\n\tif err == nil {\n\t\tif ref, ok := storageDriver.(driver.Reference); ok {\n\t\t\tif strings.HasPrefix(driverStorage.Remark, \"ref:/\") {\n\t\t\t\trefMountPath := driverStorage.Remark\n\t\t\t\ti := strings.Index(refMountPath, \"\\n\")\n\t\t\t\tif i > 0 {\n\t\t\t\t\trefMountPath = refMountPath[4:i]\n\t\t\t\t} else {\n\t\t\t\t\trefMountPath = refMountPath[4:]\n\t\t\t\t}\n\t\t\t\tvar refStorage driver.Driver\n\t\t\t\trefStorage, err = GetStorageByMountPath(refMountPath)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = fmt.Errorf(\"ref: %w\", err)\n\t\t\t\t} else {\n\t\t\t\t\terr = ref.InitReference(refStorage)\n\t\t\t\t\tif err != nil && errs.IsNotSupportError(err) {\n\t\t\t\t\t\terr = fmt.Errorf(\"ref: storage is not %s\", storageDriver.Config().Name)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif err == nil {\n\t\terr = storageDriver.Init(ctx)\n\t}\n\tstoragesMap.Store(driverStorage.MountPath, storageDriver)\n\tif err != nil {\n\t\tdriverStorage.SetStatus(err.Error())\n\t\terr = errors.Wrap(err, \"failed init storage\")\n\t} else {\n\t\tdriverStorage.SetStatus(WORK)\n\t}\n\tMustSaveDriverStorage(storageDriver)\n\treturn err\n}","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/op/storage.go#L126-L162","documentation":"For a reference storage, ref.InitReference(refStorage) returned an errs.NotSupport error, meaning the referenced storage's driver is not of the type the reference driver requires (e.g. a 'alias'-style reference can only point at a storage of the same/compatible driver). The message names the driver type the reference actually is.","triggerScenarios":"Creating a reference storage of driver type X whose ref:/ path points at a storage of driver type Y (e.g. an Onedrive reference pointing at a local or S3 mount), so InitReference rejects it with NotSupport.","commonSituations":"Mixing driver types when setting up reference storages after reading old documentation; AList version changes that tightened which drivers support cross-driver references.","solutions":["Point the reference storage at a mount backed by the same driver type named in the error","Or use the actual driver the target storage uses when creating the reference entry","Upgrade/downgrade to an AList version whose reference semantics match your setup"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure the reference target uses the same driver as the reference storage\nif target.Config().Name != refDriver.Config().Name {\n    return errors.New(\"reference target must use the same storage driver\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match driver types between reference and target storage when configuring","Test reference storages right after creation so mismatches surface early","Document which drivers support being referenced in your deployment"],"tags":["go","storage","driver","reference","config"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}