phacility/phabricator · error · Exception

Header has unterminated double quote for key "%s".

Error message

Header has unterminated double quote for key "%s".

What it means

Thrown by the shared loader PhabricatorRepositoryManagementWorkflow::loadRepositories() when one of the identifiers passed on the command line cannot be resolved to a repository by PhutilRepositoryQuery. Identifiers may be monograms (R123), callsigns, or UUIDs; any identifier missing from the query's identifier map aborts the workflow with this message. It fires across all 'bin/repository ...' management subcommands that accept repository names.

Source

Thrown at src/aphront/headerparser/AphrontHTTPHeaderParser.php:128

            $ii++;
            break;
          }

          $pairs[] = array(
            $pair_name,
            $pair_value,
          );

          $pair_name = null;
          $pair_value = null;

          $state = 'prekey';
          break;
      }
    }

    if ($state == 'quoted') {
      throw new Exception(
        pht(
          'Header has unterminated double quote for key "%s".',
          $pair_name));
    }

    if ($pair_name !== null) {
      $pairs[] = array(
        $pair_name,
        $pair_value,
      );
    }

    return $pairs;
  }

  private function requireParse() {
    if ($this->name === null) {
      throw new PhutilInvalidStateException('parseRawHeader');

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. List valid identifiers first ('bin/repository list' or the Repositories UI) and copy the exact monogram.
  2. If the repository was deleted or renamed, update scripts/runbooks to the current identifier.
  3. Confirm you are pointed at the correct Phabricator instance/cluster host.

Example fix

# before
bin/repository update R321

# after (find the real monogram first)
bin/repository list | grep myproject
bin/repository update R123
Defensive patterns

Strategy: validation

Validate before calling

// Resolve identifiers before running the workflow:
$map = id(new PhabricatorRepositoryQuery())
  ->setViewer($viewer)
  ->needURIs(true)
  ->withIdentifiers($identifiers)
  ->executeAndGetIdentifierMap();
$unknown = array_diff($identifiers, array_keys($map));
if ($unknown) { /* fail with the unknown list before doing work */ }

Try / catch

catch (PhutilArgumentUsageException $ex) {
  if (preg_match('/does not exist/', $ex->getMessage())) { /* surface identifier typo */ }
}

Prevention

When it happens

Trigger: Running any management workflow with an unknown identifier, e.g. 'bin/repository update R999999' or a typo'd/deleted callsign: the identifier map from PhabricatorRepositoryQuery lacks the key, and the loop at PhabricatorRepositoryManagementWorkflow.php:22 throws.

Common situations: Typos in monikers or callsigns; repositories deleted or renamed after runbooks were written; scripts generating identifiers from stale exports; wrong Phabricator instance (dev vs prod) where the repository does not exist.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/5277d116cac56d8c. Report an issue: GitHub.