AlistGo/alist · error
code
Error message
code
What it means
The vtencent driver's request() reads the JSON field Code from every response and expects "Success"; any other value becomes errors.New(code) — the error message is the raw API error code string itself (this entry is the default branch, e.g. 'AuthFailure.SignatureExpire', 'InvalidParameter'). Tencent Cloud VOD/INS API error codes are the only diagnostic the driver surfaces, without the accompanying message field.
Source
Thrown at drivers/vtencent/util.go:50
})
if callback != nil {
callback(req)
} else {
req.SetBody("{}")
}
if resp != nil {
req.SetResult(resp)
}
res, err := req.Execute(method, url)
if err != nil {
return nil, err
}
code := utils.Json.Get(res.Body(), "Code").ToString()
if code != "Success" {
switch code {
case "AuthFailure.SessionInvalid":
if err != nil {
return nil, errors.New(code)
}
default:
return nil, errors.New(code)
}
return d.request(url, method, callback, resp)
}
return res.Body(), nil
}
func (d *Vtencent) ugcRequest(url, method string, callback base.ReqCallback, resp interface{}) ([]byte, error) {
req := base.RestyClient.R()
req.SetHeaders(map[string]string{
"cookie": d.Cookie,
"content-type": "application/json",
"origin": d.conf.origin,
"referer": d.conf.referer,
})
if callback != nil {View on GitHub (pinned to 843d9dc814)
Solutions
- Verify SecretId/SecretKey in storage settings and re-save to re-run Init
- Check server time (ntp) if the code is AuthFailure.Signature*
- Grant the CAM principal the required VOD/INS permissions and retry
- Search the exact code string in Tencent Cloud API docs (Error Codes section) for the authoritative cause
Defensive patterns
Strategy: try-catch
Validate before calling
// validate credentials before mounting
if _, err := vt.LoadUser(); err != nil {
return fmt.Errorf("vtencent credentials invalid: %w", err)
} Try / catch
body, err := d.request(api, method, cb, resp)
if err != nil {
code := err.Error()
switch {
case strings.HasPrefix(code, "AuthFailure.Signature"):
// sync clock / check server time, then retry once
case code == "AuthFailure.SecretIdNotFound" || code == "AuthFailure.SignatureFailure":
// credentials wrong: stop and prompt reconfiguration
case strings.HasPrefix(code, "AuthFailure"): // other authz failures
// check CAM permissions for the action
default:
return fmt.Errorf("tencent api %s: %s", api, code)
}
} Prevention
- Map Tencent error-code prefixes to recovery actions (signature->clock, SecretIdNotFound->credentials, UnauthorizedOperation->CAM)
- Run a cheap DescribeAccount call at Init to fail fast on bad credentials
- Keep server time NTP-synced to avoid signature expiry errors
When it happens
Trigger: Any signed Tencent Cloud API call (DescribeAccount, media APIs) returning Code != "Success" — expired signature (clock skew), invalid SecretId/SecretKey, missing CAM permission for the action, or malformed parameters. The switch on 'AuthFailure.SessionInvalid' here contains a dead `if err != nil` check (err is always nil at that point) so session-invalid falls through to the recursive retry on line 55 instead of returning here.
Common situations: Wrong or rotated Tencent Cloud API credentials in the storage config; Server clock skew breaking the signature (AuthFailure.SignatureExpire); IAM/CAM principal lacking vod/ins permissions; Region mismatch causing invalid-endpoint style codes
Related errors
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/e4182f454eb3058e.
Report an issue: GitHub.