7

I've been able to successfully get my application running on Beanstalk with Passenger, however I've had no luck with Puma. Whenever I deploy to a Puma stack I get a 502 error, my log files indicate that it can't find the puma sock file:

2014/05/15 21:00:15 [crit] 1684#0: *4 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 10.184.156.117, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "app-env-89spnxpcai.elasticbeanstalk.com"

My app is built using Ruby ruby 2.0.0p451 & Rails 4.1.1

My .ebextensions config looks like this

packages:
  yum:
    git: []

commands:
  add_bundle_exec:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: perl -pi -e 's/(rake)/bundle exec $1/' 11_asset_compilation.sh 12_db_migration.sh
  add_deployment_flag:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: perl -pi -e 's/(bundle install)/$1 --deployment/' 10_bundle_install.sh
  make_vendor_bundle_dir:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    command: mkdir /var/app/support/vendor_bundle
  set_vendor_bundle_var:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/support
    command: sed -i '12iexport EB_CONFIG_APP_VENDOR_BUNDLE=$EB_CONFIG_APP_SUPPORT/vendor_bundle' envvars
  symlink_vendor_bundle:
    test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
    cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
    command: sed -i 's/\(^cd $EB_CONFIG_APP_ONDECK\)/\1\nln -s $EB_CONFIG_APP_VENDOR_BUNDLE .\/vendor\/bundle/' 10_bundle_install.sh
  z_write_post_provisioning_complete_file:
    cwd: /opt/elasticbeanstalk/support
    command: touch .post-provisioning-complete 

What am I doing wrong, do I need something special to get it to work with Puma?

Stefan
  • 2,961
  • 1
  • 22
  • 34
  • 1
    I have the exact same issue, did you find a solution since then? – Sylvain Kalache Sep 25 '15 at 18:59
  • Updating to the newest version of the AMI fixed it for me. – Stefan Sep 25 '15 at 19:05
  • Is it "64bit Amazon Linux 2015.03 v2.0.1 running Ruby 2.2 (Puma)"? If yes I am already using this one and the problem still occurred. – Sylvain Kalache Sep 26 '15 at 20:20
  • There may be an issue then with your ebextensions then, take a look at these they're not 100% up to date but they'll point you in the right direction https://github.com/Mullen/ebextensions – Stefan Sep 26 '15 at 20:26
  • Apparently that is normal: "Because Elastic Beanstalk uses a drop-in upgrade process, there might be a few seconds of downtime. There is no workaround at this time." That is pretty bad. http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/troubleshooting.html – Sylvain Kalache Sep 28 '15 at 22:12
  • That's why you need at least two servers and do rolling updates. – Stefan Sep 28 '15 at 23:00

1 Answers1

-2

This issue does not present itself with the newest version - 64bit Amazon Linux 2014.03 v1.0.5 running Ruby 2.0 (Puma)

Stefan
  • 2,961
  • 1
  • 22
  • 34