AlistGo/alist · error
{message}
Error message
{message} What it means
Returned by the strm link reader when link.URL is relative (does not start with http:// or https://) and the site base URL from common.GetApiUrl(nil) is empty, so the relative URL cannot be absolutized. The driver deliberately refuses to guess a host.
Source
Thrown at drivers/123/util.go:237
// return nil, err
//}
//req.SetQueryParam("auth-key", *authKey)
res, err := req.Execute(method, GetApi(url))
if err != nil {
return nil, err
}
body := res.Body()
code := utils.Json.Get(body, "code").ToInt()
if code != 0 {
if !isRetry && code == 401 {
err := d.login()
if err != nil {
return nil, err
}
isRetry = true
goto do
}
return nil, errors.New(jsoniter.Get(body, "message").ToString())
}
return body, nil
}
func (d *Pan123) unlockSafeBox(fileId int64) error {
if _, ok := d.safeBoxUnlocked.Load(fileId); ok {
return nil
}
data := base.Json{"password": d.SafePassword}
url := fmt.Sprintf("%s?fileId=%d", SafeBoxUnlock, fileId)
_, err := d.Request(url, http.MethodPost, func(req *resty.Request) {
req.SetBody(data)
}, nil)
if err != nil {
return err
}
d.safeBoxUnlocked.Store(fileId, true)
return nilView on GitHub (pinned to 843d9dc814)
Solutions
- Set the site URL in the program settings (the value common.GetApiUrl reads) and retry.
- Prefer absolute URLs (scheme + host + path) inside .strm files so resolution never depends on server config.
- If generating .strm files programmatically, always write the fully qualified URL at generation time.
Example fix
# before (strm content) /d/local/video.mp4 # after (strm content) https://media.example.com/d/local/video.mp4
Defensive patterns
Strategy: validation
Validate before calling
if !strings.HasPrefix(link.URL, "http://") && !strings.HasPrefix(link.URL, "https://") {
if common.GetApiUrl(nil) == "" {
return nil, fmt.Errorf("strm file uses relative URL but site URL is not configured")
}
} Type guard
func isAbsoluteHTTPURL(u string) bool {
return strings.HasPrefix(u, "http://") || strings.HasPrefix(u, "https://")
} Try / catch
if _, err := readStrmLink(ctx, link); err != nil && strings.Contains(err.Error(), "relative url without site url") {
// set site URL config, then retry
} Prevention
- Configure the site URL setting at deployment time.
- Write absolute URLs into generated .strm files.
- Validate strm contents during import/sync jobs.
When it happens
Trigger: A .strm file containing a site-relative path like "/d/local/video.mp4" or "/proxy/file", combined with a server configuration where the site URL setting is unset (fresh install, config migration, or programmatic context where the setting is not loaded).
Common situations: Running the server headless/embedded without the site-URL config value; .strm files exported from another instance using relative paths; containerized deployments where the URL env/config was dropped.
Related errors
- missing cookie or qrcode account
- access_token expired: provide a refresh_token together with
- directory separator prohibited
- name token must come before chunk token
- pattern must contain one name token: {name}
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/e4cff4c9988e4b82.
Report an issue: GitHub.