{"record":{"id":"661febe7e583f263","repo":"phacility/phabricator","slug":"this-source-s-does-not-have-a-s-cursor-av","errorCode":null,"errorMessage":"This source (\"%s\") does not have a \"%s\" cursor. Available cursors: %s.","messagePattern":"This source \\(\"(.+?)\"\\) does not have a \"(.+?)\" cursor\\. Available cursors: (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/nuance/management/NuanceManagementImportWorkflow.php","lineNumber":51,"sourceCode":"    if (!$definition->hasImportCursors()) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'This source (\"%s\") does not expose import cursors.',\n          $source->getName()));\n    }\n\n    $cursors = $definition->getImportCursors();\n    if (!$cursors) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'This source (\"%s\") does not have any import cursors.',\n          $source->getName()));\n    }\n\n    $select = $args->getArg('cursor');\n    if (strlen($select)) {\n      if (empty($cursors[$select])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'This source (\"%s\") does not have a \"%s\" cursor. Available '.\n            'cursors: %s.',\n            $source->getName(),\n            $select,\n            implode(', ', array_keys($cursors))));\n      } else {\n        echo tsprintf(\n          \"%s\\n\",\n          pht(\n            'Importing cursor \"%s\" only.',\n            $select));\n        $cursors = array_select_keys($cursors, array($select));\n      }\n    } else {\n      echo tsprintf(\n        \"%s\\n\",\n        pht(","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/nuance/management/NuanceManagementImportWorkflow.php#L33-L69","documentation":"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.","triggerScenarios":"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'.","commonSituations":"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.","solutions":["Read the exception message — it lists the valid cursor names for this exact source; rerun with one of those.","Check case and whitespace: the lookup is an exact array-key match.","Run the import once without --cursor to exercise all cursors when you do not need to target one.","Pin scripts to cursor names you verified against the current definition version, since names are definition-controlled."],"exampleFix":"# before:\n# bin/nuance import --source 12 --cursor mentions\n# -> err: 'does not have a \"mentions\" cursor. Available cursors: twittermentions, dms'\n\n# after:\n# bin/nuance import --source 12 --cursor twittermentions","handlingStrategy":"validation","validationCode":"// Resolve the cursor name before invoking the CLI:\n$cursors = $definition->getImportCursors();\nif (!isset($cursors[$cursor_name])) {\n  $cursor_name = null; // import all cursors instead of failing\n  // or: fail with the valid keys: implode(', ', array_keys($cursors))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive cursor names from getImportCursors() keys at runtime; never hard-code them in scripts.","Cursor names are exact array keys: match case and avoid trailing whitespace.","When unsure, omit --cursor and import all cursors for the source."],"tags":["nuance","cli","import","cursor-selection","usage-error"],"backgroundTag":"unknown-option-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}