Skip to content

A deployment whose plan throws stays stuck instead of failing #314

Closed

Description

@samuelmbabhazi

What

When the deployment pipeline throws while it plans or places a release, the deployment does not fail. The pg-boss job is retried five times and then abandoned, and the deployment stays in its current state. It also keeps the application's single active deployment slot, so nothing else can be deployed until someone cancels it.

Found while working on #301. Both cases below exist on main before that change.

How to reproduce

  1. A value the schema accepts and the planner cannot read. Save an application with resources: { cpu: '9999999999999999' } (16 digits, the schema's maxLength). cpuMillis throws invalid_application_config because the result is not a safe integer. placementRequest and containerPlan call it inside the pipeline run (apps/api/src/modules/deployments/application/deployment-pipeline.ts, place and plan).
  2. A server without CPU or memory facts. schedulableNodes gives such a node a capacity of zero, and placeReplica (packages/domain/src/lib/scheduler.ts, assertNode) throws Invalid scheduling state for node <name> for a capacity of zero. One such node in an organization makes every placement of that organization throw. The comment on schedulableNodes says the node "only accepts unreserved replicas", which is not what happens.

Expected

  • A release that cannot be planned fails its deployment with a reason the user can read, like any other failure (deployment.failed, routing untouched).
  • A node without capacity facts is rejected for placement (for example not_ready, or a new reason) instead of throwing for the whole organization.
  • Values that can never be planned are refused when the configuration is saved. For CPU and memory this also covers limits below what Docker accepts (under 0.01 CPU or 6 MiB), which pass validation today and fail when the container is created.

Done when

  • A test deploys a release whose configuration throws in the planner and sees the deployment failed, not a retried job.
  • A test places a replica in an organization that has one node without facts and one ready node, and the replica lands on the ready node.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. samuelmbabhazi commented on Nov 16, 2026

    @samuelmbabhazi
    CollaboratorAuthor

    A correction to the text above. It says that limits under 0.01 CPU fail when the container is created. I checked on Docker 29.1.3: docker run --cpus 0.001 is accepted, and docker run -m 5m is refused with Minimum memory limit allowed is 6MB. So there is a memory minimum (6 MiB) and no CPU minimum beyond "greater than zero", which the schema already enforces since #313.

    Status: #317 (merged) makes a deployment that cannot be planned fail instead of staying stuck, and skips a node without capacity facts. #319 refuses the values behind such deployments when the configuration is saved, and closes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions