AlistGo/alist · error
message
Error message
message
What it means
The vtencent ugcRequest() (UGC upload endpoints, cookie-authenticated) checks the numeric Code field and builds the error from the response's message or msg field. When both are absent, errors.New("") produces an error with an EMPTY message — callers see a blank error. The literal lookup key 'message' is this entry's identifier.
Source
Thrown at drivers/vtencent/util.go:86
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").ToInt()
if code != 0 {
message := utils.Json.Get(res.Body(), "message").ToString()
if len(message) == 0 {
message = utils.Json.Get(res.Body(), "msg").ToString()
}
return nil, errors.New(message)
}
return res.Body(), nil
}
func (d *Vtencent) LoadUser() (string, error) {
api := "https://api.vs.tencent.com/SaaS/Account/DescribeAccount"
res, err := d.request(api, http.MethodPost, func(req *resty.Request) {}, nil)
if err != nil {
return "", err
}
return utils.Json.Get(res, "Data", "TfUid").ToString(), nil
}
func (d *Vtencent) GetFiles(dirId string) ([]File, error) {
var res []File
//offset := 0
for {
api := "https://api.vs.tencent.com/PaaS/Material/SearchResource"View on GitHub (pinned to 843d9dc814)
Solutions
- Update the Cookie addition in the vtencent storage config and re-save
- Retry the whole upload flow (fresh ApplyUploadUGC) rather than just the failed commit step
- If the error is blank, capture res.Body() (add temporary logging) to see the real response before acting
- Check origin/referrer requirements if a WAF-style rejection is suspected
Example fix
// before
message := utils.Json.Get(res.Body(), "message").ToString()
if len(message) == 0 {
message = utils.Json.Get(res.Body(), "msg").ToString()
}
return nil, errors.New(message)
// after
message := utils.Json.Get(res.Body(), "message").ToString()
if len(message) == 0 {
message = utils.Json.Get(res.Body(), "msg").ToString()
}
if len(message) == 0 {
message = fmt.Sprintf("ugc api error code=%d body=%s", code, res.Body())
}
return nil, errors.New(message) Defensive patterns
Strategy: try-catch
Validate before calling
// pre-check auth cookie exists before UGC calls
if strings.TrimSpace(d.Cookie) == "" {
return errors.New("vtencent cookie is empty — update credentials before uploading")
} Try / catch
_, err := d.ugcRequest(api, http.MethodPost, cb, &out)
if err != nil {
if err.Error() == "" {
// blank error: log raw body and assume session expiry
log.Warn("ugcRequest returned empty message; refreshing cookie and retrying once")
return d.ugcRequest(api, http.MethodPost, cb, &out) // once, with fresh cookie
}
return err
} Prevention
- Never treat an empty error message as actionable — always capture res.Body() for UGC failures
- Extend the driver to include the numeric Code in the error text
- Keep upload flows short enough to avoid session-key expiry between apply and commit
When it happens
Trigger: UGC API call (e.g. ApplyUploadUGC, CommitUploadUGC) returning Code != 0 with a body that has neither 'message' nor 'msg' — commonly auth-cookie expiry, expired vodSessionKey, or anti-crawler rejection responses that use a different error envelope.
Common situations: Cookie for the vod web console expired (most frequent); Upload session key invalidated because the apply/commit sequence took too long or was retried; Server returning an HTML or differently-shaped JSON error page, leaving message fields empty
Related errors
- code
- string(rsp)
- chunkSize invalid
- 123 offline download cannot target the root directory, pick
- file_id is required
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/2547f2c7b74fd20c.
Report an issue: GitHub.