Scheduled task error, please help ! :)

Hello all,

my scheduled tasks are not working anymore since a few hours (they all worked fine until now), this morning i tried to change my smtp settings from sendgrid to ses so i changed config.yml file… Then i ran this command

bundle exec rake sharetribe:synchronize_verified_with_ses

and since when i run a scheduled task i have this error

ubuntu@ip-172-31-4-233:~/sharetribe$ bundle exec rails runner ActiveSessionsHelper.cleanup
/home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.1/lib/active_record/connection_adapters/connection_specification.rb:246:in resolve_symbol_connection': 'development' database is not configured. Available: ["production"] (ActiveRecord::AdapterNotSpecified) from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.1/lib/active_record/connection_adapters/connection_specification.rb:227:inresolve_connection’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.1/lib/active_record/connection_adapters/connection_specification.rb:141:in resolve' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.1/lib/active_record/connection_handling.rb:55:inestablish_connection’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.1/lib/active_record/railtie.rb:124:in block (2 levels) in <class:Railtie>' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/lazy_load_hooks.rb:45:ininstance_eval’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/lazy_load_hooks.rb:45:in execute_hook' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/lazy_load_hooks.rb:35:inblock in on_load’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/lazy_load_hooks.rb:34:in each' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/lazy_load_hooks.rb:34:inon_load’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activerecord-5.1.1/lib/active_record/railtie.rb:120:in block in <class:Railtie>' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/initializable.rb:30:ininstance_exec’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/initializable.rb:30:in run' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/initializable.rb:59:inblock in run_initializers’
from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in block in tsort_each' from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:inblock (2 levels) in each_strongly_connected_component’
from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in each_strongly_connected_component_from' from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:inblock in each_strongly_connected_component’
from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in each' from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:incall’
from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in each_strongly_connected_component' from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:226:intsort_each’
from /home/ubuntu/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:205:in tsort_each' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/initializable.rb:58:inrun_initializers’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/application.rb:353:in initialize!' from /home/ubuntu/sharetribe/config/environment.rb:18:in<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in require' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:inblock in require’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in load_dependency' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:inrequire’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/application.rb:329:in require_environment!' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/command/actions.rb:16:inrequire_application_and_environment!‘
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/commands/runner/runner_command.rb:27:in perform' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/thor-0.19.4/lib/thor/command.rb:27:inrun’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/thor-0.19.4/lib/thor.rb:369:indispatch’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/command/base.rb:63:in perform' from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/command.rb:44:ininvoke’
from /home/ubuntu/.rvm/gems/ruby-2.3.4/gems/railties-5.1.1/lib/rails/commands.rb:16:in <top (required)>' from bin/rails:4:inrequire’
from bin/rails:4:in `’

Does anyone have an idea how to fix this ?

Thanks in advance for your help,

Mathieu

Actually i found the error, i just needed to add this before the command

RAILS_ENV=production

1 Like