Skip to content

Deployments can get stuck when scaled to 0 #4250

@Samze

Description

@Samze

Reproduce Steps

  1. Push an application with 1 instance
  2. Push again with rolling deployment with 0 instances cf push "static" -b staticfile_buildpack -i 0 --strategy=rolling
  3. Observe that the deployment is stuck in DEPLOYING
  4. Observe in the logs
{"timestamp":"2025-03-10T22:31:58.615385458Z","message":"error-scaling-deployment","log_level":"error","source":"cc.deployment_updater.update","data":{"deployment_guid":"12ec3f1d-4b80-4098-8855-ddd93d010124","error":"NoMethodError","error_message":"undefined method `lock!' for nil:NilClass","backtrace":"/var/vcap/data/packages/cloud_controller_ng/708214c425d84329afca8ddad9f998cf8219d3e4/cloud_controller_ng/lib/cloud_controller/deployment_updater/actions/scale.rb:31:

This seems like its related to https://github.com/cloudfoundry/cloud_controller_ng/blob/main/lib/cloud_controller/deployment_updater/actions/scale.rb#L57 when there are no process instances > 0 this returns nil. Presumably min_by returns null if given an empty array

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions