{"record":{"id":"f810f23b4003b37e","repo":"kestra-io/kestra","slug":"failed-to-create-output-directory","errorCode":null,"errorMessage":"Failed to create output directory: {}","messagePattern":"Failed to create output directory: (.+?)","errorType":"console","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"cli/src/main/java/io/kestra/cli/schema/ConfigurationSchemaCommand.java","lineNumber":45,"sourceCode":"\n        PluginRegistry registry = pluginRegistry;\n        if (registry == null && pluginsPath != null) {\n            registry = DefaultPluginRegistry.getOrCreate();\n            registry.registerIfAbsent(pluginsPath);\n        }\n\n        if (registry == null) {\n            log.warn(\"No plugins loaded (no --plugins path provided). Storage plugin schemas will be skipped.\");\n        }\n\n        var generator = new ConfigurationSchemaGenerator();\n        var schema = generator.generate(registry);\n\n        if (\n            output.getParentFile() != null && !output.getParentFile().mkdirs()\n                && !output.getParentFile().isDirectory()\n        ) {\n            throw new IOException(\"Failed to create output directory: \" + output.getParentFile());\n        }\n        ConfigurationSchemaGenerator.write(schema, output);\n\n        stdOut(\"Configuration schema written to {0}\", output.getAbsolutePath());\n        return 0;\n    }\n\n    @Override\n    protected boolean isPluginManagerEnabled() {\n        return false;\n    }\n}\n","sourceCodeStart":27,"sourceCodeEnd":58,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/cli/src/main/java/io/kestra/cli/schema/ConfigurationSchemaCommand.java#L27-L58","documentation":"Thrown by 'kestra config schema' when the output directory for the generated schema cannot be created. If output.getParentFile() is non-null, mkdirs() returns false, AND isDirectory() is false, the command throws IOException 'Failed to create output directory: <parent>'. This is a filesystem/permission failure, not a schema-generation failure.","triggerScenarios":"ConfigurationSchemaCommand resolves output file; output.getParentFile() != null, mkdirs() returns false (or true but a non-dir file exists with that name), isDirectory() returns false; IOException is thrown naming the parent path.","commonSituations":"Parent path is read-only, a regular file occupies the parent name, the disk is full, the Kestra process lacks write permission on the target location, or the path is invalid for the OS.","solutions":["Choose an output path whose parent directory exists and is writable.","Pre-create the parent directory manually and pass the file inside it.","Run the Kestra CLI with a user that has write access to the target path.","Avoid pointing --output at a path whose parent collides with an existing file."],"exampleFix":"# before (parent not writable)\nkestra config schema --output /readonly/dir/schema.json\n# after\nmkdir -p /opt/kestra/out && kestra config schema --output /opt/kestra/out/schema.json","handlingStrategy":"validation","validationCode":"File parent = output.getParentFile();\nif (parent != null && !parent.exists() && !parent.mkdirs()) {\n  throw new IOException('Cannot create output directory: ' + parent);\n}","typeGuard":null,"tryCatchPattern":"try {\n  ConfigurationSchemaGenerator.write(schema, output);\n} catch (IOException e) {\n  throw new CommandLine.ExecutionException(spec.commandLine(), 'Failed to write schema: ' + e.getMessage(), e);\n}","preventionTips":["Pre-create the output directory before running the command.","Run the CLI as a user with write access to the target path.","Avoid parent paths colliding with existing files."],"tags":["cli","schema","config","io","filesystem"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}