transloadit/uppy · error · Error
uploaded only ${bytesUploaded} of ${this.size} with status:
Error message
uploaded only ${bytesUploaded} of ${this.size} with status: ${response.statusCode} What it means
After Companion's multipart upload completes an HTTP PUT/POST via got, it compares the reported byte count with the expected size. If the connection closed after sending fewer bytes than the file size, it logs 'upload.multipart.mismatch.error' and throws this Error even though the server may have returned a success status.
Source
Thrown at packages/@uppy/companion/src/server/Uploader.ts:845
} else {
if (this.size != null) {
reqOptions.headers = {
...reqOptions.headers,
'content-length': `${this.size}`,
}
}
reqOptions.body = stream
}
try {
const httpMethod =
(this.options.httpMethod ?? '').toUpperCase() === 'PUT' ? 'put' : 'post'
const response = await got[httpMethod](url, reqOptions)
if (this.size != null && bytesUploaded !== this.size) {
const errMsg = `uploaded only ${bytesUploaded} of ${this.size} with status: ${response.statusCode}`
logger.error(errMsg, 'upload.multipart.mismatch.error')
throw new Error(errMsg)
}
let bodyURL = null
try {
bodyURL = JSON.parse(response.body)?.url
} catch {
// response.body can be undefined or an empty string
// in that case we ignore and continue.
}
return {
url: bodyURL,
extraData: { response: getRespObj(response), bytesUploaded },
}
} catch (err) {
logger.error(err, 'upload.multipart.error')
const errObj = isRecord(err) ? err : null
const response =View on GitHub (pinned to 5d4dedd02a)
Solutions
- Retry the upload — transient network truncation is the most common cause
- Verify the size metadata passed to Uploader matches the actual stream length (provider content-length vs streamed bytes)
- Check intermediary proxies/load balancers for idle timeouts or request size limits on the destination URL
Example fix
// before
const uppy = new Uploader({ size: guessedSize, ... })
// after
const uppy = new Uploader({ size: actualContentLengthFromProvider, ... })
// plus: wrap upload in retry logic for transient truncation Defensive patterns
Strategy: retry
Try / catch
try { await uploader.upload() } catch (err) {
if (/uploaded only \d+ of \d+/.test(err.message)) { await backoffRetry(uploader.upload, { retries: 3 }) }
else throw err
} Prevention
- Pass accurate size metadata (use provider content-length)
- Add retry with exponential backoff around companion uploads
- Check proxy timeouts on the receiving endpoint
When it happens
Trigger: A network interruption or early connection close mid-upload so bytesUploaded < this.size; size computed differently from actual streamed bytes (e.g. size metadata mismatch from the provider download); proxies cutting the stream.
Common situations: Flaky networks between Companion and the destination endpoint, wrong file size metadata when piping a provider download into the Uploader, or chunked transfer edge cases.
Related errors
- Unknown multipart upload error
- unsupported HTTP METHOD specified
- maxFileSize exceeded
- fieldname must be a string
- metadata must be an object
AI-assisted analysis of transloadit/uppy@5d4dedd02a (2026-08-28).
Data as JSON: /api/errors/2a381d7a964bf60c.
Report an issue: GitHub.