{"record":{"id":"33eb15e8ff1cb28e","repo":"kestra-io/kestra","slug":"invalid-flow-path","errorCode":null,"errorMessage":"Invalid flow path","messagePattern":"Invalid flow path","errorType":"validation","errorClass":"CommandLine.ParameterException","httpStatus":null,"severity":"error","filePath":"cli/src/main/java/io/kestra/cli/commands/servers/ExecutorCommand.java","lineNumber":99,"sourceCode":"        return ImmutableMap.of(\n            \"kestra.server-type\", ServerType.EXECUTOR\n        );\n    }\n\n    @Override\n    public Integer call() throws Exception {\n        this.ignoreExecutionService.get().setIgnoredExecutions(ignoreExecutions);\n        this.ignoreExecutionService.get().setIgnoredFlows(ignoreFlows);\n        this.ignoreExecutionService.get().setIgnoredNamespaces(ignoreNamespaces);\n        this.ignoreExecutionService.get().setIgnoredTenants(ignoreTenants);\n\n        super.call();\n\n        if (flowPath != null) {\n            try {\n                localFlowRepositoryLoader.get().load(tenantIdSelectorService.get().getTenantId(this.tenantId), this.flowPath);\n            } catch (IOException e) {\n                throw new CommandLine.ParameterException(this.spec.commandLine(), \"Invalid flow path\", e);\n            }\n        }\n\n        executorService.get().run();\n\n        // start the embedded SystemWorker (always present in EXECUTOR mode)\n        poolExecutor = executorsUtils.cachedThreadPool(\"embedded-services\");\n        log.info(\"Starting the embedded SystemWorker.\");\n        poolExecutor.execute(systemWorker.get()::start);\n\n        shutdownHook(true, () -> poolExecutor.shutdown());\n\n        Await.await().forever().until(() -> !this.applicationContext.isRunning());\n\n        return 0;\n    }\n}\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/kestra-io/kestra/blob/823fada9274c4f9c251ea0a516460a4f7d958032/cli/src/main/java/io/kestra/cli/commands/servers/ExecutorCommand.java#L81-L117","documentation":"Thrown by the 'kestra server executor' command when loading the --flow-path fails. localFlowRepositoryLoader.load(...) throws IOException (file not found, unreadable, invalid YAML/flow), which the command wraps in a picocli ParameterException with message 'Invalid flow path'. The original IOException is attached as the cause.","triggerScenarios":"User starts the executor with --flow-path <p>; localFlowRepositoryLoader.load(tenantId, p) throws IOException; the catch rethrows as CommandLine.ParameterException(spec, \"Invalid flow path\", e).","commonSituations":"Path does not exist, path is a directory the loader cannot traverse, file permissions deny read, YAML is malformed or references a missing namespace, or the path is relative to a different working directory.","solutions":["Pass an absolute path to the flow file/directory.","Verify the file exists and is readable by the Kestra user.","Validate the YAML (kestra flow validate) before starting the server.","Inspect the wrapped IOException cause in the stack trace for the precise failure."],"exampleFix":"# before\nkestra server executor --flow-path ./flows\n# after\nkestra server executor --flow-path /opt/kestra/flows/myflow.yaml","handlingStrategy":"try-catch","validationCode":"Path p = Path.of(flowPath);\nif (!Files.exists(p) || !Files.isReadable(p)) {\n  throw new IllegalArgumentException('Flow path does not exist or is not readable: ' + p);\n}","typeGuard":null,"tryCatchPattern":"try {\n  localFlowRepositoryLoader.get().load(tenantId, flowPath);\n} catch (IOException e) {\n  throw new CommandLine.ParameterException(this.spec.commandLine(), \"Invalid flow path\", e);\n}","preventionTips":["Use absolute paths for --flow-path.","Pre-validate flows with 'kestra flow validate'.","Ensure the Kestra user can read the file."],"tags":["cli","executor","flow-load","usage","io"],"backgroundTag":null,"analyzedSha":"823fada9274c4f9c251ea0a516460a4f7d958032","analyzedAt":"2026-08-14T06:15:17.947Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}