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

cron_01_set_leader failed - instance does not exist #5

Closed timcreatewell closed 10 years ago

timcreatewell commented 11 years ago

Hi there,

First up - this gem is fantastic, it's certainly saved me a tonne of time getting tasks to run in EB!

I'm currently trying to deploy my site to our load-balanced production environment with the set_leader option. Unfortunately I'm receiving the following error:

2013-09-30 06:04:38,497 [ERROR] Command cron_01_set_leader (bundle exec create_cron_leader --no-update) failed
2013-09-30 06:04:38,498 [DEBUG] Command cron_01_set_leader output: /usr/share/ruby/1.9/gems/1.9.1/gems/aws-sdk-1.5.8/lib/aws/core/client.rb:277:in `return_or_raise': The instance ID 'XXXXXXXXX' does not exist (AWS::EC2::Errors::InvalidInstanceID::NotFound)
    from /usr/share/ruby/1.9/gems/1.9.1/gems/aws-sdk-1.5.8/lib/aws/core/client.rb:376:in `client_request'
    from (eval):3:in `create_tags'
    from /usr/share/ruby/1.9/gems/1.9.1/gems/aws-sdk-1.5.8/lib/aws/ec2/tag_collection.rb:64:in `create'
    from /usr/share/ruby/1.9/gems/1.9.1/gems/aws-sdk-1.5.8/lib/aws/ec2/resource_tag_collection.rb:88:in `[]='
    from /usr/share/ruby/1.9/gems/1.9.1/gems/whenever-elasticbeanstalk-1.1.2/bin/create_cron_leader:61:in `'
    from /usr/bin/create_cron_leader:23:in `load'
    from /usr/bin/create_cron_leader:23:in `
'

The interesting thing is that the instance does exist? I am running this out of the Sydney region if it helps?

I have been successful in running whenever-elasticbeanstalk in a non-load-balanced environment (I commented out the the set leader config)..

Any help you could provide would be fantastic!

Cheers

timcreatewell commented 11 years ago

Just realised I forgot to mention that I have region: 'ap-southeast-2' in my whenever-elasticbeanstalk.yml config file if that helps.

jufemaiz commented 10 years ago

Hi @timcreatewell can you confirm that this is still an issue or I will close. Can you confirm this by using IRB to step through file

bin/create_cron_leader

Ensuring that AWS.config.region is set to 'ap-southeast-2' before attempting to create_tags as you expect?

timcreatewell commented 10 years ago

Hi @jufemaiz, last I looked at this (October last year) it was still an issue.. As I wasn't getting much traction on this I actually moved away from Elastic Beanstalk and am now using Opsworks.. Sorry to not be much help :(

jufemaiz commented 10 years ago

Hi @timcreatewell, no worries. Any additional commentary on using Opsworks over ElasticBeanstalk would also be welcomed :)

timcreatewell commented 10 years ago

Thanks @jufemaiz. Long story short, in my opinion once you get your head around Opsworks (and how chef functions in that space) it's much much better than EB. I particularly found setting up cron on Opsworks to be really straight forward (and you can limit your cron to run on only one instance really easily). For me it gives the right amount of control - definitely worth checking out.

FYI - here's how to setup cron on opsworks from the AWS doco: http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-extend-cron.html

Hope this helps!

dignoe commented 10 years ago

I switched to Opsworks as well. From what I've found, EB is great for very basic apps, but once you need cron jobs or other daemons (delayed job), Opsworks is the way to go.

Chad McGimpsey

On Wednesday, June 25, 2014 at 6:26 PM, Tim Cromwell wrote:

Long story short, in my opinion once you get your head around Opsworks (and how chef functions in that space) it's much much better than EB. I particularly found setting up cron on Opsworks to be really straight forward (and you can limit your cron to run on only one instance really easily). For me it gives the right amount of control - definitely worth checking out.

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