AlistGo/alist · critical

can't find remote storage: %w

Error message

can't find remote storage: %w

What it means

Thrown during Crypt driver initialization when the configured RemotePath cannot be resolved to a mounted storage via fs.GetStorage. The crypt driver is a wrapper that encrypts/decrypts data on top of an existing storage mount, so it must locate that underlying mount before it can build its cipher and serve requests. If the remote storage is missing, renamed, or the path is malformed, Init fails and the storage cannot be added.

Source

Thrown at drivers/crypt/driver.go:67

	}
	err = d.updateObfusParm(&d.Salt)
	if err != nil {
		return fmt.Errorf("failed to obfuscate salt: %w", err)
	}

	isCryptExt := regexp.MustCompile(`^[.][A-Za-z0-9-_]{2,}$`).MatchString
	if !isCryptExt(d.EncryptedSuffix) {
		return fmt.Errorf("EncryptedSuffix is Illegal")
	}
	d.FileNameEncoding = utils.GetNoneEmpty(d.FileNameEncoding, "base64")
	d.EncryptedSuffix = utils.GetNoneEmpty(d.EncryptedSuffix, ".bin")

	op.MustSaveDriverStorage(d)

	//need remote storage exist
	storage, err := fs.GetStorage(d.RemotePath, &fs.GetStoragesArgs{})
	if err != nil {
		return fmt.Errorf("can't find remote storage: %w", err)
	}
	d.remoteStorage = storage

	p, _ := strings.CutPrefix(d.Password, obfuscatedPrefix)
	p2, _ := strings.CutPrefix(d.Salt, obfuscatedPrefix)
	config := configmap.Simple{
		"password":                  p,
		"password2":                 p2,
		"filename_encryption":       d.FileNameEnc,
		"directory_name_encryption": d.DirNameEnc,
		"filename_encoding":         d.FileNameEncoding,
		"suffix":                    d.EncryptedSuffix,
		"pass_bad_blocks":           "",
	}
	c, err := rcCrypt.NewCipher(config)
	if err != nil {
		return fmt.Errorf("failed to create Cipher: %w", err)
	}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Verify the RemotePath field exactly matches an existing storage mount path (check Storage list in admin UI) and save the crypt storage again
  2. Create/add the underlying storage first, confirm it is healthy (status showing work), then add the crypt storage on top of it
  3. If the underlying storage was renamed, update RemotePath to the new mount path
  4. Check server logs for the wrapped fs.GetStorage error to see the exact path that failed to resolve

Example fix

// before
{
  "remote_path": "/clouddrive",   // no storage mounted at /clouddrive
  "password": "..."
}
// after
{
  "remote_path": "/onedrive",     // matches an existing healthy storage mount
  "password": "..."
}
Defensive patterns

Strategy: validation

Validate before calling

// Before adding the crypt storage, confirm a healthy storage exists at RemotePath
storages, _ := adminStorageList() // fs.GetStorages or admin API
mount := strings.SplitN(remotePath, "/", 3)[1] // first path segment
found := false
for _, s := range storages {
    if strings.Trim(s.MountPath, "/") == mount && s.Status == "work" { found = true }
}
if !found { return errors.New("add the underlying storage at " + mount + " first") }

Try / catch

if err := cryptStorage.Init(ctx); err != nil {
    if strings.Contains(err.Error(), "can't find remote storage") {
        // config problem: fix RemotePath, do not retry
        log.Printf("crypt mount misconfigured: %v", err)
    }
    return err
}

Prevention

When it happens

Trigger: Calling driver Init (adding/refreshing the crypt storage in AList admin UI) with a RemotePath whose mount path does not match any mounted storage, e.g. RemotePath '/cloud' when the actual mount is '/onedrive'. Also triggered when the underlying storage was deleted or its mount path changed after the crypt storage was created, or when RemotePath is set to a sub-path of a mount that fails to load.

Common situations: Typos in the remote_path field; creating the crypt storage before creating the target storage; deleting/renaming the underlying mount; forgetting that RemotePath must be the mount path (with optional subfolder) of an already-added storage; case-sensitivity mismatches in the mount path.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/acf4443c0c556dc3. Report an issue: GitHub.