AlistGo/alist · error

failed to get credentials from NewProtonDrive

Error message

failed to get credentials from NewProtonDrive

What it means

ProtonDrive.Init: NewProtonDrive returned nil credentials on a fresh (non-reusable) login, meaning authentication did not produce a usable session (bad credentials or session setup failure) even before err handling.

Solutions

  1. Check the account credentials in the storage configuration and correct them, then save and retry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at drivers/proton_drive/driver.go:145 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/7939208d586057a0. Report an issue: GitHub.

Appendix: source

Thrown at drivers/proton_drive/driver.go:145

		ReusableCredential:         reusableCredential,
		CredentialCacheFile:        d.credentialCacheFile,
	}

	if config.FirstLoginCredential == nil {
		return fmt.Errorf("failed to create login credentials, FirstLoginCredential cannot be nil")
	}

	//fmt.Printf("Calling NewProtonDrive...")

	protonDrive, credentials, err := proton_api_bridge.NewProtonDrive(
		ctx,
		config,
		func(auth proton.Auth) {},
		func() {},
	)

	if credentials == nil && !useReusableLogin {
		return fmt.Errorf("failed to get credentials from NewProtonDrive")
	}

	if err != nil {
		return fmt.Errorf("failed to initialize ProtonDrive: %w", err)
	}

	d.protonDrive = protonDrive

	var finalCredentials *common.ProtonDriveCredential

	if useReusableLogin {

		// For reusable login, create credentials from cached data
		finalCredentials = &common.ProtonDriveCredential{
			UID:           reusableCredential.UID,
			AccessToken:   reusableCredential.AccessToken,
			RefreshToken:  reusableCredential.RefreshToken,
			SaltedKeyPass: reusableCredential.SaltedKeyPass,

View on GitHub (pinned to 843d9dc814)