AlistGo/alist · error
empty download url
Error message
empty download url
What it means
GuangYaPan's link resolver called /nd.bizuserres.s/v1/get_res_download_url successfully (no HTTP/API error) but both candidate URL fields — Data.SignedURL and Data.DownloadURL — were empty after trimming. Without a URL the driver cannot construct a model.Link, so it fails fast instead of returning a useless link.
Source
Thrown at drivers/guangyapan/driver.go:236
return nil, errs.NotFile
}
if err := d.ensureAccessToken(ctx); err != nil {
return nil, err
}
var resp downloadResp
if err := d.postAPI(ctx, "/nd.bizuserres.s/v1/get_res_download_url", map[string]any{
"fileId": file.GetID(),
}, &resp); err != nil {
return nil, err
}
url := strings.TrimSpace(resp.Data.SignedURL)
if url == "" {
url = strings.TrimSpace(resp.Data.DownloadURL)
}
if url == "" {
return nil, errors.New("empty download url")
}
return &model.Link{URL: url}, nil
}
func (d *GuangYaPan) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
if err := d.ensureAccessToken(ctx); err != nil {
return err
}
name := strings.TrimSpace(dirName)
if name == "" {
return errors.New("dir name is empty")
}
parentID := parentDir.GetID()
var out createDirResp
if err := d.postAPI(ctx, "/nd.bizuserres.s/v1/file/create_dir", map[string]any{View on GitHub (pinned to 843d9dc814)
Solutions
- Re-list the directory to refresh the file metadata and retry the download
- Verify the file still exists and plays/downloads in the provider's official app/website
- Retry after a short wait if the file was just uploaded (processing delay)
- If persistent, the file ID may be invalid — re-upload or report to the provider
Defensive patterns
Strategy: retry
Validate before calling
// Re-resolve metadata before downloading
obj, err := d.get(ctx, path)
if err != nil { return err }
if strings.TrimSpace(obj.GetID()) == "" { return errs.ObjectNotFound }
return d.Link(ctx, obj, args) Try / catch
link, err := d.Link(ctx, file, args)
if err != nil {
if strings.Contains(err.Error(), "empty download url") {
time.Sleep(2 * time.Second) // file may still be processing
fresh, _ := d.get(ctx, file.GetPath())
if fresh != nil { return d.Link(ctx, fresh, args) }
}
return err
} Prevention
- Avoid downloading files immediately after upload; let the provider finish processing
- Re-list directories before downloads if entries are cached
- Fail visibly rather than retrying forever — persistent empty URLs mean the resource is gone
When it happens
Trigger: Calling the download/link path for a file whose ID the API accepts but for which it returns an empty payload: files still processing, deleted server-side, region-restricted resources, or transient backend hiccups.
Common situations: Downloading immediately after upload before the provider finishes processing; file removed in the provider's own app but listing is cached; provider-side incident returning 200 with empty data.
Related errors
- login failed: provide a valid access_token, or refresh_token
- dir name is empty
- file id is empty
- new name is empty
- file is nil
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/d1dbb64180dd5ff5.
Report an issue: GitHub.