AlistGo/alist · error
wukong init multipart upload returns empty uploadid
Error message
wukong init multipart upload returns empty uploadid
What it means
Thrown when the TOS (ByteDance object storage) init-multipart-upload endpoint returns the success code (minUploadSubmitSuccess) but an empty Data.UploadID. The uploadID is required by every subsequent UploadPart and CompleteMultipartUpload call; without it the multipart session cannot proceed, so the driver aborts rather than sending parts against a nonexistent session.
Source
Thrown at drivers/wukong/driver.go:661
SetHeader("Authorization", auth).
SetQueryParams(map[string]string{
"uploadmode": "part",
"phase": "init",
}).
SetResult(&resp)
if storageUser != "" {
req.SetHeader("X-Storage-U", storageUser)
}
uploadURL := fmt.Sprintf("https://%s/upload/v1/%s", host, storeURI)
_, err := req.Post(uploadURL)
if err != nil {
return "", err
}
if resp.Code != minUploadSubmitSuccess {
return "", fmt.Errorf("wukong init multipart upload failed: code=%d message=%s", resp.Code, resp.Message)
}
if resp.Data.UploadID == "" {
return "", errors.New("wukong init multipart upload returns empty uploadid")
}
return resp.Data.UploadID, nil
}
func (d *Wukong) uploadMultipartPart(ctx context.Context, host, storeURI, auth, storageUser, uploadID string, partNumber int, data []byte, crc32Hex string) (string, error) {
var resp tosUploadResp
req := base.NewRestyClient().R().
SetContext(ctx).
SetHeader("Host", host).
SetHeader("Referer", webReferer).
SetHeader("Origin", "https://pan.wkbrowser.com").
SetHeader("Authorization", auth).
SetHeader("Content-Type", "application/octet-stream").
SetHeader("Content-Crc32", crc32Hex).
SetHeader("Content-Length", strconv.Itoa(len(data))).
SetQueryParams(map[string]string{
"uploadid": uploadID,
"part_number": strconv.Itoa(partNumber),View on GitHub (pinned to 843d9dc814)
Solutions
- Restart the upload from scratch (new apply + new StoreURI/Auth) — stale store credentials are the most common cause
- Retry after a delay if the backend is having a transient issue
- Update the wukong driver in case the TOS response schema changed
Defensive patterns
Strategy: retry
Try / catch
if err != nil && strings.Contains(err.Error(), "empty uploadid") {
// store credentials may be stale: restart apply + init, not just init
return d.Put(ctx, dstDir, file, up)
} Prevention
- Minimize delay between applyUploadInner and the actual multipart upload
- On any multipart failure, restart the entire upload flow for fresh StoreURI/Auth
- Update driver for TOS response schema changes
When it happens
Trigger: POST https://{host}/upload/v1/{storeURI} answers code==success yet UploadID is "" — backend session-provisioning glitch, an expired/rejected StoreURI/Auth from an older apply response, or a schema change moving the upload id to a different field.
Common situations: Long pause between applyUploadInner and the actual upload so the store credentials went stale; TOS regional hiccups; driver version drift with the storage API.
Related errors
- wukong upload candidates is empty
- wukong apply upload inner returns empty upload node
- wukong video upload missing vid in commit response
- invalid multipart parts
- wukong init multipart upload failed: code=%d message=%s
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/5331eb91bf5cf7cd.
Report an issue: GitHub.