AlistGo/alist · error · ErrResp

-10001

-10001

Error message

ErrorCode: %d ,Error: %s ,ServerRunTime: %f ,ServerName: %s

What it means

FebBox API returned error code -10001 (normally meaning an expired access_token) but the error payload had an empty ServerName, so the driver could not take its automatic refresh-and-retry path and instead surfaced the formatted error via errors.New(e.Error()). The message is the ErrResp.Error() formatting: ErrorCode, Error text, ServerRunTime and ServerName. In practice this means the token-refresh recovery was skipped because the server response was malformed or came from an endpoint that does not populate ServerName.

Source

Thrown at drivers/febbox/util.go:61

	res, err := req.Execute(method, url)
	if err != nil {
		return nil, err
	}

	switch e.ErrorCode {
	case 0:
		return res.Body(), nil
	case 1:
		return res.Body(), nil
	case -10001:
		if e.ServerName != "" {
			// access_token 过期
			if err = d.refreshTokenByOAuth2(); err != nil {
				return nil, err
			}
			return d.request(url, method, callback, resp)
		} else {
			return nil, errors.New(e.Error())
		}
	default:
		return nil, errors.New(e.Error())
	}
}

func (d *FebBox) getFilesList(id string) ([]File, error) {
	if d.PageSize <= 0 {
		d.PageSize = 100
	}
	res, err := d.listWithLimit(id, d.PageSize)
	if err != nil {
		return nil, err
	}
	return *res, nil
}

func (d *FebBox) listWithLimit(dirID string, pageLimit int64) (*[]File, error) {

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Log the raw response body (res.Body()) when ErrorCode == -10001 to see the actual server payload and whether ServerName is truly absent.
  2. Check whether the stored refresh token is still valid; re-authorize the FebBox driver in the storage settings to obtain fresh tokens.
  3. If the payload is legitimately missing ServerName but the token is expired, consider refreshing anyway (patch the driver to attempt refreshTokenByOAuth2 on -10001 regardless of ServerName).
  4. Verify the driver and API endpoint versions match (update OpenList/AList so the FebBox driver matches the current FebBox API).

Example fix

// before
case -10001:
    if e.ServerName != "" {
        if err = d.refreshTokenByOAuth2(); err != nil {
            return nil, err
        }
        return d.request(url, method, callback, resp)
    } else {
        return nil, errors.New(e.Error())
    }

// after (still refresh once when ServerName is empty)
case -10001:
    if err = d.refreshTokenByOAuth2(); err != nil {
        return nil, errors.New(e.Error())
    }
    return d.request(url, method, callback, resp)
Defensive patterns

Strategy: retry

Validate before calling

// before calling driver ops, ensure tokens are fresh
if d.Addition.RefreshToken == "" {
    return errors.New("febbox refresh token missing; re-authorize storage")
}

Try / catch

err := doFebBoxOp()
if err != nil && strings.Contains(err.Error(), "-10001") {
    // force re-auth then retry once
    if rerr := d.refreshTokenByOAuth2(); rerr == nil {
        err = doFebBoxOp()
    }
}

Prevention

When it happens

Trigger: Any FebBox request (listing, upload, download) where the JSON error body has ErrorCode == -10001 and ServerName == "". The request() switch takes the else branch at drivers/febbox/util.go:60-62 instead of calling refreshTokenByOAuth2().

Common situations: FebBox backend change altering the error payload shape; a proxy or gateway stripping fields from the error JSON; an API version change where -10001 is returned for a different condition (e.g. invalid rather than expired token); clock skew causing the server to reject the token without the expected metadata.

Related errors


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