AlistGo/alist · error
empty link
Error message
empty link
What it means
Error "empty link" thrown in AlistGo/alist.
Source
Thrown at drivers/strm/util.go:246
return nil, err
}
return readLinkBytes(ctx, link)
}
func readLinkBytes(ctx context.Context, link *model.Link) ([]byte, error) {
if link.MFile != nil {
defer link.MFile.Close()
return io.ReadAll(link.MFile)
}
if link.RangeReadCloser != nil {
rc, err := link.RangeReadCloser.RangeRead(ctx, http_range.Range{Length: -1})
if err == nil && rc != nil {
defer rc.Close()
return io.ReadAll(rc)
}
}
if link.URL == "" {
return nil, fmt.Errorf("empty link")
}
url := link.URL
if !strings.HasPrefix(url, "http://") && !strings.HasPrefix(url, "https://") {
api := common.GetApiUrl(nil)
if api == "" {
return nil, fmt.Errorf("relative url without site url: %s", url)
}
url = strings.TrimSuffix(api, "/") + url
}
res, err := base.RestyClient.R().SetContext(ctx).SetDoNotParseResponse(true).Get(url)
if err != nil {
return nil, err
}
defer res.RawBody().Close()
if res.StatusCode() >= http.StatusBadRequest {
return nil, fmt.Errorf("read url failed: status=%d", res.StatusCode())
}
return io.ReadAll(res.RawBody())View on GitHub (pinned to 843d9dc814)
Solutions
- Ensure the referenced value is configured and non-empty, then retry the operation.
When it happens
Trigger: Thrown at drivers/strm/util.go:246 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/f3e7f58f362d2e59.
Report an issue: GitHub.