floci-io/floci · warning · AwsException

PipelineVersionNotFoundException

PipelineVersionNotFoundException

Error message

Pipeline version not found: ${version}

What it means

Thrown by getPipelineResponse (CodePipelineService.java:205) when GetPipeline passes a version number different from the pipeline's current version. The emulator stores only the latest declaration (version is compared against pipeline.getVersion() with strict inequality), so any historical or future version number is rejected. Omitting version defaults to the current version and never throws.

Source

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

        JsonNode declaration = request.get("pipeline");
        String name = validatePipelineDeclaration(declaration);
        CodePipelinePipeline pipeline = requirePipeline(account, region, name);
        int version = pipeline.getVersion() == null ? 1 : pipeline.getVersion() + 1;
        pipeline.setVersion(version);
        pipeline.setUpdated(now());
        pipeline.setDeclaration(normalizeDeclaration(declaration, version));
        initializeTransitions(pipeline);
        putPipeline(pipeline);
        ObjectNode response = mapper.createObjectNode();
        response.set("pipeline", pipeline.getDeclaration());
        return response;
    }

    private ObjectNode getPipelineResponse(JsonNode request, String region, String account) {
        CodePipelinePipeline pipeline = requirePipeline(account, region, text(request, "name"));
        int version = request.path("version").asInt(pipeline.getVersion());
        if (version != pipeline.getVersion()) {
            throw new AwsException("PipelineVersionNotFoundException",
                    "Pipeline version not found: " + version, 400);
        }
        ObjectNode response = mapper.createObjectNode();
        response.set("pipeline", pipeline.getDeclaration());
        ObjectNode metadata = response.putObject("metadata");
        metadata.put("pipelineArn", pipeline.getArn());
        metadata.put("created", pipeline.getCreated());
        metadata.put("updated", pipeline.getUpdated());
        return response;
    }

    private ObjectNode deletePipeline(JsonNode request, String region, String account) {
        String name = text(request, "name");
        validatePipelineName(name);
        pipelineStore.deleteForAccount(account, pipelineKey(region, name));
        for (String key : executionStore.keysForAccount(account)) {
            if (key.startsWith(region + ":" + name + ":")) {
                executionStore.deleteForAccount(account, key);

View on GitHub (pinned to 62ff490619)

Solutions

  1. Omit the version parameter — it defaults to the current version.
  2. If you need the current number, read it from ListPipelines/metadata (version field of the declaration) and pass that.
  3. For history/audit needs, keep external snapshots since the emulator retains only the latest version.

Example fix

// before
client.get_pipeline(name='my-pipeline', version=1)  # after one update -> current=2

// after
client.get_pipeline(name='my-pipeline')  # returns current version
Defensive patterns

Strategy: validation

Validate before calling

# the emulator keeps only the current version; omit 'version' entirely
client.get_pipeline(name='my-pipeline')

Try / catch

try:
    client.get_pipeline(name='p', version=v)
except ClientError as e:
    if e.response['Error']['Code'] == 'PipelineVersionNotFoundException':
        return client.get_pipeline(name='p')  # fall back to current
    raise

Prevention

When it happens

Trigger: GetPipeline(name=X, version=N) where N != the current pipeline.version (which increments on each UpdatePipeline). Asking for version 1 after one update (current=2) is the classic case.

Common situations: Audit tooling that walks historical versions against real AWS; assuming old versions are retained (they are in AWS, they are not here); hardcoding version=1 in scripts.

Related errors


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