dignoe / whenever-elasticbeanstalk

Allows you to run cron jobs easily on one or all AWS Elastic Beanstalk instances.
MIT License
48 stars 35 forks source link

Deployment error #1

Closed ajporterfield closed 11 years ago

ajporterfield commented 11 years ago

After installing/configuring this gem, I'm seeing the following error in eb-tools.log on my EC2 instance after running git aws.push from my local repo.

2013-07-07 18:56:09,921 [INFO](4134 MainThread) [command.py-130] [root command execute] Command returned: (code: 0, stdout: , stderr: None) 2013-07-07 18:56:09,924 [INFO](4134 MainThread) [command.py-122] [root command execute] Executing command: Infra-EmbeddedPostBuild - AWSEBAutoScalingGroup 2013-07-07 18:56:12,688 [INFO](4134 MainThread) [command.py-130] [root command execute] Command returned: (code: 1, stdout: Error occurred during build: Command cron_01_set_leader failed , stderr: None) 2013-07-07 18:56:12,690 [DEBUG](4134 MainThread) [commandWrapper.py-60] [root commandWrapper main] Command result: {'status': 'FAILURE', 'results': [{'status': 'FAILURE', 'config_set': u'Infra-EmbeddedPostBuild', 'returncode': 1, 'events': [], 'msg': 'Error occurred during build: Command cron_01_set_leader failed\n'}], 'api_version': '1.0'}

I followed the Getting Started instruction at http://rubydoc.info/gems/whenever-elasticbeanstalk/1.1.0/frames. Do you have any thoughts as to why the deployment errors are being thrown?

Thanks, Andrew

ajporterfield commented 11 years ago

I believe the initial issue was the lack of the RAILS_ENV environment variable. I have resolved this now, but am still getting errors durring deployment. Here's the error I'm seeing when trying to manually run create_cron_leader on one of my app's EC2 instances.

[ec2-user@ip-10-143-165-222 ondeck]$ bundle exec create_cron_leader --no-update /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler.rb:263: warning: Insecure world writable dir /var/app/ondeck/vendor/bundle/bin in PATH, mode 040777 /var/app/ondeck/vendor/bundle/gems/whenever-elasticbeanstalk-1.1.0/bin/create_cron_leader:52:in <top (required)>': undefined local variable or methodthis_instance_id' for main:Object (NameError) from /var/app/ondeck/vendor/bundle/bin/create_cron_leader:23:in load' from /var/app/ondeck/vendor/bundle/bin/create_cron_leader:23:in

'

Looking at your source (https://github.com/dignoe/whenever-elasticbeanstalk/blob/master/bin/create_cron_leader), where does this_instance_id come from? At first glance, it doesn't look like it comes from anywhere - which I'm assuming is causing the error.

Would love you hear your thoughts.

Thanks, Andrew

dignoe commented 11 years ago

Try version 1.1.1. I'm on a plane, so I haven't been able to fully test it, but this update should fix those errors.

ajporterfield commented 11 years ago

Your commit this morning broke the setup_cron script. Specifically, you're referencing a variable named environment on lines 22 and 24 that isn't defined. I've included the error below. It looks like (https://github.com/dignoe/whenever-elasticbeanstalk/commit/f00e587dd73fdb04c2d6516b7203a0d2c10c6540) you removed (unintentionally?) a line that used to read environment = ENV["RAILS_ENV"].

[ec2-user@ip-10-143-165-222 post]$ sudo ./10_reload_cron.sh /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler.rb:263: warning: Insecure world writable dir /var/app/current/vendor/bundle/bin in PATH, mode 040777 WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8 /var/app/current/vendor/bundle/gems/whenever-elasticbeanstalk-1.1.1/bin/setup_cron:22:in <top (required)>': undefined local variable or methodenvironment' for main:Object (NameError) from /var/app/current/vendor/bundle/bin/setup_cron:23:in load' from /var/app/current/vendor/bundle/bin/setup_cron:23:in

'

dignoe commented 11 years ago

Yep, I just saw that. I'm about to board another flight, but I'm going to try to fix it in the air again.

Chad McGimpsey

On Tuesday, July 9, 2013 at 2:29 PM, Andrew Porterfield wrote:

Your commit this morning broke the setup_cron script. Specifically, you're referencing a variable named environment on lines 22 and 24 that isn't defined. I've included the error below. It looks like (f00e587 (https://github.com/dignoe/whenever-elasticbeanstalk/commit/f00e587dd73fdb04c2d6516b7203a0d2c10c6540)) you removed (unintentionally?) a line that used to read environment = ENV["RAILS_ENV"]. [ec2-user@ip-10-143-165-222 post]$ sudo ./10_reload_cron.sh (http://10_reload_cron.sh)
/usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler.rb:263: warning: Insecure world writable dir /var/app/current/vendor/bundle/bin in PATH, mode 040777 WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8 /var/app/current/vendor/bundle/gems/whenever-elasticbeanstalk-1.1.1/bin/setup_cron:22:in <top (required)>': undefined local variable or methodenvironment' for main:Object (NameError) from /var/app/current/vendor/bundle/bin/setup_cron:23:in load' from /var/app/current/vendor/bundle/bin/setup_cron:23:in'

— Reply to this email directly or view it on GitHub (https://github.com/dignoe/whenever-elasticbeanstalk/issues/1#issuecomment-20695181).

dignoe commented 11 years ago

This should be fixed in v1.1.2.

ajporterfield commented 11 years ago

v1.1.2 seems to be working as expected. Thanks for your attention to this/these issues.

xuanchien commented 11 years ago

I am having issue like this:

  stdout: Error occurred during build: Command cron_01_set_leader failed

I don't know what is going on. @ajporterfield, you said something about RAILS_ENV, could you please share your experience?

Thanks

dharmdip commented 10 years ago

Sorry for delay, too busy with consecutive project releases,

Can you send trace.. because i have customize for Ruby 1.8.7 without bundler and it's working as expected.

Thanks

ygee07 commented 10 years ago

Same issue as @xuanchien right now! How did you solve it?