{"record":{"id":"2d398dcdfc7f8d2c","repo":"phacility/phabricator","slug":"this-source-s-does-not-have-any-import-cursor","errorCode":null,"errorMessage":"This source (\"%s\") does not have any import cursors.","messagePattern":"This source \\(\"(.+?)\"\\) does not have any import cursors\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/nuance/management/NuanceManagementImportWorkflow.php","lineNumber":42,"sourceCode":"  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $source = $this->loadSource($args, 'source');\n\n    $definition = $source->getDefinition()\n      ->setViewer($this->getViewer())\n      ->setSource($source);\n\n    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\",","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/nuance/management/NuanceManagementImportWorkflow.php#L24-L60","documentation":"Second guard in the Nuance import workflow: the source's definition does expose cursors (hasImportCursors() true), but getImportCursors() returned an empty list, so there is nothing to import right now. Thrown as a PhutilArgumentUsageException with the source name; distinct from 933 in that the mechanism exists but yields zero cursor objects.","triggerScenarios":"Running 'bin/nuance import --source <name>' where the definition's getImportCursors() constructs and returns [] — for example a cursor factory that filters by configuration (enabled integrations) and everything is disabled, or a definition whose cursor list is built from a config key that is empty/unset.","commonSituations":"A new source type whose cursors are configuration-gated and the relevant integration is not configured; refactoring that moved cursor construction behind a check; a definition that returns cursors only when an external system is linked, before linking.","solutions":["Inspect the definition's getImportCursors() to learn why the list is empty — usually a missing integration config or a guard condition.","Complete the prerequisite setup (API keys, linked account, enabled integration) so the definition produces its cursor(s), then rerun.","If empty is legitimate for this type, skip invoking the import workflow for it in scripts.","Check you targeted the right source — an adjacent source of the same type may have the cursor configured."],"exampleFix":"// before: cursor list gated on configuration that is absent\npublic function getImportCursors() {\n  $cursors = array();\n  if ($this->getConfig('apikey')) { $cursors[] = new MyCursor(); }\n  return $cursors;  // no apikey set -> [] -> err: \"does not have any import cursors\"\n}\n\n// after: configure the source\n// bin/config edit source 12 -> set 'apikey', then rerun import","handlingStrategy":"validation","validationCode":"$cursors = $definition->getImportCursors();\nif (!$cursors) {\n  // definition yields zero cursors: finish its prerequisite configuration\n  // (API keys, linked accounts, enabled integrations) before importing\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Complete a source type's integration configuration before wiring it into import jobs.","In definitions, avoid config-gated cursor lists that can silently return empty; log when gates suppress cursors.","Smoke-test 'getImportCursors() is non-empty' when onboarding each new source."],"tags":["nuance","cli","import","empty-collection","usage-error"],"backgroundTag":"empty-cursor-list","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}