Skip to content

Instantly share code, notes, and snippets.

@xsyn

xsyn/account.rb

Created Oct 30, 2012
Embed
What would you like to do?
Debug
cattr_accessor :current_account
self.authorizer_name = 'AccountAuthorizer'
77: after_create do
78: RuoteKit.engine.launch(ProcessDefinition.account_creation, account_id: self.id.to_s, :object_type => 'Account')
79: end
/var/cloudafrica/releases/20121029095047/app/models/account.rb:78:in `block in <class:Account>'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:442:in `_run__587982677127256626__create__3928148805503195247__callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:405:in `__run_callback'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/callbacks.rb:114:in `run_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/persistence/insertion.rb:24:in `block in prepare'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:403:in `_run__587982677127256626__save__3928148805503195247__callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:405:in `__run_callback'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/callbacks.rb:114:in `run_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/persistence/insertion.rb:23:in `prepare'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/persistence/operations/insert.rb:26:in `persist'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/persistence.rb:50:in `insert'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/persistence.rb:79:in `save'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/devise-2.1.2/app/controllers/devise/registrations_controller.rb:15:in `create'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/abstract_controller/base.rb:167:in `process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:447:in `_run__4581327137582312171__process_action__4396577187008963605__callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:405:in `__run_callback'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/abstract_controller/callbacks.rb:17:in `process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/notifications.rb:123:in `block in instrument'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/notifications.rb:123:in `instrument'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal/params_wrapper.rb:206:in `process_action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/abstract_controller/base.rb:121:in `process'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/abstract_controller/rendering.rb:45:in `process'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal.rb:203:in `dispatch'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_controller/metal.rb:246:in `block in action'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:73:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:36:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:42:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:600:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/rack/mongoid/middleware/identity_map.rb:33:in `block in call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/mongoid/unit_of_work.rb:39:in `unit_of_work'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/mongoid-3.0.6/lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/warden-1.2.1/lib/warden/manager.rb:35:in `block in call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/warden-1.2.1/lib/warden/manager.rb:34:in `catch'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/warden-1.2.1/lib/warden/manager.rb:34:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/head.rb:14:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/flash.rb:238:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/cookies.rb:338:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:405:in `_run__279741406880502811__call__3928148805503195247__callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:405:in `__run_callback'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/railties-3.2.5/lib/rails/rack/logger.rb:26:in `call_app'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/railties-3.2.5/lib/rails/rack/logger.rb:16:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/actionpack-3.2.5/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/railties-3.2.5/lib/rails/engine.rb:479:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/railties-3.2.5/lib/rails/application.rb:220:in `call'
/var/cloudafrica/shared/bundle/ruby/1.9.3/gems/railties-3.2.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/utils.rb:470:in `safe_fork'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server.rb:180:in `start'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/rack/application_spawner.rb:129:in `start'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/opt/local/lib/ruby/vendor_ruby/1.9.3/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/opt/local/share/phusion-passenger/helper-scripts/passenger-spawn-server:99:in `<main>'
Completed 500 Internal Server Error in 141ms
fatal (deadlock detected):
app/models/account.rb:78:in `block in <class:Account>'
## -----------------
# Development config
development:
sessions:
default:
database: rb_development
hosts:
- localhost:27017
options:
consistency: :strong
options:
raise_not_found_error: false
## -----------------
# Testing config
test:
sessions:
default:
database: rb_test
hosts:
- localhost:27017
options:
consistency: :strong
## -----------------
# Production config
production:
sessions:
default:
database: rb_production
hosts:
- realbox.mongo:27017
options:
consistency: :strong
# Configure Mongoid specific options. (optional)
options:
raise_not_found_error: false
db_config = YAML::load(File.read(Rails.root + "config/mongoid.yml"))
mongo = db_config[Rails.env]
RUOTE_STORAGE = Ruote::Mon::Storage.new(Mongo::Connection.new(mongo['sessions']['default']['hosts'].first.split(':').first)[mongo['sessions']['default']['database']], pool_size: 14, pool_timeout: 3)
RuoteKit.engine = Ruote::Engine.new(Ruote::Worker.new(RUOTE_STORAGE))
unless $RAKE_TASK # don't register participants in rake tasks
RuoteKit.engine.register do
participant :capi, CapiParticipant
participant :vyatta, VyattaParticipant
participant :mapi, MapiParticipant
# register the catchall storage participant named '.+'
catchall
end
end
# when true, the engine will be very noisy (stdout)
RuoteKit.engine.context.logger.noisy = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.