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

create_cron_leader fails #24

Closed rahoulb closed 2 years ago

rahoulb commented 8 years ago

I'm assuming this project is dead as there are a few similar issues around at the moment ... mine is slightly different to the rest ...

[2015-11-30T14:11:51.189Z] INFO  [9045]  - [Application update/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_pi2/Command cron_01_set_leader] : Starting activity...
[2015-11-30T14:11:51.634Z] INFO  [9045]  - [Application update/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_pi2/Command cron_01_set_leader] : Activity execution failed, because: /opt/rubies/ruby-2.0.0-p647/lib/ruby/gems/2.0.0/gems/aws-sdk-1.33.0/lib/aws/core.rb:489:in `config': undefined method `empty?' for nil:NilClass (NoMethodError)
  from /opt/rubies/ruby-2.0.0-p647/lib/ruby/gems/2.0.0/gems/whenever-elasticbeanstalk-1.1.3/bin/create_cron_leader:41:in `<top (required)>'
  from /opt/rubies/ruby-2.0.0-p647/bin/create_cron_leader:23:in `load'
  from /opt/rubies/ruby-2.0.0-p647/bin/create_cron_leader:23:in `<main>'
   (ElasticBeanstalk::ExternalInvocationError)

Looking at the source, the script tries to figure out which region it is in by grabbing the availability zone and then subtracting the last two letters from it. That's great for 'us-east-1' but no use at all for 'eu-central-1a'.

I need to get this app up and running today, but if I get time I'll do a fork and see if I can fix this properly - however, I've got a client yelling at me so don't expect it soon.

jufemaiz commented 8 years ago

I'm reworking Whenever::Elasticbeanstalk at the moment.

https://github.com/jufemaiz/whenever-elasticbeanstalk/tree/feature/aws-2.3

I believe this should resolve your issue (which is only removing the last character, but I've shifted it to a regular expression match instead).

Can you ping me if this assists?

binodmainali commented 8 years ago

I also faced couple of issues, when using this gem with lastest aws-sdk ~> 2, it breaks this gem and I have fixed the issue after forking it. I can raise a PR and also explain in which scenarios it will break.