{"record":{"id":"17eaa3a753c48fd9","repo":"quarkusio/quarkus","slug":"failed-to-create-project-message","errorCode":null,"errorMessage":"Failed to create project: ${message}","messagePattern":"Failed to create project: (.+?)","errorType":"exception","errorClass":"QuarkusCommandException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java","lineNumber":281,"sourceCode":"                invocation.log().info(\"selected extensions: \\n\"\n                        + depInfo.getDependencies().stream()\n                                .map(e -> \"- \" + e.getGroupId() + \":\" + e.getArtifactId() + \"\\n\")\n                                .collect(Collectors.joining()));\n            }\n\n            final QuarkusCodestartCatalog catalog = QuarkusCodestartCatalog\n                    .fromExtensionsCatalog(invocation.getQuarkusProject().getExtensionsCatalog(),\n                            invocation.getQuarkusProject().getCodestartResourceLoaders());\n            final CodestartProjectDefinition projectDefinition = catalog.createProject(input);\n            projectDefinition.generate(invocation.getQuarkusProject().getProjectDirPath());\n            invocation.log()\n                    .info(\"\\n-----------\\n\" + MessageIcons.SUCCESS_ICON + \" \"\n                            + projectDefinition.getRequiredCodestart(CodestartType.PROJECT).getName()\n                            + \" project has been successfully generated in:\\n--> \"\n                            + invocation.getQuarkusProject().getProjectDirPath().toString() + \"\\n-----------\");\n\n        } catch (IOException e) {\n            throw new QuarkusCommandException(\"Failed to create project: \" + e.getMessage(), e);\n        }\n\n        return QuarkusCommandOutcome.success();\n    }\n\n    private static void setQuarkusProperties(QuarkusCommandInvocation invocation, ExtensionCatalog catalog) {\n        var quarkusProps = ToolsUtils.readQuarkusProperties(catalog);\n        quarkusProps.forEach((k, v) -> {\n            final String name = k.toString();\n            if (!invocation.hasValue(name)) {\n                invocation.setValue(name, v.toString());\n            }\n        });\n    }\n\n    private List<Extension> computeRequiredExtensions(ExtensionCatalog catalog,\n            final Set<String> extensionsQuery, MessageWriter log) throws QuarkusCommandException {\n        final List<Extension> extensionsToAdd = computeExtensionsFromQuery(catalog, extensionsQuery, log);","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java#L263-L299","documentation":"CreateProjectCommandHandler.execute wraps IOException from generating a standard project (codestart generation, file writes) into QuarkusCommandException('Failed to create project: ' + e.getMessage()).","triggerScenarios":"Running 'quarkus create project' when writing the generated project files throws IOException — unwritable target dir, existing conflicting files, or codestart resource load failure.","commonSituations":"Creating a project in a read-only or non-existent parent directory; rerunning into a directory that already contains a project; antivirus/file locks on Windows.","solutions":["Read the embedded message for the exact IO error","Choose a writable, non-existing (or empty) output directory","Verify parent directory exists or create it first","Check disk space and file locks, then rerun"],"exampleFix":"// before\nquarkus create app org.acme:demo  # run in read-only dir\n// after\ncd ~/projects && quarkus create app org.acme:demo","handlingStrategy":"validation","validationCode":"Path out = invocation.getQuarkusProject().getProjectDirPath();\nif (Files.exists(out)) throw new IllegalStateException(\"Project dir already exists: \" + out);\nif (!Files.isWritable(out.getParent())) throw new IllegalStateException(\"Parent not writable: \" + out.getParent());","typeGuard":"static boolean isSafeTarget(Path dir) {\n    return !Files.exists(dir) && Files.isWritable(dir.toAbsolutePath().getParent());\n}","tryCatchPattern":"try { handler.execute(invocation); } catch (QuarkusCommandException e) { log.error(\"Project creation failed: \" + e.getMessage(), e.getCause()); }","preventionTips":["Ensure the output directory does not already exist","Run from a writable working directory","Create parent dirs before invoking","Handle Windows file locks/AV scanning delays"],"tags":["io","scaffolding","project-generation"],"backgroundTag":"project-generation-io-error","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"}