phacility/phabricator · warning · PhutilArgumentUsageException

Specify namespace to rename from with %s.

Error message

Specify namespace to rename from with %s.

What it means

Thrown by `bin/storage renamespace` when `--from` is missing or empty. The rename works by regex-replacing the namespace prefix (the from value) inside USE and CREATE DATABASE lines of a dump, so the source namespace is mandatory. This is a PhutilArgumentUsageException: the command aborts before any dump is read.

Source

Thrown at src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php:71

  protected function isReadOnlyWorkflow() {
    return true;
  }

  public function didExecute(PhutilArgumentParser $args) {
    $console = PhutilConsole::getConsole();

    $input = $args->getArg('input');
    $is_live = $args->getArg('live');
    if (!strlen($input) && !$is_live) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify the dumpfile to read with "--input", or use "--live" to '.
          'generate one automatically.'));
    }

    $from = $args->getArg('from');
    if (!strlen($from)) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify namespace to rename from with %s.',
          '--from'));
    }

    $to = $args->getArg('to');
    if (!strlen($to)) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify namespace to rename to with %s.',
          '--to'));
    }


    $output_file = $args->getArg('output');
    $is_overwrite = $args->getArg('overwrite');
    $is_compress = $args->getArg('compress');

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Add `--from <namespace>` naming the prefix currently used in the dump (for example --from phabricator).
  2. Verify the spelling against the dump itself: `grep 'USE ' dump.sql | head` shows the current database names.
  3. Check that the wrapper script actually sets and exports the FROM variable.

Example fix

# before
./bin/storage renamespace --input dump.sql --to devns

# after
./bin/storage renamespace --input dump.sql --from phabricator --to devns
Defensive patterns

Strategy: validation

Validate before calling

if [ -z "$FROM" ]; then
  echo 'error: FROM namespace is required (--from)' >&2
  exit 2
fi

Prevention

When it happens

Trigger: Invoking renamespace with `--to` (or neither namespace flag) but no `--from`, so strlen($from) == 0 at the check.

Common situations: Swapping --from/--to when adapting a prod-to-dev command; a wrapper script where the FROM variable is empty due to a typo or missing export; renaming to the same namespace and dropping one flag by mistake.

Related errors


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