phacility/phabricator · warning · PhutilArgumentUsageException

This source ("%s") does not have a "%s" cursor. Available cu

Error message

This source ("%s") does not have a "%s" cursor. Available cursors: %s.

What it means

Third guard in the Nuance import workflow: the --cursor flag selected a specific cursor by name, but that key is absent from the cursors map returned by getImportCursors() (keys are cursor names). The exception helpfully embeds the available cursor names, so the failure is self-describing — it is a plain name mismatch or typo.

Source

Thrown at src/applications/nuance/management/NuanceManagementImportWorkflow.php:51

    if (!$definition->hasImportCursors()) {
      throw new PhutilArgumentUsageException(
        pht(
          'This source ("%s") does not expose import cursors.',
          $source->getName()));
    }

    $cursors = $definition->getImportCursors();
    if (!$cursors) {
      throw new PhutilArgumentUsageException(
        pht(
          'This source ("%s") does not have any import cursors.',
          $source->getName()));
    }

    $select = $args->getArg('cursor');
    if (strlen($select)) {
      if (empty($cursors[$select])) {
        throw new PhutilArgumentUsageException(
          pht(
            'This source ("%s") does not have a "%s" cursor. Available '.
            'cursors: %s.',
            $source->getName(),
            $select,
            implode(', ', array_keys($cursors))));
      } else {
        echo tsprintf(
          "%s\n",
          pht(
            'Importing cursor "%s" only.',
            $select));
        $cursors = array_select_keys($cursors, array($select));
      }
    } else {
      echo tsprintf(
        "%s\n",
        pht(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Read the exception message — it lists the valid cursor names for this exact source; rerun with one of those.
  2. Check case and whitespace: the lookup is an exact array-key match.
  3. Run the import once without --cursor to exercise all cursors when you do not need to target one.
  4. Pin scripts to cursor names you verified against the current definition version, since names are definition-controlled.

Example fix

# before:
# bin/nuance import --source 12 --cursor mentions
# -> err: 'does not have a "mentions" cursor. Available cursors: twittermentions, dms'

# after:
# bin/nuance import --source 12 --cursor twittermentions
Defensive patterns

Strategy: validation

Validate before calling

// Resolve the cursor name before invoking the CLI:
$cursors = $definition->getImportCursors();
if (!isset($cursors[$cursor_name])) {
  $cursor_name = null; // import all cursors instead of failing
  // or: fail with the valid keys: implode(', ', array_keys($cursors))
}

Prevention

When it happens

Trigger: Running 'bin/nuance import --source S --cursor name' where $args->getArg('cursor') is a non-empty string and empty($cursors[$select]) is true: the typed name does not match any key of the cursor map (case-sensitive keys), e.g. --cursor twitter when the definition registers 'twittermentions'.

Common situations: Typos and case mismatches in scripts; cursor names changed between versions of a source definition; copy-pasting an example command from docs for a different source type; guessing cursor names instead of listing them.

Related errors


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