{"record":{"id":"85d85d3b807f9613","repo":"spinnaker/spinnaker","slug":"titus-does-not-support-percentage-based-disabling","errorCode":null,"errorMessage":"Titus does not support percentage-based disabling for server groups in one or more target groups","messagePattern":"Titus does not support percentage-based disabling for server groups in one or more target groups","errorType":"exception","errorClass":"TitusException","httpStatus":null,"severity":"error","filePath":"clouddriver/clouddriver-titus/src/main/java/com/netflix/spinnaker/clouddriver/titus/deploy/actions/AbstractTitusEnableDisableAction.java","lineNumber":105,"sourceCode":"\n      TitusLoadBalancerClient titusLoadBalancerClient =\n          titusClientProvider.getTitusLoadBalancerClient(\n              description.getCredentials(), description.getRegion());\n\n      String serverGroupName = description.getServerGroupName();\n      String region = description.getRegion();\n\n      Job job = titusClient.findJobByName(serverGroupName, true);\n      if (job == null) {\n        saga.log(\"No job named '%s' found in %s\", serverGroupName, region);\n        return;\n      }\n\n      if (shouldDisable\n          && titusLoadBalancerClient != null\n          && description.getDesiredPercentage() != null) {\n        if (job.getLabels().containsKey(\"spinnaker.targetGroups\")) {\n          throw new TitusException(\n              \"Titus does not support percentage-based disabling for server groups in one or more target groups\");\n        }\n      }\n\n      // If desired percentage is part of the description (ie. Monitored Deploy), disable the job\n      // only if it's set to 100\n      if (shouldDisable && description.getDesiredPercentage() != null) {\n        if (description.getDesiredPercentage() == 100) {\n          saga.log(\"Disabling job (desiredPercentage: %d)\", description.getDesiredPercentage());\n          activateJob(titusClient, job, false);\n          saga.log(\"Disabled job (desiredPercentage: %d)\", description.getDesiredPercentage());\n        } else {\n          saga.log(\"Not disabling job (desiredPercentage: %d)\", description.getDesiredPercentage());\n        }\n      } else {\n        activateJob(titusClient, job, !shouldDisable);\n      }\n","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/spinnaker/spinnaker/blob/1d4a5d0f6d10d0232b1af077decd559b68a94a5e/clouddriver/clouddriver-titus/src/main/java/com/netflix/spinnaker/clouddriver/titus/deploy/actions/AbstractTitusEnableDisableAction.java#L87-L123","documentation":"Spinnaker Clouddriver's Titus enable/disable action throws this when a disable operation specifies a desiredPercentage (Monitored Deploy style percentage-based disabling) while the Titus job has 'spinnaker.targetGroups' labels, i.e. the server group is attached to load balancer target groups. Titus's API cannot express percentage-based disabling per target group, so the action rejects it up front with a TitusException.","triggerScenarios":"Running a disableServerGroup (or monitored deploy auto-disable stage) on a Titus server group with a Description whose getDesiredPercentage() is non-null and whose job labels contain 'spinnaker.targetGroups', with a non-null TitusLoadBalancerClient.","commonSituations":"Users configure a Monitored Deploy/percentage-based rollback against a Titus job that is registered with target-group load balancers; the combination is simply unsupported by the Titus backend.","solutions":["Remove the desiredPercentage from the disable description so the disable applies to the whole server group instead of a percentage","Detach target groups from the Titus server group or use a server group without the spinnaker.targetGroups label if percentage-based disabling is required","Use instance-count based disable/resize instead of percentage-based disabling for Titus server groups with load balancers"],"exampleFix":"// before (pipeline disable stage)\n{ \"desiredPercentage\": 50, \"serverGroupName\": \"myapp-v001\" }\n// after: drop percentage, disable all instances or size accordingly\n{ \"serverGroupName\": \"myapp-v001\" }","handlingStrategy":"validation","validationCode":"if (desc.getDesiredPercentage() != null && job.getLabels().containsKey(\"spinnaker.targetGroups\")) {\n  throw new IllegalArgumentException(\"Use non-percentage disable: Titus cannot disable by percentage for target-group-attached server groups\");\n}","typeGuard":"boolean supportsPercentageDisable = (job, desc) -> desc.getDesiredPercentage() == null || !job.getLabels().containsKey(\"spinnaker.targetGroups\");","tryCatchPattern":"try { disable(desc); } catch (TitusException e) { if (e.getMessage().contains(\"percentage-based disabling\")) { disableWithoutPercentage(desc); } else { throw e; } }","preventionTips":["Check job labels for spinnaker.targetGroups before configuring percentage-based disable stages","Use instance-count based disables for Titus server groups with load balancers","Document Monitored Deploy limitations for Titus target-group-attached apps"],"tags":["titus","load-balancer","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"1d4a5d0f6d10d0232b1af077decd559b68a94a5e","analyzedAt":"2026-09-10T14:13:07.222Z","contentChangedAt":"2026-09-10T14:13:07.222Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}