5

I'm converting an app from capistrano version 2 to version 3 and now i'm getting this error:

DEBUG [7095ead3] Running /usr/bin/env git ls-remote git@myapp.git.beanstalkapp.com:/myapp/myapp.git on myapp.com
DEBUG [7095ead3] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/myapp.com/git-ssh.sh /usr/bin/env git ls-remote git@myapp.git.beanstalkapp.com:/myapp/myapp.git )
DEBUG [7095ead3]        fatal: cannot exec '/tmp/myapp.com/git-ssh.sh': Permission denied
DEBUG [7095ead3]        fatal: unable to fork
DEBUG [7095ead3] Finished in 0.195 seconds with exit status 128 (failed).

How can i get past this?

Catfish
  • 18,876
  • 54
  • 209
  • 353
  • Are you able to clone the app directly into the server with capistrano? please check that option as it may seem that there is a possible error in the .ssh config – user944938 Apr 08 '14 at 19:12
  • Yea you're right, I can't actually run the command from the server. Is this something new that never used to be done in capistrano 2? Like did cap 2 checkout code locally and then push it to the server? – Catfish Apr 09 '14 at 02:19
  • Thinking about this some more, I shouldn't necessarily be able to run that command on the server because when I run it on my dev machine, I have the option `forward_agent: true` set which passes my credentials (including keys) to the server when running the command. – Catfish Apr 09 '14 at 04:28
  • 1
    I can see your GIT_SSH is trying to make a clone in /tmp, im not sure if executables and scripts are allowed on your server /tmp, can you create your tmp directory in your /home/ and see if that helps.. – user944938 Apr 09 '14 at 16:37
  • I can, but how can I modify the capistrano task so that it knows to use the tmp dir I specify? – Catfish Apr 09 '14 at 17:41
  • You can set your deploy.rb: set :tmp_dir, "#{fetch(:home)}/tmp" – user944938 Apr 09 '14 at 18:04
  • I added tmp_dir like you said and it still gives me the same error. – Catfish Apr 11 '14 at 01:38
  • Are you able to clone into the newly created temp dir? – user944938 Apr 11 '14 at 02:20
  • I should clarify. I added tmp_dir like you said, but I'm not explicitly setting the `:home` variable anywhere. Is that an implicit variable? – Catfish Apr 12 '14 at 00:26
  • This might be helpful https://community.webfaction.com/questions/15144/capistrano-3-deploys-fatal-error-executing-tmpmyappgit-sshsh – Romans 8.38-39 Sep 24 '14 at 10:33

2 Answers2

7

I encountered this problem and solved this by reading this website (https://community.webfaction.com/questions/15144/capistrano-3-deploys-fatal-error-executing-tmpmyappgit-sshsh)

So, this is what I attempted

  • Create tmp dir in your HOME directory
  • I added in my .bashrc

    export TMPDIR="$HOME/tmp"

  • In deploy.rb, add this

    set :tmp_dir, "#{fetch(:home)}/tmp"

Then, try to cap production deploy again and it worked for me, hopefully for you too! :D

Romans 8.38-39
  • 456
  • 4
  • 14
0

I believe this is a bug inside Capistrano. You have to remove whitespaces from your :application variable.

Check here for more: https://github.com/capistrano/capistrano/issues/778