{"record":{"id":"de13603262657ddd","repo":"symfony/translation","slug":"file-or-directory-s-is-not-readable","errorCode":null,"errorMessage":"File or directory \"%s\" is not readable.","messagePattern":"File or directory \"(.+?)\" is not readable\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Command/XliffLintCommand.php","lineNumber":103,"sourceCode":"    protected function execute(InputInterface $input, OutputInterface $output): int\n    {\n        $io = new SymfonyStyle($input, $output);\n        $filenames = (array) $input->getArgument('filename');\n        $this->format = $input->getOption('format') ?? (GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt');\n        $this->displayCorrectFiles = $output->isVerbose();\n\n        if (['-'] === $filenames) {\n            return $this->display($io, [$this->validate(file_get_contents('php://stdin'))]);\n        }\n\n        if (!$filenames) {\n            throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');\n        }\n\n        $filesInfo = [];\n        foreach ($filenames as $filename) {\n            if (!$this->isReadable($filename)) {\n                throw new RuntimeException(\\sprintf('File or directory \"%s\" is not readable.', $filename));\n            }\n\n            foreach ($this->getFiles($filename) as $file) {\n                $filesInfo[] = $this->validate(file_get_contents($file), $file);\n            }\n        }\n\n        return $this->display($io, $filesInfo);\n    }\n\n    private function validate(string $content, ?string $file = null): array\n    {\n        $errors = [];\n\n        // Avoid: Warning DOMDocument::loadXML(): Empty string supplied as input\n        if ('' === trim($content)) {\n            return ['file' => $file, 'valid' => true];\n        }","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Command/XliffLintCommand.php#L85-L121","documentation":"Readability guard in XliffLintCommand::execute(): one of the paths given as the 'filename' argument exists but cannot be read by the current user (or does not exist / is not a regular readable file), so the linter cannot open the XLIFF input and raises a RuntimeException instead of silently skipping it.","triggerScenarios":"Thrown at Command/XliffLintCommand.php:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix filesystem permissions (chmod/chown) so the user running the command can read the file or directory.","Verify the path is correct relative to the working directory of the process.","Exclude unreadable files from the argument list, or run the command as a user with read access."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}