0

I am trying to deploy an Amazon EC2 instance using rubber. On running cap rubber:create_staging I get the following timeout:

  * 2014-04-06 20:14:09 executing `rubber:postgresql:setup_apt_sources'
    servers: ["production.foo.com"]
 ** sftp upload #<StringIO:0x0000000420a748> -> /tmp/configure_postgresql_repository
    [production.foo.com] /tmp/configure_postgresql_repository
    [production.foo.com] done
  * sftp upload complete
  * executing "sudo -p 'sudo password: '  bash -l /tmp/configure_postgresql_repository"
    servers: ["production.foo.com"]
    [production.foo.com] executing command
    command finished in 1161ms
  * executing "sudo -p 'sudo password: '  bash -l -c 'apt-get -q update'"
    servers: ["production.foo.com"]
connection failed for: production.foo.com (Timeout::Error: execution expired)

I tried increasing the timeout to 60 seconds, but it didn't work. Any suggestions?

user1742188
  • 4,563
  • 8
  • 35
  • 60

1 Answers1

0

Looks like the user you are using to connect with to the instance using Rubber/Capistrano doesn't have passwordless sudo access. Try creating the file /etc/sudoers.d/90-user-you-use-for-rubber with the following content:

user-you-user-for-rubber  ALL=(ALL) NOPASSWD:ALL
Rico
  • 58,485
  • 12
  • 111
  • 141
  • Well, the 'apt-get -q update' command works before it tries to install the postgresql. In fact, if I make the 'configure_postgresql_repository' file blank, the installation continues but fails at a later point with the same timeout error. – user1742188 Apr 07 '14 at 01:58
  • What is `/tmp/configure_postgresql_repository` doing specifically ? – Rico Apr 07 '14 at 03:14