Authorization Failed Capistrano Push

Running into this error when running cap production deploy I’m running into this error: SSHKit::Runner::ExecuteError: Exception while executing on host calton.dev: Authentication failed for user vagrant@domain.dev

This was working fine yesterday, nothing has changed.

Running vagrant ssh still allows me to ssh correctly into the VM.

Looks like you’re running Capistrano from your VM. Is that normally how you do it?

No, I’m running Cap from OSX

That makes me think you’re in a VM.

I’m not. I’m in my bedrock project directory. From the directory if I run cap production deploy I get the above error. From the same directory, I can vagrant ssh in correctly. If I then exit out of the vm, run cap production deploy I get the same error (obviously.)

SSHKit::Runner::ExecuteError: Exception while executing on host calton.dev: Authentication failed for user vagrant@calton.dev the exact error.

I just ran a deploy on another bedrock project, and it worked correctly. So I don’t know at this point.

What does your production.rb look like?

set :stage, :production
set :wpcli_remote_url, "https://www.remotedomain.com"
set :wpcli_local_url, "https://localdomain.dev"

# Extended Server Syntax
# ======================
server 'www.remotedomain.com', user: 'deploy', group: 'www-data', roles: %w{web app db}

set :ssh_options, {
    keys: %w(~/.ssh/id_rsa)
  }

fetch(:default_env).merge!(wp_env: :production)

It was when I added

server "calton.dev", user: 'vagrant', roles: %w{dev}
set :dev_path, '/srv/www/calton.dev/current'

to my deploy.rb file. I added this for for the wpcli db push and pull wrapper.

Removing this fixed it.