Gregor Panek
2010-Sep-09 12:01 UTC
Capistrano Deploy with SVN over SSH - Network connection closed unexpectedly
Hello all, i changed today from my local repository to a repository on a server. The repository now lies on the same server where my application is going to be deployed. Everything went fine create my repository on the server and checked out my working copy. After some changes on the code i wanted to deploy my application but it failed. The error is: "svn: Network connection closed unexpectedly" Here is the output after the deploy: cap deploy:update * executing `deploy:update'' ** transaction: start * executing `deploy:update_code'' executing locally: "svn info svn+ssh://sshloginname-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/*******/trunk --username ssh-username --password passwort --no-auth-cache -rHEAD" Password: * executing "svn checkout -q --username username --password passwort --no-auth-cache -r74 svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/****/trunk /kunden/284650_78052/webseiten/releases/20100909095956 && (echo 74 > /kunden/284650_78052/webseiten/releases/20100909095956/REVISION)" servers: ["domainname.com"] [domainname.com] executing command ** [domainname.com :: err] svn: Network connection closed unexpectedly command finished *** [deploy:update_code] rolling back * executing "rm -rf /kunden/*****/******/releases/20100909095956; true" servers: ["domainname.com"] [domainname.com] executing command command finished failed: "sh -c ''svn checkout -q --username ssh-username --password passwort --no-auth-cache -r74 svn+ssh://username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk /kunden/*****/*****/releases/20100909095956 && (echo 74 > /kunden/******/****/releases/20100909095956/REVISION)''" on domainname.com The username and Passwort for the ssh tunnel is correct, i can checkout the files locally trough a svn client. I will post my deploy.rb maybe there is something wrong: set :application, "******" set :domain, "*****" set :repository, "svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk" set :scm, :subversion set :scm_username, "ssh-username" set :scm_password, "password" # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` set :deploy_via, :checkout set :deploy_to, "/kunden/*******" set :user, "username" set :password, "password" set :use_sudo, false role :web, "domainname.com" # Your HTTP server, Apache/etc role :app, "domainname.com" # This may be the same as your `Web` server role :db, "domainname.com", :primary => true # This is where Rails migrations will run # If you are using Passenger mod_rails uncomment this: # if you''re still using the script/reapear helper you will need # these http://github.com/rails/irs_process_scripts namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles => :app, :except => { :no_release => true } do run "#{try_sudo} touch #{File.join(current_path,''tmp'',''restart.txt'')}" end end So far i used my local repository and depoyed the application via a copy and not with a checkout from the repository. Maybe someone had the same problems and could help my with some hints or a solution. I would be appreciative. Greetings Greg -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-09 12:59 UTC
Re: Capistrano Deploy with SVN over SSH - Network connection closed unexpectedly
aahh the old ssh to the same machine from capistrano, you see, when your repository and the deployment machine are the same and cap tries to do ssh to that machine to checkin with ssh, the first time , the machine does not have its own public key cached is as if you try to ssh to another machine , it will ask you if you want to save the public key and that you dont have it cached, then you say yes and it never asks you again. The thing is the first time one tries this you never think that it will need is its own public key to self connect. SOLUTION, connect on the server and ssh to itself, it will ask if you want to save the public key, say yes , good luck On Thu, Sep 9, 2010 at 8:01 AM, Gregor Panek <nerd-IFzI+cdOPjl94XxPFYsvd2Xnswh1EIUO@public.gmane.org>wrote:> Hello all, > > i changed today from my local repository to a repository on a server. The > repository now lies on the same server where my application is going to be > deployed. Everything went fine > create my repository on the server and checked out my working copy. After > some changes on the code i wanted to deploy my application but it failed. > The error is: > > "svn: Network connection closed unexpectedly" > > *Here is the output after the deploy:* > > cap deploy:update > * executing `deploy:update'' > ** transaction: start > * executing `deploy:update_code'' > executing locally: "svn info > svn+ssh://sshloginname-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/*******/trunk--username ssh-username --password passwort --no-auth-cache -rHEAD" > Password: > * executing "svn checkout -q --username username --password passwort > --no-auth-cache -r74 > svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/****/trunk/kunden/284650_78052/webseiten/releases/20100909095956 && (echo 74 > > /kunden/284650_78052/webseiten/releases/20100909095956/REVISION)" > servers: ["domainname.com"] > [domainname.com] executing command > ** [domainname.com :: err] svn: Network connection closed unexpectedly > command finished > *** [deploy:update_code] rolling back > * executing "rm -rf /kunden/*****/******/releases/20100909095956; true" > servers: ["domainname.com"] > [domainname.com] executing command > command finished > failed: "sh -c ''svn checkout -q --username ssh-username --password passwort > --no-auth-cache -r74 > svn+ssh://username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk/kunden/*****/*****/releases/20100909095956 && (echo 74 > > /kunden/******/****/releases/20100909095956/REVISION)''" on domainname.com > > *The username and Passwort for the ssh tunnel is correct, i can checkout > the files locally trough a svn client. I will post my deploy.rb maybe there > is something wrong:* > > set :application, "******" > set :domain, "*****" > set :repository, " > svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk" > > set :scm, :subversion > set :scm_username, "ssh-username" > set :scm_password, "password" > # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, > `subversion` or `none` > > set :deploy_via, :checkout > set :deploy_to, "/kunden/*******" > set :user, "username" > set :password, "password" > set :use_sudo, false > > > role :web, "domainname.com" # Your HTTP server, > Apache/etc > role :app, "domainname.com" # This may be the > same as your `Web` server > role :db, "domainname.com", :primary => true # This is where Rails > migrations will run > > # If you are using Passenger mod_rails uncomment this: > # if you''re still using the script/reapear helper you will need > # these http://github.com/rails/irs_process_scripts > > namespace :deploy do > task :start do ; end > task :stop do ; end > task :restart, :roles => :app, :except => { :no_release => true } do > run "#{try_sudo} touch #{File.join(current_path,''tmp'',''restart.txt'')}" > end > end > > > So far i used my local repository and depoyed the application via a copy > and not with a checkout from the repository. > > Maybe someone had the same problems and could help my with some hints or a > solution. I would be appreciative. > > Greetings Greg > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Gregor Panek
2010-Sep-09 13:46 UTC
Re: Capistrano Deploy with SVN over SSH - Network connection closed unexpectedly
Thanks radhames you got it! Costs me half a day and was so easy to solve. Copied default_run_options[:pty] = true into my deploy.rb and now he accepts the ssh key and the deploy worked. Greetings Greg Am 09.09.2010 um 14:59 schrieb radhames brito:> aahh the old ssh to the same machine from capistrano, you see, when your repository and the deployment machine are the same and cap tries to do ssh to that machine to checkin with ssh, the first time , the machine does not have its own public key cached > is as if you try to ssh to another machine , it will ask you if you want to save the public key and that you dont have it cached, then you say yes and it never asks you again. The thing is the first time one tries this you never think that it will need is its own public key to self connect. > > SOLUTION, connect on the server and ssh to itself, it will ask if you want to save the public key, say yes , good luck > > On Thu, Sep 9, 2010 at 8:01 AM, Gregor Panek <nerd-IFzI+cdOPjl94XxPFYsvd2Xnswh1EIUO@public.gmane.org> wrote: > Hello all, > > i changed today from my local repository to a repository on a server. The repository now lies on the same server where my application is going to be deployed. Everything went fine > create my repository on the server and checked out my working copy. After some changes on the code i wanted to deploy my application but it failed. > The error is: > > "svn: Network connection closed unexpectedly" > > Here is the output after the deploy: > > cap deploy:update > * executing `deploy:update'' > ** transaction: start > * executing `deploy:update_code'' > executing locally: "svn info svn+ssh://sshloginname-LuuGFW4anxJsqSCBsoyqvmGXanvQGlWp@public.gmane.orgm/kunden/*******/svn/*******/trunk --username ssh-username --password passwort --no-auth-cache -rHEAD" > Password: > * executing "svn checkout -q --username username --password passwort --no-auth-cache -r74 svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/****/trunk /kunden/284650_78052/webseiten/releases/20100909095956 && (echo 74 > /kunden/284650_78052/webseiten/releases/20100909095956/REVISION)" > servers: ["domainname.com"] > [domainname.com] executing command > ** [domainname.com :: err] svn: Network connection closed unexpectedly > command finished > *** [deploy:update_code] rolling back > * executing "rm -rf /kunden/*****/******/releases/20100909095956; true" > servers: ["domainname.com"] > [domainname.com] executing command > command finished > failed: "sh -c ''svn checkout -q --username ssh-username --password passwort --no-auth-cache -r74 svn+ssh://username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk /kunden/*****/*****/releases/20100909095956 && (echo 74 > /kunden/******/****/releases/20100909095956/REVISION)''" on domainname.com > > The username and Passwort for the ssh tunnel is correct, i can checkout the files locally trough a svn client. I will post my deploy.rb maybe there is something wrong: > > set :application, "******" > set :domain, "*****" > set :repository, "svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk" > > set :scm, :subversion > set :scm_username, "ssh-username" > set :scm_password, "password" > # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` > > set :deploy_via, :checkout > set :deploy_to, "/kunden/*******" > set :user, "username" > set :password, "password" > set :use_sudo, false > > > role :web, "domainname.com" # Your HTTP server, Apache/etc > role :app, "domainname.com" # This may be the same as your `Web` server > role :db, "domainname.com", :primary => true # This is where Rails migrations will run > > # If you are using Passenger mod_rails uncomment this: > # if you''re still using the script/reapear helper you will need > # these http://github.com/rails/irs_process_scripts > > namespace :deploy do > task :start do ; end > task :stop do ; end > task :restart, :roles => :app, :except => { :no_release => true } do > run "#{try_sudo} touch #{File.join(current_path,''tmp'',''restart.txt'')}" > end > end > > > So far i used my local repository and depoyed the application via a copy and not with a checkout from the repository. > > Maybe someone had the same problems and could help my with some hints or a solution. I would be appreciative. > > Greetings Greg > > > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-09 14:03 UTC
Re: Capistrano Deploy with SVN over SSH - Network connection closed unexpectedly
Great!!! On Thu, Sep 9, 2010 at 9:46 AM, Gregor Panek <nerd-IFzI+cdOPjl94XxPFYsvd2Xnswh1EIUO@public.gmane.org>wrote:> Thanks radhames you got it! Costs me half a day and was so easy to solve. > Copied *default_run_options[:pty] = true* into my deploy.rb and now he > accepts the ssh key and the deploy worked. > > Greetings Greg > > > Am 09.09.2010 um 14:59 schrieb radhames brito: > > aahh the old ssh to the same machine from capistrano, you see, when your > repository and the deployment machine are the same and cap tries to do ssh > to that machine to checkin with ssh, the first time , the machine does not > have its own public key cached > is as if you try to ssh to another machine , it will ask you if you want to > save the public key and that you dont have it cached, then you say yes and > it never asks you again. The thing is the first time one tries this you > never think that it will need is its own public key to self connect. > > SOLUTION, connect on the server and ssh to itself, it will ask if you want > to save the public key, say yes , good luck > > On Thu, Sep 9, 2010 at 8:01 AM, Gregor Panek <nerd-IFzI+cdOPjl94XxPFYsvd2Xnswh1EIUO@public.gmane.org>wrote: > >> Hello all, >> >> i changed today from my local repository to a repository on a server. The >> repository now lies on the same server where my application is going to be >> deployed. Everything went fine >> create my repository on the server and checked out my working copy. After >> some changes on the code i wanted to deploy my application but it failed. >> The error is: >> >> "svn: Network connection closed unexpectedly" >> >> *Here is the output after the deploy:* >> >> cap deploy:update >> * executing `deploy:update'' >> ** transaction: start >> * executing `deploy:update_code'' >> executing locally: "svn info >> svn+ssh://sshloginname-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/*******/trunk--username ssh-username --password passwort --no-auth-cache -rHEAD" >> Password: >> * executing "svn checkout -q --username username --password passwort >> --no-auth-cache -r74 >> svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/****/trunk/kunden/284650_78052/webseiten/releases/20100909095956 && (echo 74 > >> /kunden/284650_78052/webseiten/releases/20100909095956/REVISION)" >> servers: ["domainname.com"] >> [domainname.com] executing command >> ** [domainname.com :: err] svn: Network connection closed unexpectedly >> command finished >> *** [deploy:update_code] rolling back >> * executing "rm -rf /kunden/*****/******/releases/20100909095956; true" >> servers: ["domainname.com"] >> [domainname.com] executing command >> command finished >> failed: "sh -c ''svn checkout -q --username ssh-username --password >> passwort --no-auth-cache -r74 >> svn+ssh://username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk/kunden/*****/*****/releases/20100909095956 && (echo 74 > >> /kunden/******/****/releases/20100909095956/REVISION)''" on domainname.com >> >> *The username and Passwort for the ssh tunnel is correct, i can checkout >> the files locally trough a svn client. I will post my deploy.rb maybe there >> is something wrong:* >> >> set :application, "******" >> set :domain, "*****" >> set :repository, " >> svn+ssh://ssh-username-LuuGFW4anxJsqSCBsoyqvtBPR1lH4CV8@public.gmane.org/kunden/*******/svn/******/trunk >> " >> >> set :scm, :subversion >> set :scm_username, "ssh-username" >> set :scm_password, "password" >> # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, >> `subversion` or `none` >> >> set :deploy_via, :checkout >> set :deploy_to, "/kunden/*******" >> set :user, "username" >> set :password, "password" >> set :use_sudo, false >> >> >> role :web, "domainname.com" # Your HTTP server, >> Apache/etc >> role :app, "domainname.com" # This may be the >> same as your `Web` server >> role :db, "domainname.com", :primary => true # This is where Rails >> migrations will run >> >> # If you are using Passenger mod_rails uncomment this: >> # if you''re still using the script/reapear helper you will need >> # these http://github.com/rails/irs_process_scripts >> >> namespace :deploy do >> task :start do ; end >> task :stop do ; end >> task :restart, :roles => :app, :except => { :no_release => true } do >> run "#{try_sudo} touch >> #{File.join(current_path,''tmp'',''restart.txt'')}" >> end >> end >> >> >> So far i used my local repository and depoyed the application via a copy >> and not with a checkout from the repository. >> >> Maybe someone had the same problems and could help my with some hints or a >> solution. I would be appreciative. >> >> Greetings Greg >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rick B.
2011-Jan-24 00:00 UTC
Re: Capistrano Deploy with SVN over SSH - Network connection closed unexpectedly
OK. Here’s how I fixed this (on Mac OS X, but fix should work on any client) This particular issue arises when you are using a non-standard port (let’s say 12001 for sake of example) for your SSH server. Apparently the SVN client experiences syntax errors when given a port address on a command line like this one: svn list svn+ssh://username-8Ru2MIxcQXYFQeE35raUng@public.gmane.org:12001/home/username/svn/myproject So, to fix this, you need to create a client-side config file for SSH like this: cd ~ cd .ssh vi config (create a config file like the one that follows) :w :q Config file located in ~/.ssh/config: Host domain.com User username Port 12001 Then, issue your svn+ssh command WITHOUT the port like this: svn list svn+ssh://username-9IKiO1iGCm/QT0dZR+AlfA@public.gmane.org/home/username/svn/myproject That’s it! Hope that helps. Rick -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.