{"record":{"id":"5435f3c7230ece91","repo":"floci-io/floci","slug":"pipelineversionnotfoundexception","errorCode":"PipelineVersionNotFoundException","errorMessage":"Pipeline version not found: ${version}","messagePattern":"Pipeline version not found: (.+?)","errorType":"exception","errorClass":"AwsException","httpStatus":400,"severity":"warning","filePath":"src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java","lineNumber":205,"sourceCode":"        JsonNode declaration = request.get(\"pipeline\");\n        String name = validatePipelineDeclaration(declaration);\n        CodePipelinePipeline pipeline = requirePipeline(account, region, name);\n        int version = pipeline.getVersion() == null ? 1 : pipeline.getVersion() + 1;\n        pipeline.setVersion(version);\n        pipeline.setUpdated(now());\n        pipeline.setDeclaration(normalizeDeclaration(declaration, version));\n        initializeTransitions(pipeline);\n        putPipeline(pipeline);\n        ObjectNode response = mapper.createObjectNode();\n        response.set(\"pipeline\", pipeline.getDeclaration());\n        return response;\n    }\n\n    private ObjectNode getPipelineResponse(JsonNode request, String region, String account) {\n        CodePipelinePipeline pipeline = requirePipeline(account, region, text(request, \"name\"));\n        int version = request.path(\"version\").asInt(pipeline.getVersion());\n        if (version != pipeline.getVersion()) {\n            throw new AwsException(\"PipelineVersionNotFoundException\",\n                    \"Pipeline version not found: \" + version, 400);\n        }\n        ObjectNode response = mapper.createObjectNode();\n        response.set(\"pipeline\", pipeline.getDeclaration());\n        ObjectNode metadata = response.putObject(\"metadata\");\n        metadata.put(\"pipelineArn\", pipeline.getArn());\n        metadata.put(\"created\", pipeline.getCreated());\n        metadata.put(\"updated\", pipeline.getUpdated());\n        return response;\n    }\n\n    private ObjectNode deletePipeline(JsonNode request, String region, String account) {\n        String name = text(request, \"name\");\n        validatePipelineName(name);\n        pipelineStore.deleteForAccount(account, pipelineKey(region, name));\n        for (String key : executionStore.keysForAccount(account)) {\n            if (key.startsWith(region + \":\" + name + \":\")) {\n                executionStore.deleteForAccount(account, key);","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineService.java#L187-L223","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Omit the version parameter — it defaults to the current version.","If you need the current number, read it from ListPipelines/metadata (version field of the declaration) and pass that.","For history/audit needs, keep external snapshots since the emulator retains only the latest version."],"exampleFix":"// before\nclient.get_pipeline(name='my-pipeline', version=1)  # after one update -> current=2\n\n// after\nclient.get_pipeline(name='my-pipeline')  # returns current version","handlingStrategy":"validation","validationCode":"# the emulator keeps only the current version; omit 'version' entirely\nclient.get_pipeline(name='my-pipeline')","typeGuard":null,"tryCatchPattern":"try:\n    client.get_pipeline(name='p', version=v)\nexcept ClientError as e:\n    if e.response['Error']['Code'] == 'PipelineVersionNotFoundException':\n        return client.get_pipeline(name='p')  # fall back to current\n    raise","preventionTips":["Do not hardcode version numbers in GetPipeline calls.","For audit trails, snapshot pipeline definitions externally — historical versions are not retained."],"tags":["codepipeline","versioning","get-pipeline","emulator-parity"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}