gildas-lormeau/SingleFile · error · Error

unknown_error (" + httpFinishResponse.status + ")

Error message

unknown_error (" + httpFinishResponse.status + ")

What it means

In Dropbox's chunked upload 'sendFile', after the final chunk the finish request must return 200 (or 409 conflict handled with the prompt action). Any other HTTP status results in 'unknown_error (<status>)' — the library does not map the status to a more specific message.

Source

Thrown at src/lib/dropbox/dropbox.js:328

				cursor: {
					session_id: mediaUploader.sessionId,
					offset: mediaUploader.offset
				},
				commit: {
					path,
					mode: mediaUploader.filenameConflictAction == CONFLICT_ACTION_OVERWRITE ? "overwrite" : "add",
					autorename: mediaUploader.filenameConflictAction == CONFLICT_ACTION_UNIQUIFY
				}
			})
		}
	});
	if (httpFinishResponse.status == 200) {
		return getJSON(httpFinishResponse);
	} else if (httpFinishResponse.status == 409 && mediaUploader.filenameConflictAction == CONFLICT_ACTION_PROMPT) {
		mediaUploader.offset = 0;
		return mediaUploader.upload();
	} else {
		throw new Error("unknown_error (" + httpFinishResponse.status + ")");
	}
}

async function getJSON(httpResponse) {
	httpResponse = getResponse(httpResponse);
	const response = await httpResponse.json();
	if (response.error) {
		throw new Error(response.error);
	} else {
		return response;
	}
}

function getResponse(httpResponse) {
	if (httpResponse.status == 200) {
		return httpResponse;
	} else if (httpResponse.status == 401) {
		throw new Error("invalid_token");

View on GitHub (pinned to 517fb7c5cf)

Solutions

  1. Check the status code in the message; handle 401 by re-authenticating (refresh token) and 429 by backing off and retrying.
  2. Retry the upload after a delay for transient 5xx/429 errors.
  3. Verify the Dropbox access token and app permissions are still valid.
  4. Check network/proxy interference and Dropbox service status.

Example fix

// before
await dropbox.sendFile(...); // throws unknown_error (429)
// after
try {
  await dropbox.sendFile(...);
} catch (e) {
  if (/unknown_error \((429|5\d\d)\)/.test(e.message)) {
    await delay(backoff);
    await dropbox.sendFile(...);
  } else throw e;
}
Defensive patterns

Strategy: retry

Try / catch

try {
  await dropbox.sendFile(...);
} catch (e) {
  const m = e.message.match(/unknown_error \((\d+)\)/);
  if (m && (m[1] === '429' || m[1].startsWith('5'))) {
    await new Promise(r => setTimeout(r, backoff));
    return dropbox.sendFile(...);
  }
  throw e;
}

Prevention

When it happens

Trigger: The Dropbox /upload/append_v2 finish call returns an unexpected status (e.g. 429 rate limit, 5xx server error, 401) that is neither 200 nor the handled 409-with-prompt case.

Common situations: Dropbox API outages or rate limiting during large uploads; expired/revoked access token surfacing as a non-401 status on the finish endpoint; proxy/corporate gateways returning error pages with odd statuses.

Related errors


AI-assisted analysis of gildas-lormeau/SingleFile@517fb7c5cf (2026-09-01). Data as JSON: /api/errors/888a7b2d9602a006. Report an issue: GitHub.