{"record":{"id":"13f83333dc1b46d6","repo":"CanineHQ/canine","slug":"failed-to-clone-repository-e-message","errorCode":null,"errorMessage":"Failed to clone repository: #{e.message}","messagePattern":"Failed to clone repository: #(.+?)","errorType":"exception","errorClass":"Projects::BuildJob::BuildFailure","httpStatus":null,"severity":"error","filePath":"app/jobs/projects/build_job.rb","lineNumber":87,"sourceCode":"      \"gitlab.com\"\n    elsif provider.bitbucket?\n      \"bitbucket.org\"\n    end\n    # Bitbucket git clone uses username (not email) with the API token\n    git_username = provider.bitbucket? ? provider.username : project_credential_provider.username\n    \"https://#{git_username}:#{project_credential_provider.access_token}@#{base_url}/#{project.repository_url}.git\"\n  end\n\n  def git_clone(project, build, repository_path)\n    # Construct the git clone command with OAuth token\n    git_clone_command = %w[git clone --depth 1 --branch] +\n                        [ project.branch, project_git(project), repository_path ]\n\n    # Execute the git clone command with killable support\n    runner = Cli::RunAndLog.new(build, killable: build)\n    runner.call(git_clone_command)\n  rescue Cli::CommandFailedError => e\n    raise BuildFailure, \"Failed to clone repository: #{e.message}\"\n  end\n\n\n  def complete_build!(build, user)\n    build.completed!\n    notify_build(build.project, build)\n    deployment = Deployment.create!(build:)\n    Projects::DeploymentJob.perform_later(deployment, user)\n  end\n\n  def clone_repository_and_build_image(project, build, image_builder)\n    Dir.mktmpdir do |repository_path|\n      build.info(\"Cloning repository: #{project.repository_url} to #{repository_path}\", color: :yellow)\n\n      git_clone(project, build, repository_path)\n\n      # Use the Docker builder to build the image\n      image_builder.build_image(repository_path)","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/CanineHQ/canine/blob/ba4ee3968d8513ee27d8583fbd3e854a8dd053f3/app/jobs/projects/build_job.rb#L69-L105","documentation":"Error \"Failed to clone repository: #{e.message}\" thrown in CanineHQ/canine.","triggerScenarios":"Thrown at app/jobs/projects/build_job.rb:87 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"}