{"record":{"id":"0446e616eefc3f06","repo":"phacility/phabricator","slug":"path-s-does-not-exist-or-is-not-a-directory","errorCode":null,"errorMessage":"Path \"%s\" does not exist, or is not a directory.","messagePattern":"Path \"(.+?)\" does not exist, or is not a directory\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php","lineNumber":40,"sourceCode":"            'help' => pht('Drop caches before extracting strings. Slow!'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\n    $paths = $args->getArg('paths');\n    if (!$paths) {\n      $paths = array(getcwd());\n    }\n\n    $targets = array();\n    foreach ($paths as $path) {\n      $root = Filesystem::resolvePath($path);\n\n      if (!Filesystem::pathExists($root) || !is_dir($root)) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Path \"%s\" does not exist, or is not a directory.',\n            $path));\n      }\n\n      $libraries = id(new FileFinder($path))\n        ->withPath('*/__phutil_library_init__.php')\n        ->find();\n      if (!$libraries) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Path \"%s\" contains no libphutil libraries.',\n            $path));\n      }\n\n      foreach ($libraries as $library) {\n        $targets[] = Filesystem::resolvePath(dirname($path.'/'.$library)).'/';\n      }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php#L22-L58","documentation":"A PhutilArgumentUsageException from the 'i18n extract' management command (bin/i18n extract). Each path argument (defaulting to the current working directory) is resolved with Filesystem::resolvePath(); if the result does not exist or is not a directory, the command refuses to run. This is a command-line argument validation error, not a runtime failure.","triggerScenarios":"Running bin/i18n extract from a deleted directory (cwd no longer exists so the default path fails); passing a file instead of a directory; passing a path with a typo.","commonSituations":"Running extraction scripts from a shell whose working directory was removed; CI jobs passing a checkout-relative path that is wrong when the script cd's elsewhere; copy-paste of a path from another machine.","solutions":["Verify the path exists with ls before running the command","Pass an absolute path to the intended library root, e.g. bin/i18n extract /srv/phabricator/src","If omitting the path, make sure your current working directory still exists and is the phabricator checkout"],"exampleFix":"# before\n$ bin/i18n extract releative/src\n\n# after\n$ bin/i18n extract /path/to/phabricator/src","handlingStrategy":"validation","validationCode":"// Before invoking the i18n extract workflow, verify each path.\nforeach ($paths as $path) {\n  $root = Filesystem::resolvePath($path);\n  if (!Filesystem::pathExists($root) || !is_dir($root)) {\n    fwrite(STDERR, \"Invalid path: {$path}\\n\");\n    exit(1);\n  }\n}","typeGuard":"function isExtractableDirectory($path) {\n  $root = Filesystem::resolvePath($path);\n  return Filesystem::pathExists($root) && is_dir($root);\n}","tryCatchPattern":"try { $workflow->execute($args); } catch (PhutilArgumentUsageException $ex) { fwrite(STDERR, $ex->getMessage().\"\\n\"); exit(1); } // usage errors are exit-early, never retry","preventionTips":["Pass absolute paths to bin/i18n extract in scripts and CI","Prefer omitting the path (defaults to cwd) only when the script cds into the checkout first"],"tags":["cli","filesystem","i18n","usage-error","phabricator"],"backgroundTag":"file-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}