{"record":{"id":"b946dbd28335ed38","repo":"floci-io/floci","slug":"resourcenotfoundexception-b946db","errorCode":"ResourceNotFoundException","errorMessage":"Project not found:  \" + name","messagePattern":"Project not found:  \" \\+ name","errorType":"exception","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/codebuild/CodeBuildService.java","lineNumber":195,"sourceCode":"    }\n\n    public Project updateProject(String region, String name,\n                                 String description,\n                                 ProjectSource source, List<ProjectSource> secondarySources,\n                                 String sourceVersion,\n                                 ProjectArtifacts artifacts, List<ProjectArtifacts> secondaryArtifacts,\n                                 ProjectEnvironment environment,\n                                 String serviceRole,\n                                 Integer timeoutInMinutes, Integer queuedTimeoutInMinutes,\n                                 String encryptionKey,\n                                 List<Map<String, String>> tags,\n                                 Map<String, Object> logsConfig,\n                                 Map<String, Object> vpcConfig,\n                                 Integer concurrentBuildLimit) {\n        Map<String, Project> store = projectsFor(region);\n        Project project = store.get(name);\n        if (project == null) {\n            throw new AwsException(\"ResourceNotFoundException\", \"Project not found: \" + name, 400);\n        }\n\n        if (description != null) { project.setDescription(description); }\n        if (source != null) { project.setSource(source); }\n        if (secondarySources != null) { project.setSecondarySources(secondarySources); }\n        if (sourceVersion != null) { project.setSourceVersion(sourceVersion); }\n        if (artifacts != null) { project.setArtifacts(artifacts); }\n        if (secondaryArtifacts != null) { project.setSecondaryArtifacts(secondaryArtifacts); }\n        if (environment != null) { project.setEnvironment(environment); }\n        if (serviceRole != null) { project.setServiceRole(serviceRole); }\n        if (timeoutInMinutes != null) { project.setTimeoutInMinutes(timeoutInMinutes); }\n        if (queuedTimeoutInMinutes != null) { project.setQueuedTimeoutInMinutes(queuedTimeoutInMinutes); }\n        if (encryptionKey != null) { project.setEncryptionKey(encryptionKey); }\n        if (tags != null) { project.setTags(tags); }\n        if (logsConfig != null) { project.setLogsConfig(logsConfig); }\n        if (vpcConfig != null) { project.setVpcConfig(vpcConfig); }\n        if (concurrentBuildLimit != null) { project.setConcurrentBuildLimit(concurrentBuildLimit); }\n        project.setLastModified(Instant.now().toEpochMilli() / 1000.0);","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/codebuild/CodeBuildService.java#L177-L213","documentation":"Thrown by CodeBuildService.updateProject when no project with the given name exists in the region's store. UpdateProject only mutates fields that are non-null, but it requires the target to exist. Returned as ResourceNotFoundException 400.","triggerScenarios":"UpdateProject for a name never created or already deleted; wrong region (projects are partitioned per-region in Floci); name casing or whitespace mismatch between create and update calls.","commonSituations":"IaC pipelines running update before create on a fresh Floci instance; region misconfiguration between create and update steps (different AWS_REGION / endpoint config); test orderings that delete then update.","solutions":["Create the project first, or guard with a list-projects/BatchGetProjects existence check before updating","Confirm both calls target the same Floci region and endpoint","Trim/verify the exact project name string used at creation"],"exampleFix":"# before\naws --endpoint-url http://localhost:4566 codebuild update-project --name demo ...\n# fresh emulator -> ResourceNotFoundException\n\n# after\naws --endpoint-url http://localhost:4566 codebuild create-project --name demo ... || true\naws --endpoint-url http://localhost:4566 codebuild update-project --name demo ...","handlingStrategy":"validation","validationCode":"// Java - existence check before update\nboolean exists = codebuild.batchGetProjects(r -> r.names(name)).projects().stream()\n        .anyMatch(p -> p.name().equals(name));\nif (!exists) codebuild.createProject(toCreate(name, cfg));\ncodebuild.updateProject(toUpdate(name, cfg));","typeGuard":null,"tryCatchPattern":"catch (ResourceNotFoundException e) {\n    if (e.getMessage().contains(\"Project not found\")) {\n        codebuild.createProject(toCreate(name, cfg)); // fall back to create on fresh emulator\n    } else throw e;\n}","preventionTips":["Use the same region/endpoint config for create and update calls","Bootstrap with create-if-absent logic rather than bare updates"],"tags":["codebuild","update-project","not-found"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}