{"record":{"id":"7bec1053244c3fb0","repo":"symfony/translation","slug":"the-s-file-does-not-exist","errorCode":null,"errorMessage":"The \"%s\" file does not exist.","messagePattern":"The \"(.+?)\" file does not exist\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Extractor/AbstractFileExtractor.php","lineNumber":52,"sourceCode":"        } else {\n            $files = $this->extractFromDirectory($resource);\n        }\n\n        return $files;\n    }\n\n    private function toSplFileInfo(string $file): \\SplFileInfo\n    {\n        return new \\SplFileInfo($file);\n    }\n\n    /**\n     * @throws InvalidArgumentException\n     */\n    protected function isFile(string $file): bool\n    {\n        if (!is_file($file)) {\n            throw new InvalidArgumentException(\\sprintf('The \"%s\" file does not exist.', $file));\n        }\n\n        return true;\n    }\n\n    abstract protected function canBeExtracted(string $file): bool;\n\n    abstract protected function extractFromDirectory(string|array $resource): iterable;\n}\n","sourceCodeStart":34,"sourceCodeEnd":62,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Extractor/AbstractFileExtractor.php#L34-L62","documentation":"Thrown by AbstractFileExtractor::isFile when a path passed to the extractor is not an existing file (is_file() fails). Translation extractors (PHP, Twig) call canBeExtracted(), which calls isFile(), for every candidate path.","triggerScenarios":"Running `php bin/console translation:extract` (or calling extractors directly) with source paths that don't exist — wrong --dirs values, deleted directories, path typos, or directories containing symlinks to missing files.","commonSituations":"Typo in the extraction directory configuration (framework.translation.extractor_paths or command --dirs); renamed/moved source folders; broken symlinks; running extraction on a machine without the full code checkout.","solutions":["Verify every configured source path exists (`ls` each dir) and fix typos","Update extractor path configuration after moving/renaming source directories","Remove or repair broken symlinks inside the scanned directories","Run extraction from the project root so relative paths resolve correctly"],"exampleFix":"// before\nbin/console translation:extract --dirs=src/Contollers app\n// after\nbin/console translation:extract --dirs=src/Controllers app","handlingStrategy":"validation","validationCode":"foreach ($dirs as $dir) { if (!is_dir($dir)) { throw new \\InvalidArgumentException(\"Extraction path does not exist: {$dir}\"); } }","typeGuard":"function isExistingFilePath(string $file): bool { return is_file($file); }","tryCatchPattern":"try { $extractor->extract($directory, $catalogue); } catch (InvalidArgumentException $e) { if (str_contains($e->getMessage(), 'file does not exist')) { // fix configured path and retry } throw $e; }","preventionTips":["Validate all --dirs / extractor_paths entries exist before running extraction","Use absolute paths anchored to the project root (%kernel.project_dir%)","Clean up broken symlinks; exclude vendor/generated dirs from extraction scans"],"tags":["symfony","translation","extractor","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}