phacility/phabricator · error · Exception
Received "multipart/form-data" request with no "boundary".
Error message
Received "multipart/form-data" request with no "boundary".
What it means
Thrown by 'bin/repository unpublish' when the resolved repository set does not contain exactly one repository. Unpublish removes all feed stories and notifications a repository generated during import, so it deliberately acts on a single repository; passing zero, two, or more resolved repositories is rejected. Note that loadLocalRepositories() also filters to repositories hosted on the current device, so a valid name on the wrong device can resolve to zero and trigger this same error (with a locality rejection reason surfaced separately).
Source
Thrown at src/aphront/multipartparser/AphrontMultipartParser.php:48
if (!preg_match('(^multipart/form-data)', $content_type)) {
throw new Exception(
pht(
'Expected "multipart/form-data" content type when executing a '.
'multipart body read.'));
}
$type_parts = preg_split('(\s*;\s*)', $content_type);
$boundary = null;
foreach ($type_parts as $type_part) {
$matches = null;
if (preg_match('(^boundary=(.*))', $type_part, $matches)) {
$boundary = $matches[1];
break;
}
}
if ($boundary === null) {
throw new Exception(
pht('Received "multipart/form-data" request with no "boundary".'));
}
$this->parts = array();
$this->part = null;
$this->buffer = '';
$this->boundary = $boundary;
// We're looking for a (usually empty) body before the first boundary.
$this->state = 'bodynewline';
}
public function continueParse($bytes) {
$this->buffer .= $bytes;
$continue = true;
while ($continue) {View on GitHub (pinned to 5720a38cfe)
Solutions
- Pass exactly one repository identifier (monogram like R123, callsign, or UUID) to the command.
- If the name is correct but the count is still wrong, run the command on a device that actually hosts the repository (check Almanac bindings).
- Quote arguments in scripts to prevent shell globs expanding into multiple repositories.
Example fix
# before bin/repository unpublish R1 R2 # after bin/repository unpublish R1
Defensive patterns
Strategy: validation
Validate before calling
# Pass exactly one quoted identifier and verify it resolves locally: if [ "$(echo $REPOS | wc -w)" -ne 1 ]; then echo 'need exactly one repository' >&2; exit 2; fi bin/repository unpublish "$REPOS"
Prevention
- Quote the repository argument to defeat shell globbing.
- Run unpublish on a device that hosts the repository.
When it happens
Trigger: Running 'bin/repository unpublish' with no arguments, with multiple monikers ('bin/repository unpublish R1 R2'), or with one identifier that the device-locality filter removes because the repository is not served by this cluster device: count($repositories) !== 1 at PhabricatorRepositoryManagementUnpublishWorkflow.php:47 throws.
Common situations: Cleanups scripted against the wrong host (repository not local to this device); accidental glob expansion passing several repos; forgetting the repository argument entirely; typo'd monikers resolving to zero.
Related errors
- Request parameter "%s" is not formatted properly. Expected a
- Expected "multipart/form-data" parse to end in state "epilog
- Request parameter "%s" is not formatted properly. Expected a
- Invalid Request (CSRF)
- Expected "\r\n" or "--" after multipart data boundary.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/b970ce8d1644cc2a.
Report an issue: GitHub.