AlistGo/alist · error

Too many parts, please increase part size

Error message

Too many parts, please increase part size

What it means

Returned by Streamtape.callAPI when json.Unmarshal of resp.Result into the caller's typed out parameter fails. The HTTP call and envelope were fine, but the JSON inside "result" does not match the Go struct the driver expects (wrong field names/types) or is truncated/corrupted.

Source

Thrown at drivers/115/util.go:558

		} else {
			chunk.Size = fileSize / chunkN
		}
		chunks = append(chunks, chunk)
	}

	return chunks, nil
}

// SplitFileByPartSize splits big file into parts by the size of parts.
// Splits the file by the part size. Returns the FileChunk when error is nil.
func SplitFileByPartSize(fileSize int64, chunkSize int64) ([]oss.FileChunk, error) {
	if chunkSize <= 0 {
		return nil, errors.New("chunkSize invalid")
	}

	chunkN := fileSize / chunkSize
	if chunkN >= 10000 {
		return nil, errors.New("Too many parts, please increase part size")
	}

	var chunks []oss.FileChunk
	chunk := oss.FileChunk{}
	for i := int64(0); i < chunkN; i++ {
		chunk.Number = int(i + 1)
		chunk.Offset = i * chunkSize
		chunk.Size = chunkSize
		chunks = append(chunks, chunk)
	}

	if fileSize%chunkSize > 0 {
		chunk.Number = len(chunks) + 1
		chunk.Offset = int64(len(chunks)) * chunkSize
		chunk.Size = fileSize % chunkSize
		chunks = append(chunks, chunk)
	}

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Log resp.Result (raw JSON) alongside the unmarshal error to see which field mismatches, then update the corresponding struct tags/types in the driver.
  2. Retry once — truncated responses from CDN hiccups can be transient.
  3. Update to the latest driver version if Streamtape changed its schema; the fix is usually corrected struct definitions.
  4. If the mismatch is numeric, switch affected fields to json.Number or float64 and convert explicitly.

Example fix

// before
type fileInfoResult struct {
	Size int64 `json:"size"` // API now also returns "sizestr": "1.5GB"
}

// after
type fileInfoResult struct {
	Size    int64  `json:"size"`
	SizeStr string `json:"sizestr"`
}
Defensive patterns

Strategy: fallback

Type guard

func isStreamtapeDecodeErr(err error) bool {
	return err != nil && strings.Contains(err.Error(), "decode streamtape result failed")
}

Try / catch

err := d.callAPI(ctx, endpoint, query, &out)
if isStreamtapeDecodeErr(err) {
	// fall back to raw JSON handling; log raw resp.Result for schema triage
	var raw json.RawMessage
	_ = d.callAPI(ctx, endpoint, query, &raw)
}

Prevention

When it happens

Trigger: Streamtape changes the shape of a result payload (renames fields, changes a string to a number or an object to an array) so the static struct (e.g. fileInfoResult, remoteDlStatusResult) no longer matches; a proxy truncates the body; numeric precision (e.g. large file sizes as float64) overflows the declared type.

Common situations: After an upstream Streamtape API revision with no driver update; mixing driver versions against a newer API; HTML error page inside a 200 envelope after CDN interception.

Related errors


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