AlistGo/alist · error

upload failed: %s

Error message

upload failed: %s

What it means

Error "upload failed: %s" thrown in AlistGo/alist.

Source

Thrown at drivers/bitqiu/driver.go:461

	if resp.Code != uploadSuccessCode {
		switch resp.Code {
		case successCode:
			var initData UploadInitData
			if err := json.Unmarshal(resp.Data, &initData); err != nil {
				return nil, fmt.Errorf("parse upload init response failed: %w", err)
			}
			serverCode, err := d.uploadFileInChunks(ctx, tmpFile, file.GetSize(), md5sum, initData, up)
			if err != nil {
				return nil, err
			}
			obj, err := d.completeChunkUpload(ctx, initData, parentID, parentPath, file.GetName(), file.GetSize(), md5sum, serverCode)
			if err != nil {
				return nil, err
			}
			up(100)
			return obj, nil
		default:
			return nil, fmt.Errorf("upload failed: %s", resp.Message)
		}
	}

	var resource Resource
	if err := json.Unmarshal(resp.Data, &resource); err != nil {
		return nil, fmt.Errorf("parse upload response failed: %w", err)
	}
	obj, err := resource.toObject(parentID, parentPath)
	if err != nil {
		return nil, err
	}
	up(100)
	return obj, nil
}

func (d *BitQiu) uploadFileInChunks(ctx context.Context, tmpFile model.File, size int64, md5sum string, initData UploadInitData, up driver.UpdateProgress) (string, error) {
	if d.client == nil {
		return "", fmt.Errorf("client not initialized")

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry.

When it happens

Trigger: Thrown at drivers/bitqiu/driver.go:461 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/493902465275678e. Report an issue: GitHub.