AlistGo/alist · error

api_login and api_key are required

Error message

api_login and api_key are required

What it means

Streamtape driver Init() refuses to start when either the API login (username) or the API key is missing/whitespace. Streamtape's remote-upload API authenticates every call with the api_login/api_key pair taken from the Streamtape dashboard, so there is nothing the driver can do without them; Init fails before the first /account/info call.

Source

Thrown at drivers/streamtape/driver.go:39

type Streamtape struct {
	model.Storage
	Addition
}

var waitMoreSecondsRe = regexp.MustCompile(`wait\s+(\d+)\s+more\s+seconds?`)

func (d *Streamtape) Config() driver.Config {
	return config
}

func (d *Streamtape) GetAddition() driver.Additional {
	return &d.Addition
}

func (d *Streamtape) Init(ctx context.Context) error {
	if strings.TrimSpace(d.APILogin) == "" || strings.TrimSpace(d.APIKey) == "" {
		return errors.New("api_login and api_key are required")
	}
	if d.RootFolderID == "" {
		d.RootFolderID = "0"
	}

	var account accountInfo
	if err := d.callAPI(ctx, "/account/info", nil, &account); err != nil {
		return err
	}

	op.MustSaveDriverStorage(d)
	return nil
}

func (d *Streamtape) Drop(ctx context.Context) error {
	return nil
}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Log in to streamtape.com, enable API access, copy login + key into the storage's addition fields
  2. Trim any accidental whitespace when pasting
  3. Re-save the storage so Init re-runs and validates via /account/info
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(addition.APILogin) == "" || strings.TrimSpace(addition.APIKey) == "" {
    return errors.New("fill api_login and api_key from streamtape.com > Settings > API before adding this storage")
}

Prevention

When it happens

Trigger: Adding a Streamtape storage with an empty 'api_login' or 'api_key' addition field; saving the storage after the fields were cleared; copy-pasting the key with only whitespace characters.

Common situations: User never generated API credentials at streamtape.com > My Account > Settings > API; Confusing the account password with the API key; Leading/trailing spaces or newlines pasted into the config fields (only TrimSpace-checked, mismatched key still passes this guard but fails later at /account/info)

Related errors


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