{"record":{"id":"4ac6aa83aa417808","repo":"quarkusio/quarkus","slug":"unable-to-locate-quarkus-model","errorCode":null,"errorMessage":"Unable to locate quarkus model","messagePattern":"Unable to locate quarkus model","errorType":"exception","errorClass":"AppModelResolverException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/util/BootstrapUtils.java","lineNumber":111,"sourceCode":"        return serializedModel;\n    }\n\n    /**\n     * @deprecated for removal since 3.31.0 in favor of ApplicationModelSerializer methods\n     */\n    @Deprecated(forRemoval = true)\n    public static ApplicationModel deserializeQuarkusModel(Path modelPath) throws AppModelResolverException {\n        if (Files.exists(modelPath)) {\n            try (InputStream existing = Files.newInputStream(modelPath);\n                    ObjectInputStream object = new ObjectInputStream(existing)) {\n                ApplicationModel model = (ApplicationModel) object.readObject();\n                IoUtils.recursiveDelete(modelPath);\n                return model;\n            } catch (IOException | ClassNotFoundException e) {\n                throw new AppModelResolverException(\"Failed to deserialize quarkus model\", e);\n            }\n        }\n        throw new AppModelResolverException(\"Unable to locate quarkus model\");\n    }\n\n    /**\n     * Returns a location where a serialized {@link ApplicationModel} would be found for dev mode.\n     *\n     * @param projectBuildDir project build directory\n     * @return file of a serialized application model for dev mode\n     */\n    public static Path resolveSerializedAppModelPath(Path projectBuildDir) {\n        return getBootstrapBuildDir(projectBuildDir).resolve(\"dev-app-model.dat\");\n    }\n\n    /**\n     * Returns a location where a serialized {@link ApplicationModel} would be found for test mode.\n     *\n     * @param projectBuildDir project build directory\n     * @return file of a serialized application model for test mode\n     */","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/util/BootstrapUtils.java#L93-L129","documentation":"deserializeQuarkusModel() expects a serialized ApplicationModel file at the given modelPath; if the file does not exist at all, it throws AppModelResolverException with this message. This is a missing-cache condition: nothing was serialized (or the file was removed) before deserialization was attempted.","triggerScenarios":"Calling deserializeQuarkusModel() with a modelPath that was never written, after the serialized model file was deleted, or pointing at the wrong build directory path.","commonSituations":"Race between two dev-mode processes where one deletes the file; custom tooling computing the model location differently than getSerializedModelLocation(); first run before any successful serialization.","solutions":["Ensure the application model was serialized first (complete the bootstrap/serialization phase before deserializing)","Check that the path comes from BootstrapUtils.getSerializedModelLocation() or equivalent canonical location and points to the same build dir","Re-run the build/dev mode so the model file is regenerated"],"exampleFix":"// before\nPath modelPath = Path.of(projectBuildDir, \"my-model.dat\");\nApplicationModel m = BootstrapUtils.deserializeQuarkusModel(modelPath);\n// after\nPath modelPath = BootstrapUtils.getSerializedModelLocation(projectBuildDir);\nif (Files.exists(modelPath)) {\n    ApplicationModel m = BootstrapUtils.deserializeQuarkusModel(modelPath);\n}","handlingStrategy":"try-catch","validationCode":"Path modelPath = BootstrapUtils.getSerializedModelLocation(projectBuildDir);\nif (!Files.exists(modelPath)) {\n    // resolve fresh instead of deserializing\n    return resolver.resolveModel(workspace);\n}","typeGuard":null,"tryCatchPattern":"try {\n    model = BootstrapUtils.deserializeQuarkusModel(modelPath);\n} catch (AppModelResolverException e) {\n    if (e.getMessage().contains(\"Unable to locate\")) {\n        model = resolver.resolveModel(workspace);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always serialize the model before attempting to deserialize it","Derive the path from the canonical location helper rather than constructing it manually","Serialize to a temp file and atomically move it into place to avoid races"],"tags":["cache","missing-file","dev-mode"],"backgroundTag":"cache-miss","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"}