OK, ive been making progress with diagnosing this. Posting my updates. Hope someone knows the fix. First off, im using 2 DIFFERENT ssh public keys for my Slicehost server and for the github server. And on the Slicehost server, although it does not ask for my password when I ssh connect, it DOES require my password for creating directories/files.
My deploy.rb looks like this right now. set :application, "ahref.in" set :user, "<slicehost_server_username_with_write_permissions>" set :repository, "[email protected]:<gitusername>/ahref.in.git" set :branch, "master" set :port, <port_number> default_run_options[:pty] = true set :scm_verbose, true ssh_options[:username] = user ssh_options[:verbose] = :debug #set :run_method, :run #set :ssh_options, { :forward_agent => true } set :use_sudo, false set :deploy_to, "/home/#{user}/public_html/#{application}" set :scm, :git set :deploy_via, :remote_cache #The user that starts the Mongrel(?) instances set :runner, user role :app, application role :web, application role :db, application, :primary => true This thread too discusses this problem http://ahref.in/33870 and I realised I had set :use_sudo true when I did cap deploy:setup. I thus deleted the files/dirs created by Cap on the server, set :use_sudo false and ran cap deploy:setup again but I still get permission denied errors. ** [out :: ahref.in] mkdir: cannot create directory `/home/<user>/ public_html/ahref.in/releases': Permission denied ** [out :: ahref.in] mkdir: cannot create directory `/home/<user>/ public_html/ahref.in/shared': Permission denied ** [out :: ahref.in] mkdir: cannot create directory `/home/<user>/ public_html/ahref.in/shared': Permission denied ** [out :: ahref.in] mkdir: cannot create directory `/home/<user>/ public_html/ahref.in/shared': Permission denied ** [out :: ahref.in] mkdir: cannot create directory `/home/<user>/ public_html/ahref.in/shared': Permission denied Now if I set use_sudo to true for deploy:setup, the setup goes fine but cap deploy does not work. Permission denied errors. The final dependency o/p for cap deploy:check is this The following dependencies failed. Please check them and try again: --> You do not have permissions to write to `/home/<user>/public_html/ ahref.in'. (<server_name>) --> You do not have permissions to write to `/home/<user>/public_html/ ahref.in/releases'. (<server_name>) --> `/home/<user>/public_html/ahref.in/shared' is not writable (<server_name>) In the SSH Debug o/p, I can see that Cap is using the public key for authentication and the authentication goes through but mkdir seems to fail. Like I mentioned at first, the slicehost server still requirs me to provide the pwd to create dirs/files and I think thats where this is failing. Thats my best guess at this problem. Although I dont have a solution. I even tried SSH Agents and set :ssh_options, { :forward_agent => true } according to this post http://ahref.in/1f632 but that dint work either. This too is a thread that discusses almost the same problem http://ahref.in/3b4af. The Original poster talks about how Cap seems to try to connect to the server using the first HostName specified in the ~/.ssh/config file. Thats something to note I guess. But I even gave that a wild shot and that dint work. How can I make Cap ssh to my server using the username i provide instead of the public key? ssh_options[:username] = user doesnt seem to work. Is there at least a quick fix for this problem right now that any of you can suggest? Thanks a bunch for reading this through even if you cant help! :) Cheers! On Feb 12, 11:17 am, Ram <[email protected]> wrote: > @ MAthias Meyer, > > Oh and yes, I DID do deploy:setup first and I can see the shared and > releases directories on my server > > On Feb 12, 11:11 am, Ram <[email protected]> wrote: > > > @Mathias Meyer, > > > Regarding the other question, I realised i had not installed Git on > > the server and I did that. This post shows the error I got AFTER > > installing Git on the server. > > About write permissions, well im really not sure how the deploy.rb > > works but her it is if it helps, > > > set :application, "ahref.in" > > set :user, "<username>" #this is the username for my slicehost server > > that has write permissions on the server > > set :repository, "[email protected]:vinaysesh/ahref.in.git" > > set :port, 4001 > > default_run_options[:pty] = true > > #set :use_sudo, true # Not sure what this should be set to. TRUE and > > FALSE dont work anyway. I get the same error. > > set :deploy_to, "/home/<username>/public_html/#{application}" > > > # If you aren't using Subversion to manage your source code, specify > > # your SCM below: > > set :scm, :git > > set :deploy_via, :remote_cache > > > #The user that starts the Mongrel(?) instances > > set :runner, user > > role :app, application > > role :web, application > > role :db, application, :primary => true > > > If you could point me to any documentation on what each of the options > > mean or some documentation on Git, Cap deployment to Slicehost, it > > will really help. > > I myself have been following these > > articleshttp://matharvard.ca/posts/2-deploying-with-capistrano-git-and-sliceh...... > > > @Brent, Dint know that about deploy:cold. Thanks for that. Anyway, > > deploy dint work either. same error. Thanks for the link Brent, will > > try following it. > > > Hope someone can find what im doing wrong. Thanks for the replies! > > > On Feb 11, 10:45 pm, "S. Brent Faulkner" <[email protected]> wrote: > > > > I believe Jamis no longer recommends using deploy:cold (as > > > perhttp://capify.org/getting-started/from-the-beginning) > > > > I highly recommend following the instructions at that location. They > > > worked beautifully for me (on slicehost, running ubuntu, and deploying > > > from OS X). > > > > Cheers. > > > > --Brent --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
