Search code examples
amazon-web-servicesruby-on-rails-4deploymentcapistrano

Capistrano Deploy Fails To Find Github Repository


Trying to deploy a Rails App on AWS I get the following error once I try bundle exec cap production deploy


00:01 git:update
      01 git remote set-url origin [email protected]:AskBid/delegations-explorer-backend.git
    ✔ 01 [email protected] 0.066s
      02 git remote update --prune
      02 Fetching origin
    ✔ 02 [email protected] 1.148s
00:03 git:create_release
      01 mkdir -p /var/www/delegations-explorer-backend/releases/20201229124628
    ✔ 01 [email protected] 0.065s
      02 git archive master | /usr/bin/env tar -x -f - -C /var/www/delegations-explorer-backend/releases/20201229124628
      02 fatal: Not a valid object name
      02 tar:
      02 This does not look like a tar archive
      02
      02 tar:
      02 Exiting with failure status due to previous errors
      02

I found many similar problems online and the solution has always been that they didn't push the repository on GitHub or the Repository didn't exist.

In my case the Repo is there.. so I have no clue how to fix this.

this is my deploy.rb

set :application, "delegations-explorer-backend"
set :repo_url, "[email protected]:AskBid/delegations-explorer-backend.git"
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
set :rvm_ruby_version, '2.6.3'
set :passenger_restart_with_touch, true

Solution

  • By default, capistrano deploys the master branch. But your repository contains only a main branch.

    Just configure capistrano to deploy from the main branch.

    set :branch, "main"