Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy fails with relative :deploy_to #48

Open
ivan-kolmychek opened this issue Oct 30, 2014 · 15 comments
Open

deploy fails with relative :deploy_to #48

ivan-kolmychek opened this issue Oct 30, 2014 · 15 comments

Comments

@ivan-kolmychek
Copy link

Hi.

1.2.6 understands relative paths well, but new 1.3.2.2 fails on deploy:check

Somewhere in deployment configuration:

set :deploy_to, '~/rvm1cap3test'
[ivko@thinkpad-e530 rvm1cap3test]$ bundle exec cap staging deploy:check                                                                                                
INFO[fcff978e] Running /usr/bin/env mkdir -p ~/rvm1cap3test/rvm1scripts/ on <server host here>
DEBUG[fcff978e] Command: /usr/bin/env mkdir -p ~/rvm1cap3test/rvm1scripts/
INFO[fcff978e] Finished in 3.512 seconds with exit status 0 (successful).
DEBUGUploading /home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/rvm1-capistrano3-1.3.2.2/script/rvm-auto.sh 0.0%
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host <server host here>: scp: ~/rvm1cap3test/rvm1scripts/rvm-auto.sh: No such file or directory
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-scp-1.2.1/lib/net/scp.rb:398:in `await_response_state'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-scp-1.2.1/lib/net/scp.rb:369:in `block (3 levels) in start_command'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:311:in `call'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:311:in `process'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `block in preprocess'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `each'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `preprocess'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/net-scp-1.2.1/lib/net/scp.rb:284:in `upload!'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:83:in `block in upload!'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:82:in `upload!'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/rvm1-capistrano3-1.3.2.2/lib/rvm1/tasks/capistrano3.rake:6:in `block (3 levels) in <top (required)>'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/ivko/rvm1cap3test/vendor/bundle/ruby/2.1.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
scp: ~/rvm1cap3test/rvm1scripts/rvm-auto.sh: No such file or directory

full path (/home/someuserhere/rvm1cap3test) works just great.

@mpapis
Copy link
Member

mpapis commented Nov 8, 2014

this might be bug in sshkit ... I will try to investigate some time later as you got an easy workaround

@ivan-kolmychek
Copy link
Author

@mpapis Ok, thank you.

Anyway, I created this issue more to help others who can stumble upon such behavior and to have a place to post a workaround. But it would be great to have it fixed. =)

@zhangalex
Copy link

revert to the old version to fix the issue.

@mpapis
Copy link
Member

mpapis commented Dec 20, 2014

@Glacier3 can you provide more details? reverted to old version of sshkit or rvm1-capistrano3?

@zhangalex
Copy link

Revert rvm1-capistrano3 to 1.2.2 can fix this issue. When I using the latest 1.3.2.2, there is an issue will happen.

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as root@aliyun: scp: ~/gjt-site/rvm1scripts/rvm-auto.sh: No such file or directory
scp: ~/gjt-site/rvm1scripts/rvm-auto.sh: No such file or directory

@mpapis
Copy link
Member

mpapis commented Dec 20, 2014

@Glacier3 the old version uses one cache /tmp for all applications, this can make collisions, a later version was using /tmp/<user> - and finally we ended up to using <deploy_to>/tmp - this way the cache is per application and no collisions are possible - but it ends up in using your ~/... deploy_to path, I assume this is not problem in capistrano3 itself so has to be either specially handled in capistrano3 or is a bug in sshkit

@mpapis mpapis removed the need info label Dec 20, 2014
@zhangalex
Copy link

@mpapis You are right. It sshkit's bug. After I change the deploy_to path from "~/gjt-site" to absolute path "/root/gjt-site". The issue disappeared. I notice that rvm1-capistrano3 is using sshkit 1.2, do you have any plan to upgrade it? Maybe higher version has already fixed this bug.

@mpapis
Copy link
Member

mpapis commented Dec 20, 2014

the gemspec says:

spec.add_dependency 'sshkit', '>=1.2'

so if you could test with newer version => https://github.com/capistrano/sshkit/releases I would be glad to update the requirement or merge your Pull Request with it.

@zhangalex
Copy link

@mpapis After I did some research and testing, finally I found it's a bug from the net-scp gem. There is a people also encountering such problem, net-ssh/net-scp#9. So, for now, the home folder type ~ maybe is not a good way.

@mpapis
Copy link
Member

mpapis commented Dec 21, 2014

hmm, does it work with $HOME?

@zhangalex
Copy link

$HOME is not working. It works in this way,

task :set_up_deploy_path do
on roles(:app) do
set :deploy_to, lambda {capture("echo -n ~/gjt-site")}
end
end

before 'rvm1:hook', 'set_up_deploy_path'`

@mpapis
Copy link
Member

mpapis commented Dec 22, 2014

then maybe it's worth adding a descriptive warning instead of letting it fail?

@zhangalex
Copy link

I think if our gem can automatically convert '~' to user home folder path is much better. Do you think so?

@mpapis
Copy link
Member

mpapis commented Dec 22, 2014

it would be nice, but the trick with capture works only with one server, it's a lot easier to print a warning then to try to detect server configuration, and still in case of more then one server we need to print the warning

@mpapis mpapis removed the need info label Jan 7, 2015
@casertap
Copy link

+1
even when I update to rvm1-capistrano3 (= 1.2.2)
I still get the: rvm1scripts/rvm-auto.sh: No such file or directory error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants