AlistGo/alist · error

wukong upload candidates is empty

Error message

wukong upload candidates is empty

What it means

Thrown during Wukong upload when the candidate-host discovery step succeeds (getUploadAuthToken and getUploadCandidates returned no transport error) but collectCandidateHosts() yields zero usable hosts. The upload flow needs at least one host to pass into applyUploadInner's "best_hosts" parameter; with none, there is no endpoint to apply an upload against.

Source

Thrown at drivers/wukong/driver.go:341

	ext := strings.TrimPrefix(strings.ToLower(filepath.Ext(file.GetName())), ".")
	fileType := detectWukongFileType(file.GetMimetype(), file.GetName())
	size := file.GetSize()
	up(5)

	uploadType := detectUploadType(file.GetMimetype(), file.GetName())
	authToken, err := d.getUploadAuthToken(ctx, uploadType)
	if err != nil {
		return err
	}
	up(10)

	candidates, err := d.getUploadCandidates(ctx, authToken)
	if err != nil {
		return err
	}
	bestHosts := collectCandidateHosts(candidates)
	if len(bestHosts) == 0 {
		return errors.New("wukong upload candidates is empty")
	}
	up(20)

	applyResp, err := d.applyUploadInner(ctx, authToken, uploadType, size, strings.Join(bestHosts, ","))
	if err != nil {
		return err
	}
	if len(applyResp.Result.InnerUploadAddress.UploadNodes) == 0 ||
		len(applyResp.Result.InnerUploadAddress.UploadNodes[0].StoreInfos) == 0 {
		return errors.New("wukong apply upload inner returns empty upload node")
	}
	node := applyResp.Result.InnerUploadAddress.UploadNodes[0]
	store := node.StoreInfos[0]
	up(30)

	if size > multipartChunkSize {
		if err = d.uploadToTOSMultipart(ctx, node.UploadHost, store.StoreURI, store.Auth, getStorageUserID(store.StorageHeader), tempFile, size, up); err != nil {
			return err

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Retry the upload after a short delay — transient empty candidate lists do occur
  2. Update the wukong driver to the latest version; host-list parsing in collectCandidateHosts may have been fixed for a changed API shape
  3. Inspect the raw candidates response (enable debug logging) to confirm whether the API returned zero hosts or the filter dropped them all
  4. If the region is blocked, upload via a different network or a different storage driver
Defensive patterns

Strategy: retry

Try / catch

if err != nil && strings.Contains(err.Error(), "upload candidates is empty") {
    time.Sleep(5 * time.Second)
    err = d.Put(ctx, dstDir, file, up)
    // give up after 2-3 attempts; empty candidates is usually server-side
}

Prevention

When it happens

Trigger: The wkbrowser/pan.wkbrowser.com candidates endpoint returns an empty, malformed, or all-filtered-out host list — e.g. regional restrictions, server-side experiment flags, or an API version change that renamed the host fields so every candidate fails the host-collection filter.

Common situations: Uploading from an IP region the service doesn't provision upload hosts for; the provider changed its upload-broker response schema (driver drift after an app update); intermittent empty responses under load.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/e2541d89c97f6cbc. Report an issue: GitHub.