AlistGo/alist · error

either keyPass or saltedKeyPass must be not nil

Error message

either keyPass or saltedKeyPass must be not nil

What it means

Sentinel ErrKeyPassOrSaltedKeyPassMustBeNotNil raised in getAccountKRs: Proton Drive key derivation requires either the account password (keyPass) or a cached salted key pass to unlock the user's keyrings; both were nil, so decryption material cannot be built. Fires when a driver instance is created without a password.

Solutions

  1. Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at drivers/proton_drive/util.go:474 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at drivers/proton_drive/util.go:474

	if err != nil {
		return nil, err
	}

	parentNodeKR, err := d.getLinkKR(ctx, parentLink)
	if err != nil {
		return nil, err
	}

	signatureVerificationKR, err := d.getSignatureVerificationKeyring([]string{link.SignatureEmail})
	if err != nil {
		return nil, err
	}

	return link.GetKeyRing(parentNodeKR, signatureVerificationKR)
}

var (
	ErrKeyPassOrSaltedKeyPassMustBeNotNil = errors.New("either keyPass or saltedKeyPass must be not nil")
	ErrFailedToUnlockUserKeys             = errors.New("failed to unlock user keys")
)

func getAccountKRs(ctx context.Context, c *proton.Client, keyPass, saltedKeyPass []byte) (*crypto.KeyRing, map[string]*crypto.KeyRing, map[string]proton.Address, []byte, error) {

	user, err := c.GetUser(ctx)
	if err != nil {
		return nil, nil, nil, nil, err
	}
	// fmt.Printf("user %#v", user)

	addrsArr, err := c.GetAddresses(ctx)
	if err != nil {
		return nil, nil, nil, nil, err
	}
	// fmt.Printf("addr %#v", addr)

	if saltedKeyPass == nil {

View on GitHub (pinned to 843d9dc814)