AlistGo/alist · error

wukong apply upload inner failed: %s

Error message

wukong apply upload inner failed: %s

What it means

Thrown by applyUploadInner when the VOD ApplyUploadInner action returns a response metadata error. ApplyUploadInner reserves the upload session (StoreURI, upload hosts, auth for TOS) using FileSize, FileType, ClientBestHosts and NeedFallback=true; an error here means no upload session was granted.

Source

Thrown at drivers/wukong/driver.go:452

		spaceName = videoSpaceName
	}
	q := map[string]string{
		"Action":          "ApplyUploadInner",
		"Version":         "2020-11-19",
		"SpaceName":       spaceName,
		"FileType":        uploadType,
		"IsInner":         "1",
		"ClientBestHosts": bestHosts,
		"NeedFallback":    "true",
		"FileSize":        strconv.FormatInt(fileSize, 10),
		"s":               randomString(8),
	}
	var resp applyUploadInnerResp
	if err := d.vodRequest(ctx, http.MethodGet, q, nil, auth, &resp); err != nil {
		return nil, err
	}
	if resp.ResponseMetadata.Error.Code != "" {
		return nil, fmt.Errorf("wukong apply upload inner failed: %s", resp.ResponseMetadata.Error.Message)
	}
	return &resp, nil
}

func (d *Wukong) commitUploadInner(ctx context.Context, auth *uploadAuthTokenResp, spaceName, sessionKey string) (string, error) {
	q := map[string]string{
		"Action":    "CommitUploadInner",
		"Version":   "2020-11-19",
		"SpaceName": spaceName,
	}
	body, _ := json.Marshal(map[string]any{
		"SessionKey": sessionKey,
		"Functions":  []any{},
	})
	var resp commitUploadInnerResp
	if err := d.vodRequest(ctx, http.MethodPost, q, body, auth, &resp); err != nil {
		return "", err
	}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Re-stat the local file and pass its current size, then retry with a fresh auth token
  2. Retry with backoff once — ApplyUploadInner errors are often transient (NeedFallback path already hints at upstream flakiness)
  3. Ensure uploadType maps correctly via uploadSourceByType and the space matches (video vs auth.SpaceName)
  4. Re-login and restart the whole Put flow if the token is expired
Defensive patterns

Strategy: retry

Try / catch

inner, err := d.applyUploadInner(ctx, auth, uploadType, size, hosts)
if err != nil {
    // transient VOD errors are common: one backoff retry with fresh token
    time.Sleep(2 * time.Second)
    auth, _ = d.getUploadAuthToken(ctx, uploadType)
    if auth != nil {
        inner, err = d.applyUploadInner(ctx, auth, uploadType, size, hosts)
    }
    if err != nil { return err }
}

Prevention

When it happens

Trigger: FileSize mismatch with the actual stream; upload type (video vs other) not allowed for the space; token from auth_token lacking scope for ApplyUploadInner; invalid ClientBestHosts after a failed candidates step; upstream capacity error.

Common situations: File grew between stat and upload (size passed via strconv from stale metadata); uploading a type the Wukong pan rejects; reusing a token across many parallel uploads until it expires mid-flow.

Related errors


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