{"record":{"id":"70ea228f37a27ee3","repo":"CanineHQ/canine","slug":"predeploy-command-command-failed","errorCode":null,"errorMessage":"Predeploy command `#{command}` failed","messagePattern":"Predeploy command `#(.+?)` failed","errorType":"exception","errorClass":"Deployments::BaseDeploymentService::DeploymentFailure","httpStatus":null,"severity":"error","filePath":"app/services/k8/stateless/command.rb","lineNumber":40,"sourceCode":"    nil\n  end\n\n  def wait_for_completion\n    retries = 0\n    while true\n      break if done?\n      sleep(3.0)\n      retries += 1\n      if retries > 30\n        raise Deployments::BaseDeploymentService::DeploymentFailure, \"Predeploy command `#{command}` took too long to complete\"\n      end\n    end\n  end\n\n  def done?\n    _statuses = statuses\n    if _statuses.include?(\"Failed\") || _statuses.include?(\"ActiveDeadlineExceeded\")\n      raise Deployments::BaseDeploymentService::DeploymentFailure, \"Predeploy command `#{command}` failed\"\n    end\n    _statuses.include?(\"Complete\")\n  end\n\n  def statuses\n    begin\n      output = kubectl.call(%w[get job] + [ name, \"-n\", namespace, \"-o\", \"jsonpath={.status.conditions[*].type}\" ])\n      conditions = output.split\n      conditions.map { |condition| condition.strip }\n    rescue => e\n      Rails.logger.error(\"Error checking job completion: #{e.message}\")\n      false\n    end\n  end\nend\n","sourceCodeStart":22,"sourceCodeEnd":56,"githubUrl":"https://github.com/CanineHQ/canine/blob/ba4ee3968d8513ee27d8583fbd3e854a8dd053f3/app/services/k8/stateless/command.rb#L22-L56","documentation":"Error \"Predeploy command `#{command}` failed\" thrown in CanineHQ/canine.","triggerScenarios":"Thrown at app/services/k8/stateless/command.rb:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ba4ee3968d8513ee27d8583fbd3e854a8dd053f3","analyzedAt":"2026-08-23T17:49:27.834Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}