{"record":{"id":"d7a44a74db5bb1dc","repo":"floci-io/floci","slug":"invalidstagedeclarationexception","errorCode":"InvalidStageDeclarationException","errorMessage":"Each stage must have a name and at least one action","messagePattern":"Each stage must have a name and at least one action","errorType":"exception","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java","lineNumber":1097,"sourceCode":"        }\n        String name = declaration.path(\"name\").asText(null);\n        validatePipelineName(name);\n        if (!declaration.hasNonNull(\"roleArn\")) {\n            throw new AwsException(\"ValidationException\", \"pipeline.roleArn is required\", 400);\n        }\n        if (!declaration.path(\"stages\").isArray() || declaration.path(\"stages\").size() < 2) {\n            throw new AwsException(\"InvalidStructureException\", \"A pipeline must contain at least two stages\", 400);\n        }\n        boolean hasArtifactStore = declaration.hasNonNull(\"artifactStore\");\n        boolean hasArtifactStores = declaration.hasNonNull(\"artifactStores\");\n        if (hasArtifactStore == hasArtifactStores) {\n            throw new AwsException(\"ValidationException\",\n                    \"pipeline must include exactly one of artifactStore or artifactStores\", 400);\n        }\n        for (JsonNode stage : declaration.path(\"stages\")) {\n            if (!stage.hasNonNull(\"name\") || !stage.path(\"actions\").isArray()\n                    || stage.path(\"actions\").isEmpty()) {\n                throw new AwsException(\"InvalidStageDeclarationException\",\n                        \"Each stage must have a name and at least one action\", 400);\n            }\n        }\n        String mode = declaration.path(\"executionMode\").asText(DEFAULT_EXECUTION_MODE);\n        String type = declaration.path(\"pipelineType\").asText(DEFAULT_PIPELINE_TYPE);\n        if (!List.of(\"SUPERSEDED\", \"QUEUED\", \"PARALLEL\").contains(mode)) {\n            throw new AwsException(\"ValidationException\", \"Invalid executionMode: \" + mode, 400);\n        }\n        if (!\"SUPERSEDED\".equals(mode) && !\"V2\".equals(type)) {\n            throw new AwsException(\"ValidationException\", mode + \" requires pipelineType V2\", 400);\n        }\n        return name;\n    }\n\n    private JsonNode normalizeDeclaration(JsonNode declaration, int version) {\n        ObjectNode copy = declaration.deepCopy();\n        if (!copy.hasNonNull(\"executionMode\")) {\n            copy.put(\"executionMode\", DEFAULT_EXECUTION_MODE);","sourceCodeStart":1079,"sourceCodeEnd":1115,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java#L1079-L1115","documentation":"Error \"Each stage must have a name and at least one action\" thrown in floci-io/floci.","triggerScenarios":"Thrown at src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java:1097 when the library encounters an invalid state.","commonSituations":"Occurs when a pipeline stage is missing a name or has no actions. Give every stage a name and at least one action.","solutions":["Give each stage a name and at least one action in the pipeline definition."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}