floci-io/floci · error · AwsException

InvalidStructureException

InvalidStructureException

Error message

A pipeline must contain at least two stages

What it means

Error "A pipeline must contain at least two stages" thrown in floci-io/floci.

Source

Thrown at src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java:1086

    private List<CodePipelineStoredItem> items(String account, String region, String type) {
        return itemStore.scanForAccount(account, key -> key.startsWith(region + ":" + type + ":")).stream()
                .sorted(Comparator.comparing(CodePipelineStoredItem::getCreated,
                        Comparator.nullsLast(Comparator.reverseOrder())))
                .toList();
    }

    private String validatePipelineDeclaration(JsonNode declaration) {
        if (declaration == null || !declaration.isObject()) {
            throw new AwsException("ValidationException", "pipeline must be an object", 400);
        }
        String name = declaration.path("name").asText(null);
        validatePipelineName(name);
        if (!declaration.hasNonNull("roleArn")) {
            throw new AwsException("ValidationException", "pipeline.roleArn is required", 400);
        }
        if (!declaration.path("stages").isArray() || declaration.path("stages").size() < 2) {
            throw new AwsException("InvalidStructureException", "A pipeline must contain at least two stages", 400);
        }
        boolean hasArtifactStore = declaration.hasNonNull("artifactStore");
        boolean hasArtifactStores = declaration.hasNonNull("artifactStores");
        if (hasArtifactStore == hasArtifactStores) {
            throw new AwsException("ValidationException",
                    "pipeline must include exactly one of artifactStore or artifactStores", 400);
        }
        for (JsonNode stage : declaration.path("stages")) {
            if (!stage.hasNonNull("name") || !stage.path("actions").isArray()
                    || stage.path("actions").isEmpty()) {
                throw new AwsException("InvalidStageDeclarationException",
                        "Each stage must have a name and at least one action", 400);
            }
        }
        String mode = declaration.path("executionMode").asText(DEFAULT_EXECUTION_MODE);
        String type = declaration.path("pipelineType").asText(DEFAULT_PIPELINE_TYPE);
        if (!List.of("SUPERSEDED", "QUEUED", "PARALLEL").contains(mode)) {
            throw new AwsException("ValidationException", "Invalid executionMode: " + mode, 400);

View on GitHub (pinned to 62ff490619)

Solutions

  1. Add at least two stages to the pipeline definition.

When it happens

Trigger: Thrown at src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java:1086 when the library encounters an invalid state.

Common situations: Occurs when creating or updating a pipeline with fewer than two stages. Define at least a source stage and one additional stage.


AI-assisted analysis of floci-io/floci@62ff490619 (2026-08-14). Data as JSON: /api/errors/481dcb59a9468f30. Report an issue: GitHub.