{"record":{"id":"1f501c861e684175","repo":"quarkusio/quarkus","slug":"error-reading-file-p","errorCode":null,"errorMessage":"Error reading file: ${p}","messagePattern":"Error reading file: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdatesRepository.java","lineNumber":206,"sourceCode":"                path -> findRecipeDirectories(path, recipeDirectoryNames)\n                        .flatMap(d -> {\n                            log.info(\"* matching recipes directory '%s' found:\", d.relativeDir);\n                            Set<VersionUpdate> versions = d.versions();\n                            try (Stream<Path> recipePath = Files.list(path.resolve(d.relativeDir()))) {\n                                final List<String> recipes = recipePath\n                                        .filter(QuarkusUpdatesRepository::isRecipeFile)\n                                        .filter(p -> shouldApplyRecipe(p.getFileName().toString(),\n                                                versions))\n                                        .sorted(RecipeVersionComparator.INSTANCE)\n                                        .map(p -> {\n                                            try {\n                                                log.info(\"    - '%s' (%s)\",\n                                                        p.getFileName().toString(),\n                                                        versions.stream().map(v -> v.from() + \" -> \" + v.to())\n                                                                .collect(Collectors.joining(\", \")));\n                                                return new String(Files.readAllBytes(p));\n                                            } catch (IOException e) {\n                                                throw new RuntimeException(\"Error reading file: \" + p,\n                                                        e);\n                                            }\n                                        }).toList();\n                                if (recipes.isEmpty()) {\n                                    log.info(\"\\t\\t- no matching recipes.\");\n                                }\n                                return recipes.stream();\n                            } catch (IOException e) {\n                                throw new RuntimeException(\"Error listing files in directory: \" + d.relativeDir(), e);\n                            }\n                        }).toList());\n    }\n\n    record RecipeDirectory(String relativeDir, Set<VersionUpdate> versions) {\n    }\n\n    record VersionUpdate(String from, String to) {\n    }","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdatesRepository.java#L188-L224","documentation":"In fetchUpdateRecipes(), each matched recipe file's bytes are read with Files.readAllBytes(p); if that read throws IOException it is wrapped in RuntimeException(\"Error reading file: <path>\"). This is a plain filesystem read failure of an already-identified recipe YAML file.","triggerScenarios":"fetchUpdateRecipes (called by newRecipes during `quarkus update`) walks recipe directories, finds a matching recipe file via isRecipeFile, and Files.readAllBytes fails — file deleted between discovery and read, permission denied, or a broken symlink.","commonSituations":"Permission-restricted recipe files copied from another machine/user; files removed or renamed concurrently by another process; filesystem errors on network-mounted directories; case-sensitivity mismatches leaving dangling symlinks.","solutions":["Check and fix read permissions (chmod/chown) on the recipe YAML files and their directories.","Verify the file still exists and is a regular readable file (no dangling symlink).","Re-extract or re-download the update recipes artifact if files are missing or truncated.","Check filesystem health (disk errors, stale NFS mounts) if the recipes live on shared storage."],"exampleFix":"// shell: fix unreadable recipe files\nchmod -R u+r ~/.quarkus/update-recipes/\n// then rerun\nquarkus update --update-versions=3.15","handlingStrategy":"validation","validationCode":"if (!Files.isRegularFile(p) || !Files.isReadable(p)) {\n    throw new IOException(\"Recipe file missing or unreadable before update: \" + p);\n}","typeGuard":null,"tryCatchPattern":"try {\n    recipes = repo.fetchUpdateRecipes(...);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Error reading file\")) {\n        log.error(\"Fix permissions/re-extract recipes: \" + e.getMessage(), e);\n    }\n}","preventionTips":["Ensure recipe files carry read permissions for the running user.","Do not delete or rename recipe files while an update is running.","Re-extract the recipes artifact if the cache looks incomplete.","Avoid keeping the recipes cache on unreliable network mounts."],"tags":["io","filesystem","update-recipes"],"backgroundTag":"file-read-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}