ruby-on-railsamazon-web-servicessshrubber

Rubber Deployment: complete_passenger_mysql setup cannot connect to AWS instance


I was following the railcast tutorial, attempting to test out deployment with Rubber. Managed to survive from the Duplicated rules error, creating instance error, etc but I was finally stopped by the infinite connection loop:

 ** Instance running, fetching hostname/ip data
Trying to enable root login
  * 2014-01-16 15:36:41 executing `rubber:_ensure_key_file_present'
  * 2014-01-16 15:36:41 executing `rubber:_allow_root_ssh'
  * executing "sudo -p 'sudo password: '  bash -l -c 'mkdir -p /root/.ssh && cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'"
    servers: ["---.---.---.---"]
 ** Can't connect as user ubuntu to ---.---.---.---, assuming root allowed
  * 2014-01-16 15:36:44 executing `rubber:_direct_connection_---.---.---.---_673'
  * executing "echo"
    servers: ["---.---.---.---"]
 ** Failed to connect to ---.---.---.---, retrying
  * 2014-01-16 15:36:48 executing `rubber:_direct_connection_---.---.---.---_673'
  * executing "echo"
    servers: ["---.---.---.---"]
 ** Failed to connect to ---.---.---.---, retrying
  * 2014-01-16 15:36:53 executing `rubber:_direct_connection_---.---.---.---_673'
  * executing "echo"
    servers: ["---.---.---.---"]

I have tried a lot of different things:

They all seems ok so I think there must be something with the command used for rubber to connect and run the "sudo -p 'sudo password: ' bash -l -c 'mkdir -p /root/.ssh && cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'". However there's no where I can see what Rubber was talking to my instance. I tried to get into the source code but it lead me to no where too.

I have done quite a number of googling and it seems like it is quite a common error but no real solution to this. Can anyone suggest what's likely to be the problem? Thank you.

UPDATE:

Some more thoughts: it is writing ** Can't connect as user ubuntu to 54.200.63.202, assuming root allowed. So did rubber tried to ssh directly to root user? If so that may explain why. Are there anyway to change this?


Solution

  • I have find out why. It was a typo in my keyname.. I found this out by slowly regenerating the key_file string in console step by step. It is helpful to debug this key_path issues. Hope it may help someone!