{"record":{"id":"934d74cff385ffaa","repo":"CanineHQ/canine","slug":"failed-to-register-webhook-response-body","errorCode":null,"errorMessage":"Failed to register webhook: #{response.body}","messagePattern":"Failed to register webhook: #(.+?)","errorType":"exception","errorClass":"Git::Client::Error","httpStatus":null,"severity":"error","filePath":"app/services/git/bitbucket/client.rb","lineNumber":77,"sourceCode":"    false\n  end\n\n  def register_webhook!\n    return if webhook_exists?\n\n    response = HTTParty.post(\n      \"#{bitbucket_api_base}/repositories/#{repository_url}/hooks\",\n      headers: auth_headers.merge(\"Content-Type\" => \"application/json\"),\n      body: {\n        description: \"Canine autodeploy webhook\",\n        url: Rails.application.routes.url_helpers.inbound_webhooks_bitbucket_index_url,\n        active: true,\n        secret: BITBUCKET_WEBHOOK_SECRET,\n        events: [ \"repo:push\" ]\n      }.to_json\n    )\n    unless response.success?\n      raise Git::Client::Error, \"Failed to register webhook: #{response.body}\"\n    end\n    response.parsed_response\n  end\n\n  def webhooks\n    response = HTTParty.get(\n      \"#{bitbucket_api_base}/repositories/#{repository_url}/hooks\",\n      headers: auth_headers\n    )\n    return [] unless response.success?\n\n    response[\"values\"] || []\n  end\n\n  def webhook_exists?\n    webhook.present?\n  end\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/CanineHQ/canine/blob/ba4ee3968d8513ee27d8583fbd3e854a8dd053f3/app/services/git/bitbucket/client.rb#L59-L95","documentation":"Error \"Failed to register webhook: #{response.body}\" thrown in CanineHQ/canine.","triggerScenarios":"Thrown at app/services/git/bitbucket/client.rb:77 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"}