[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

problem with svn+ssh authentication when excute deploy rails project on EC2 amazon server

Asked by expertmemeber1 in Linux Administration, Linux Programming

i am trying to deploy my app rails hello_world from my svn to ec2 amazon server. i got trouble when excute deploy command:


- 1: i am using ec2 amazon for hosting and server like: ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com

- 2: i have 1 other server installed subversion (SVN) which store rails app (hello world) use for deploy to ec2 server (svn+ssh://root@yyy.yyy.yyy.yyy/svn/hello_world)

- 3: first.. on my depvelopment computer, i will excute command :"cap deploy:setup" and it will setup core for app hello_world on ec2 server.

       second: i will excute command "cap deploy" to deploy app hello_world from svn server to ec2 server
       problem occur here:
-----------------------------------------------------------
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
root@yyy.yyy.yyy.yyy's password:
  * executing "if [ -d /usr/hello/shared/cached-copy ]; then svn update -q  -r398 /usr/hello/shared/cached-copy; else svn checkout -q  -r398 svn+ssh://root@yyy.yyy.yyy.yyy/svn/hello_world /usr/hello/shared/cached-copy; fi"
    servers: ["ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"]
    [ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com] executing command
 ** [err] reverse mapping checking getaddrinfo for yyy.yyy.yyy.yyy.com [yyy.yyy.yyy.yyy] failed - POSSIBLE BREAK-IN ATTEMPT!
 ** [err] Permission denied, please try again.
 ** [err] Permission denied, please try again.
 ** [err] Permission denied (publickey,gssapi-with-mic,password).
 ** [err] svn: Connection closed unexpectedly
    command finished
*** [deploy:update_code] rolling back
  * executing "rm -rf /usr/hello/releases/20090223091608; true"
    servers: ["ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"]
    [ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com] executing command
    command finished
command "if [ -d /usr/hello/shared/cached-copy ]; then svn update -q  -r398 /usr/hello/shared/cached-copy; else svn checkout -q  -r398 svn+ssh://root@yyy.yyy.yyy.yyy/svn/hello_world /usr/hello/shared/cached-copy; fi" failed on ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com


---------------------------------------
i tried to ssh to ec2 server and do command "svn co svn+ssh://root@yyy.yyy.yyy.yyy/svn/hello_world"
and it asking for enter password twice times. after that, it 's ok, i think problem in here

addition infor, i can stand on ec2 server to ssh to my svn server contains  rails app

and below is deploy.rb file use for deploy.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
set :application, "hello"
set :svn_repository_home, "hello_world"
 
## Servers 
 
set :use_sudo, false  
ssh_options[:keys] = ["~/.ssh/id_rsa-gsp-keypair"]
set :domain, "ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"
set :rails_env, "production"
set :group_writable, false
 
role :web,      "ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"
role :app,      "ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"
role :memcache, "ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"
role :db,       "ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com", :primary => true
 
## Subversion
 
set :scm, :subversion
set :scm_user, "root"   # Sets 'my_svn_user' instead, if you are using different name than your app.
set :scm_password, Proc.new { Capistrano::CLI.password_prompt("SCM password for #{scm_user}:") }
set :repository,  "svn+ssh://root@yyy.yyy.yyy.yyy/svn/hello_world"
set :scm_auth_cache, true  # Prompts for password once
set :deploy_to, "/var/www/apps/"
# keeps a local checkout of the repository on the server to get faster deployments
set :deploy_via, :remote_cache
 
## Tasks
 
namespace :deploy do
  desc "Restart Application (using tmp/restart.txt)"
  task :restart_passenger do
    run "touch #{current_path}/tmp/restart.txt"
  end
 
  desc "Restarts your application."
  task :restart do
    restart_passenger
  end
 
  desc "Link shared files"
  #task :before_symlink do
  before :symlink do
    run "rm -drf #{release_path}/public/uploads"
    run "ln -s #{shared_path}/uploads #{release_path}/public/uploads"
    run "rm -f #{release_path}/config/database.yml"
    run "ln -s #{shared_path}/database.yml #{release_path}/config/database.yml"
  end
end
[+][-]02/23/09 02:16 AM, ID: 23709653Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/23/09 02:30 AM, ID: 23709729Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/23/09 02:32 AM, ID: 23709739Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/23/09 04:10 AM, ID: 23710257Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/23/09 05:25 PM, ID: 23717478Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/24/09 12:11 AM, ID: 23719277Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/24/09 01:38 AM, ID: 23719679Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/24/09 02:04 AM, ID: 23719815Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/24/09 08:24 AM, ID: 23723112Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/24/09 08:56 AM, ID: 23723518Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625