{"record":{"id":"7695146c21750f3e","repo":"CanineHQ/canine","slug":"failed-to-fetch-commits-response-body","errorCode":null,"errorMessage":"Failed to fetch commits: #{response.body}","messagePattern":"Failed to fetch commits: #(.+?)","errorType":"exception","errorClass":"Git::Client::Error","httpStatus":null,"severity":"error","filePath":"app/services/git/bitbucket/client.rb","lineNumber":37,"sourceCode":"    @repository_url = repository_url\n    @api_base_url = api_base_url || \"https://api.bitbucket.org\"\n  end\n\n  def bitbucket_api_base\n    \"#{@api_base_url}/2.0\"\n  end\n\n  def repository_exists?\n    repository.present? && repository[\"uuid\"].present?\n  end\n\n  def commits(branch)\n    response = HTTParty.get(\n      \"#{bitbucket_api_base}/repositories/#{repository_url}/commits?include=#{branch}\",\n      headers: auth_headers\n    )\n    unless response.success?\n      raise Git::Client::Error, \"Failed to fetch commits: #{response.body}\"\n    end\n\n    (response[\"values\"] || []).map do |commit|\n      Git::Common::Commit.new(\n        sha: commit[\"hash\"],\n        message: commit[\"message\"],\n        author_name: commit.dig(\"author\", \"user\", \"display_name\") || commit.dig(\"author\", \"raw\")&.split(\"<\")&.first&.strip,\n        author_email: extract_email(commit.dig(\"author\", \"raw\")),\n        authored_at: DateTime.parse(commit[\"date\"]),\n        committer_name: commit.dig(\"author\", \"user\", \"display_name\") || commit.dig(\"author\", \"raw\")&.split(\"<\")&.first&.strip,\n        committer_email: extract_email(commit.dig(\"author\", \"raw\")),\n        committed_at: DateTime.parse(commit[\"date\"]),\n        url: commit.dig(\"links\", \"html\", \"href\")\n      )\n    end\n  end\n\n  def can_write_webhooks?","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/CanineHQ/canine/blob/ba4ee3968d8513ee27d8583fbd3e854a8dd053f3/app/services/git/bitbucket/client.rb#L19-L55","documentation":"Error \"Failed to fetch commits: #{response.body}\" thrown in CanineHQ/canine.","triggerScenarios":"Thrown at app/services/git/bitbucket/client.rb:37 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"}