floci-io/floci · error · AwsException

ResourceNotFoundException

ResourceNotFoundException

Error message

Project not found:  " + name

What it means

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.

Source

Thrown at src/main/java/io/github/hectorvent/floci/services/codebuild/CodeBuildService.java:195

    }

    public Project updateProject(String region, String name,
                                 String description,
                                 ProjectSource source, List<ProjectSource> secondarySources,
                                 String sourceVersion,
                                 ProjectArtifacts artifacts, List<ProjectArtifacts> secondaryArtifacts,
                                 ProjectEnvironment environment,
                                 String serviceRole,
                                 Integer timeoutInMinutes, Integer queuedTimeoutInMinutes,
                                 String encryptionKey,
                                 List<Map<String, String>> tags,
                                 Map<String, Object> logsConfig,
                                 Map<String, Object> vpcConfig,
                                 Integer concurrentBuildLimit) {
        Map<String, Project> store = projectsFor(region);
        Project project = store.get(name);
        if (project == null) {
            throw new AwsException("ResourceNotFoundException", "Project not found: " + name, 400);
        }

        if (description != null) { project.setDescription(description); }
        if (source != null) { project.setSource(source); }
        if (secondarySources != null) { project.setSecondarySources(secondarySources); }
        if (sourceVersion != null) { project.setSourceVersion(sourceVersion); }
        if (artifacts != null) { project.setArtifacts(artifacts); }
        if (secondaryArtifacts != null) { project.setSecondaryArtifacts(secondaryArtifacts); }
        if (environment != null) { project.setEnvironment(environment); }
        if (serviceRole != null) { project.setServiceRole(serviceRole); }
        if (timeoutInMinutes != null) { project.setTimeoutInMinutes(timeoutInMinutes); }
        if (queuedTimeoutInMinutes != null) { project.setQueuedTimeoutInMinutes(queuedTimeoutInMinutes); }
        if (encryptionKey != null) { project.setEncryptionKey(encryptionKey); }
        if (tags != null) { project.setTags(tags); }
        if (logsConfig != null) { project.setLogsConfig(logsConfig); }
        if (vpcConfig != null) { project.setVpcConfig(vpcConfig); }
        if (concurrentBuildLimit != null) { project.setConcurrentBuildLimit(concurrentBuildLimit); }
        project.setLastModified(Instant.now().toEpochMilli() / 1000.0);

View on GitHub (pinned to 62ff490619)

Solutions

  1. Create the project first, or guard with a list-projects/BatchGetProjects existence check before updating
  2. Confirm both calls target the same Floci region and endpoint
  3. Trim/verify the exact project name string used at creation

Example fix

# before
aws --endpoint-url http://localhost:4566 codebuild update-project --name demo ...
# fresh emulator -> ResourceNotFoundException

# after
aws --endpoint-url http://localhost:4566 codebuild create-project --name demo ... || true
aws --endpoint-url http://localhost:4566 codebuild update-project --name demo ...
Defensive patterns

Strategy: validation

Validate before calling

// Java - existence check before update
boolean exists = codebuild.batchGetProjects(r -> r.names(name)).projects().stream()
        .anyMatch(p -> p.name().equals(name));
if (!exists) codebuild.createProject(toCreate(name, cfg));
codebuild.updateProject(toUpdate(name, cfg));

Try / catch

catch (ResourceNotFoundException e) {
    if (e.getMessage().contains("Project not found")) {
        codebuild.createProject(toCreate(name, cfg)); // fall back to create on fresh emulator
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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