Skip to content

rake cleanup:sessions gets aborted

we get this every night,

root@chameleon:~# crontab -l
# HEADER: This file was autogenerated at Tue Apr 07 06:55:48 +0000 2015 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
#42 21 * * * cd /srv/leap/webapp && bundle exec rake cleanup:tokens
# Puppet Name: remove_expired_tokens
RAILS_ENV=production
0 3 * * * cd /srv/leap/webapp && bundle exec rake cleanup:tokens
# Puppet Name: remove_expired_sessions
RAILS_ENV=production
30 2 * * * cd /srv/leap/webapp && bundle exec rake cleanup:sessions
# Puppet Name: rotate_databases
RAILS_ENV=production
0 0,6,12,18 * * * cd /srv/leap/webapp && bundle exec rake db:rotate
# Puppet Name: delete_tmp_databases
RAILS_ENV=production
1 1 * * * cd /srv/leap/webapp && bundle exec rake db:deletetmp


root@chameleon:~# export RAILS_ENV=production

root@chameleon:~# cd /srv/leap/webapp && bundle exec rake cleanup:sessions
rake aborted!
Errno::ECONNREFUSED: Connection refused - connect(2)
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:206:in `transmit'
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:68:in `execute'
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:35:in `execute'
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/couchrest-1.1.3/lib/couchrest/rest_api.rb:94:in `execute'
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/couchrest-1.1.3/lib/couchrest/rest_api.rb:45:in `get'
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/couchrest-1.1.3/lib/couchrest/database.rb:82:in `get'
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/couchrest_session_store-0.3.0/lib/couchrest/session/document.rb:36:in `find_by_expires'
/srv/leap/webapp/vendor/bundle/ruby/1.9.1/gems/couchrest_session_store-0.3.0/lib/couchrest/session/store.rb:28:in `expired'
/srv/leap/webapp/lib/tasks/leap_web_core_tasks.rake:16:in `block (2 levels) in '
Tasks: TOP => cleanup:sessions
(See full trace by running task with --trace)

(from redmine: created on 2015-04-10, closed on 2015-04-16)