Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

no implicit conversion of nil into String (TypeError) #290

Closed
sschepens opened this issue Jun 28, 2014 · 40 comments
Closed

no implicit conversion of nil into String (TypeError) #290

sschepens opened this issue Jun 28, 2014 · 40 comments

Comments

@sschepens
Copy link

I'm getting a lot of this errors sin updating to moped2/mongoid4:

no implicit conversion of nil into String (TypeError)
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `block in initialize'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:119:in `handle_socket_errors'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `new'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `block in connect'
/usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/timeout.rb:82:in `block in timeout'
/usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/timeout.rb:70:in `catch'
/usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/timeout.rb:70:in `timeout'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:144:in `connect'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection.rb:52:in `connect'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:531:in `connect'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:179:in `block in ensure_connected'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:115:in `block in connection'
vendor/bundle/ruby/2.1.0/gems/connection_pool-2.0.0/lib/connection_pool.rb:58:in `with'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:114:in `connection'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:177:in `ensure_connected'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:589:in `block in flush'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:617:in `block in logging'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.2/lib/active_support/notifications.rb:159:in `block in instrument'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.2/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.2/lib/active_support/notifications.rb:159:in `instrument'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/instrumentable.rb:31:in `instrument'
vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:616:in `logging
@papayaah
Copy link

papayaah commented Jul 3, 2014

getting the same issue here:

Unexpected error while processing request: no implicit conversion of nil into String
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/protocol/commands/authenticate.rb:35:in `+'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/protocol/commands/authenticate.rb:35:in `digest'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/protocol/commands/authenticate.rb:47:in `build_auth_command'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/protocol/commands/authenticate.rb:25:in `initialize'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/node.rb:502:in `new'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/node.rb:502:in `login'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/node.rb:57:in `block in apply_auth'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/node.rb:56:in `each'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/node.rb:56:in `apply_auth'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/cluster.rb:251:in `with_secondary'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/session/context.rb:104:in `with_node'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/session/context.rb:50:in `command'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/database.rb:76:in `command'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/moped-1.5.2/lib/moped/query.rb:38:in `count'
    /Users/davidang/.rvm/gems/ruby-2.1.0/gems/mongoid-3.1.6/lib/mongoid/persistence.rb:307:in `delete_all'

@leemhenson
Copy link

Us too:

2014-07-03T12:19:10.061413+00:00 app[web.1]: TypeError (no implicit conversion of nil into String):
2014-07-03T12:19:10.061414+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
2014-07-03T12:19:10.061417+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `block in initialize'
2014-07-03T12:19:10.061418+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:119:in `handle_socket_errors'
2014-07-03T12:19:10.061420+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
2014-07-03T12:19:10.061421+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `new'
2014-07-03T12:19:10.061422+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `block in connect'
2014-07-03T12:19:10.061424+00:00 app[web.1]:   vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
2014-07-03T12:19:10.061425+00:00 app[web.1]:   vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `block in catch'
2014-07-03T12:19:10.061426+00:00 app[web.1]:   vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
2014-07-03T12:19:10.061427+00:00 app[web.1]:   vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
2014-07-03T12:19:10.061429+00:00 app[web.1]:   vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:106:in `timeout'
2014-07-03T12:19:10.061430+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:144:in `connect'
2014-07-03T12:19:10.061431+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection.rb:52:in `connect'
2014-07-03T12:19:10.061433+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:531:in `connect'
2014-07-03T12:19:10.061435+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:179:in `block in ensure_connected'
2014-07-03T12:19:10.061436+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:115:in `block in connection'
2014-07-03T12:19:10.061437+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/connection_pool-2.0.0/lib/connection_pool.rb:58:in `with'
2014-07-03T12:19:10.061439+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:114:in `connection'
2014-07-03T12:19:10.061440+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:177:in `ensure_connected'
2014-07-03T12:19:10.061441+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:589:in `block in flush'
2014-07-03T12:19:10.061442+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:617:in `block in logging'
2014-07-03T12:19:10.061443+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications.rb:159:in `block in instrument'
2014-07-03T12:19:10.061445+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2014-07-03T12:19:10.061446+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications.rb:159:in `instrument'
2014-07-03T12:19:10.061447+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/instrumentable.rb:31:in `instrument'
2014-07-03T12:19:10.061449+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:616:in `logging'
2014-07-03T12:19:10.061450+00:00 app[web.1]:   engines/music_glue/lib/newrelic_moped/instrumentation.rb:39:in `block in logging_with_newrelic_trace'
2014-07-03T12:19:10.061463+00:00 app[web.1]:   engines/music_glue/lib/newrelic_moped/instrumentation.rb:56:in `call'
2014-07-03T12:19:10.061464+00:00 app[web.1]:   engines/music_glue/lib/newrelic_moped/instrumentation.rb:56:in `logging_with_newrelic_trace'
2014-07-03T12:19:10.061466+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:587:in `flush'
2014-07-03T12:19:10.061467+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:391:in `process'
2014-07-03T12:19:10.061468+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/operation/read.rb:48:in `execute'
2014-07-03T12:19:10.061469+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:648:in `read'
2014-07-03T12:19:10.061471+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:90:in `command'
2014-07-03T12:19:10.061472+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:432:in `refresh'
2014-07-03T12:19:10.061473+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:182:in `block in refresh'
2014-07-03T12:19:10.061475+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:194:in `each'
2014-07-03T12:19:10.061476+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:194:in `refresh'
2014-07-03T12:19:10.061477+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:151:in `nodes'
2014-07-03T12:19:10.061478+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:240:in `with_primary'
2014-07-03T12:19:10.061479+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/read_preference/primary.rb:55:in `block in with_node'
2014-07-03T12:19:10.061481+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/read_preference/selectable.rb:65:in `call'
2014-07-03T12:19:10.061482+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/read_preference/selectable.rb:65:in `with_retry'
2014-07-03T12:19:10.061483+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/read_preference/primary.rb:54:in `with_node'
2014-07-03T12:19:10.061485+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/query.rb:127:in `first'
2014-07-03T12:19:10.061489+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:187:in `block in first_with_cache'
2014-07-03T12:19:10.061491+00:00 app[web.1]:   engines/music_glue/lib/music_glue/monkey_patches/mongoid_query_cache.rb:15:in `with_cache'
2014-07-03T12:19:10.061492+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:186:in `first_with_cache'
2014-07-03T12:19:10.061493+00:00 app[web.1]:   engines/music_glue/lib/music_glue/healthcheck.rb:30:in `block in mongo_check'
2014-07-03T12:19:10.061494+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/session.rb:369:in `with'
2014-07-03T12:19:10.061495+00:00 app[web.1]:   engines/music_glue/lib/music_glue/healthcheck.rb:29:in `mongo_check'
2014-07-03T12:19:10.061497+00:00 app[web.1]:   engines/music_glue/lib/music_glue/healthcheck.rb:19:in `call'
2014-07-03T12:19:10.061499+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/rack.rb:80:in `block in call_with_newrelic'
2014-07-03T12:19:10.061501+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.
7.3.204/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:335:in `perform_action_with_newrelic_trace'
2014-07-03T12:19:10.061502+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/rack.rb:79:in `call_with_newrelic'
2014-07-03T12:19:10.061504+00:00 app[web.1]:   engines/music_glue/lib/music_glue/healthcheck.rb:7:in `call'
2014-07-03T12:19:10.061505+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:71:in `block in call'
2014-07-03T12:19:10.061506+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:59:in `each'
2014-07-03T12:19:10.061507+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:59:in `call'
2014-07-03T12:19:10.061509+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:676:in `call'
2014-07-03T12:19:10.061510+00:00 app[web.1]:   engines/music_glue/lib/music_glue/middleware/lock_session_ip.rb:36:in `pass'
2014-07-03T12:19:10.061511+00:00 app[web.1]:   engines/music_glue/lib/music_glue/middleware/lock_session_ip.rb:11:in `call'
2014-07-03T12:19:10.061512+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
2014-07-03T12:19:10.061514+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
2014-07-03T12:19:10.061515+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
2014-07-03T12:19:10.061516+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:184:in `call!'
2014-07-03T12:19:10.061517+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:164:in `call'
2014-07-03T12:19:10.061519+00:00 app[web.1]:   engines/music_glue/config/initializers/omniauth.rb:6:in `call_with_error_handling'
2014-07-03T12:19:10.061520+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:184:in `call!'
2014-07-03T12:19:10.061521+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:164:in `call'
2014-07-03T12:19:10.061522+00:00 app[web.1]:   engines/music_glue/config/initializers/omniauth.rb:6:in `call_with_error_handling'
2014-07-03T12:19:10.061524+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/omniauth-1.1.4/lib/omniauth/builder.rb:49:in `call'
2014-07-03T12:19:10.061525+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:104:in `block in call'
2014-07-03T12:19:10.061527+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:69:in `cache'
2014-07-03T12:19:10.061528+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:104:in `call'
2014-07-03T12:19:10.061529+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/error_collector.rb:55:in `call'
2014-07-03T12:19:10.061530+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/agent_hooks.rb:32:in `call'
2014-07-03T12:19:10.061532+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/browser_monitoring.rb:27:in `call'
2014-07-03T12:19:10.061533+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/bundler/gems/client_side_validations-0db547f7c1e4/lib/client_side_validations/middleware.rb:17:in `call'
2014-07-03T12:19:10.061534+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
2014-07-03T12:19:10.061536+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
2014-07-03T12:19:10.061537+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-07-03T12:19:10.061538+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2014-07-03T12:19:10.061539+00:00 app[web.1]:   engines/music_glue/lib/music_glue/middleware/force_request_encoding.rb:12:in `call'
2014-07-03T12:19:10.061540+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/flash.rb:254:in `call'
2014-07-03T12:19:10.061542+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
2014-07-03T12:19:10.061543+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
2014-07-03T12:19:10.061544+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
2014-07-03T12:19:10.061549+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2014-07-03T12:19:10.061550+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:82:in `run_callbacks'
2014-07-03T12:19:10.061551+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2014-07-03T12:19:10.061552+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
2014-07-03T12:19:10.061554+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/airbrake-4.0.0/lib/airbrake/rails/middleware.rb:13:in `call'
2014-07-03T12:19:10.061555+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2014-07-03T12:19:10.061556+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-07-03T12:19:10.061557+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/rack/logger.rb:38:in `call_app'
2014-07-03T12:19:10.061559+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/rack/logger.rb:20:in `block in call'
2014-07-03T12:19:10.061567+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-07-03T12:19:10.061570+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-07-03T12:19:10.061571+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-07-03T12:19:10.061572+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/rack/logger.rb:20:in `call'
2014-07-03T12:19:10.061574+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-07-03T12:19:10.061575+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-07-03T12:19:10.061576+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-07-03T12:19:10.061578+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
2014-07-03T12:19:10.061579+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-07-03T12:19:10.061580+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/bundler/gems/font_assets-61d73f708510/lib/font_assets/middleware.rb:33:in `__call'
2014-07-03T12:19:10.061582+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/bundler/gems/font_assets-61d73f708510/lib/font_assets/middleware.rb:24:in `call'
2014-07-03T12:19:10.061583+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2014-07-03T12:19:10.061584+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/airbrake-4.0.0/lib/airbrake/user_informer.rb:16:in `_call'
2014-07-03T12:19:10.061586+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/airbrake-4.0.0/lib/airbrake/user_informer.rb:12:in `call'
2014-07-03T12:19:10.061587+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/engine.rb:514:in `call'
2014-07-03T12:19:10.061588+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/application.rb:144:in `call'
2014-07-03T12:19:10.061589+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `public_send'
2014-07-03T12:19:10.061591+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `method_missing'
2014-07-03T12:19:10.061592+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/deflater.rb:25:in `call'
2014-07-03T12:19:10.061593+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/puma-2.8.2/lib/puma/configuration.rb:71:in `call'
2014-07-03T12:19:10.061594+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/puma-2.8.2/lib/puma/server.rb:490:in `handle_request'
2014-07-03T12:19:10.061595+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/puma-2.8.2/lib/puma/server.rb:361:in `process_client'
2014-07-03T12:19:10.061596+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/puma-2.8.2/lib/puma/server.rb:254:in `block in run'
2014-07-03T12:19:10.061598+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/puma-2.8.2/lib/puma/thread_pool.rb:92:in `call'
2014-07-03T12:19:10.061599+00:00 app[web.1]:   vendor/bundle/ruby/2.1.0/gems/puma-2.8.2/lib/puma/thread_pool.rb:92:in `block in spawn_thread'
2014-07-03T12:19:10.061600+00:00 app[web.1]:
2014-07-03T12:19:10.061601+00:00 app[web.1]:
2014-07-03T12:19:10.076742+00:00 app[web.1]:   Rendered vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.9ms)
2014-07-03T12:19:10.088275+00:00 app[web.1]:   Rendered vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.6ms)
2014-07-03T12:19:10.088380+00:00 app[web.1]:   Rendered vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (17.1ms)

@malconis
Copy link

It's happening on our project as well. Has anyone found a decent work around? It happens intermittently and it's proving impossible for me to replicate.

@ghg
Copy link

ghg commented Jul 22, 2014

Hi,

Any updates on this? We are also running into the same issue.

Thanks!

@chrisckchang
Copy link

+1

@corny
Copy link

corny commented Jul 30, 2014

Our project is affected by this bug as well. We are using Ruby 2.1.2 with Moped 2.0.0 and Rails 4.1.4.

@jacquescrocker
Copy link

also seeing this issue

TypeError: no implicit conversion of nil into String
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection/socket/tcp.rb", line 20, in initialize
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection/socket/tcp.rb", line 20, in block in initialize
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection/socket/connectable.rb", line 119, in handle_socket_errors
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection/socket/tcp.rb", line 20, in initialize
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection/socket/connectable.rb", line 145, in new
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection/socket/connectable.rb", line 145, in block in connect
  File "/app/vendor/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb", line 91, in block in timeout
  File "/app/vendor/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb", line 35, in block in catch
  File "/app/vendor/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb", line 35, in catch
  File "/app/vendor/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb", line 35, in catch
  File "/app/vendor/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb", line 106, in timeout
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection/socket/connectable.rb", line 144, in connect
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/connection.rb", line 52, in connect
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 531, in connect
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 179, in block in ensure_connected
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 115, in block in connection
  File "/app/vendor/bundle/ruby/2.1.0/gems/connection_pool-2.0.0/lib/connection_pool.rb", line 58, in with
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 114, in connection
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 177, in ensure_connected
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 589, in block in flush
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 617, in block in logging
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications.rb", line 159, in block in instrument
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications/instrumenter.rb", line 20, in instrument
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications.rb", line 159, in instrument
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/instrumentable.rb", line 31, in instrument
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 616, in logging
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 587, in flush
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 391, in process
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/operation/read.rb", line 48, in execute
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 648, in read
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 90, in command
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/node.rb", line 432, in refresh
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/cluster.rb", line 182, in block in refresh
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/cluster.rb", line 194, in each
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/cluster.rb", line 194, in refresh
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/cluster.rb", line 151, in nodes
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/cluster.rb", line 240, in with_primary
  File "/app/vendor/bundle/ruby/2.1.0/gems/moped-2.0.0.rc1/lib/moped/collection.rb", line 124, in insert
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/query_cache.rb", line 117, in insert_with_clear_cache
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 79, in insert_as_root
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 27, in block in insert
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 117, in block (2 levels) in prepare_insert
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 113, in call
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 113, in call
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 166, in block in halting
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 166, in call
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 166, in block in halting
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 86, in call
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 86, in run_callbacks
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/interceptable.rb", line 138, in run_callbacks
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 116, in block in prepare_insert
  File "/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb", line 82, in run_callbacks
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/interceptable.rb", line 138, in run_callbacks
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 115, in prepare_insert
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 23, in insert
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 179, in block in create!
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/threaded/lifecycle.rb", line 156, in _creating
  File "/app/vendor/bundle/ruby/2.1.0/gems/mongoid-4.0.0.beta1/lib/mongoid/persistable/creatable.rb", line 174, in create!
  File "/app/app/controllers/webhooks/webhooks_controller.rb", line 35,

is this a mongodb server problem? cant tell why that would be nil. i did check and the server seems to be up, though i'm using mongohq elastic and they do replica sets or something

@arthurnn
Copy link
Contributor

How is this happening?
Anyone can write a script or app, to help me simulate this?

thanks

@papayaah
Copy link

papayaah commented Aug 1, 2014

my issue earlier was that I had a malformed YML settings.

@vovimayhem
Copy link

I've seen this happen on one of the apps I'm working on... seems to happen after a couple of days.

The first time I saw it was when we migrated to ruby 2.1.2 (from ruby 2.1.1, due to issues with the garbage collector)

Currently running:

  • Ruby MRI 2.1.2
  • Rails 4.1.4
  • Mongoid 4.0.0 (not beta, not rc)

@rlupiichuk
Copy link

+1 we see this as well.

We're using:

  • ruby 2.1.2p95
  • mongoid 4.0.0
  • Rails rails 4.1.2
  • PhusionPassenger

For us, it usually happens after 2-3 days of running.

TypeError (no implicit conversion of nil into String):
  moped (2.0.0) lib/moped/connection/socket/tcp.rb:20:in `initialize'
  moped (2.0.0) lib/moped/connection/socket/tcp.rb:20:in `block in initialize'
  moped (2.0.0) lib/moped/connection/socket/connectable.rb:119:in `handle_socket_errors'
  moped (2.0.0) lib/moped/connection/socket/tcp.rb:20:in `initialize'
  moped (2.0.0) lib/moped/connection/socket/connectable.rb:145:in `new'
  moped (2.0.0) lib/moped/connection/socket/connectable.rb:145:in `block in connect'
  /usr/local/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
  /usr/local/lib/ruby/2.1.0/timeout.rb:35:in `block in catch'
  /usr/local/lib/ruby/2.1.0/timeout.rb:35:in `catch'
  /usr/local/lib/ruby/2.1.0/timeout.rb:35:in `catch'
  /usr/local/lib/ruby/2.1.0/timeout.rb:106:in `timeout'
  moped (2.0.0) lib/moped/connection/socket/connectable.rb:144:in `connect'
  moped (2.0.0) lib/moped/connection.rb:52:in `connect'
  moped (2.0.0) lib/moped/node.rb:531:in `connect'
  moped (2.0.0) lib/moped/node.rb:179:in `block in ensure_connected'
  moped (2.0.0) lib/moped/node.rb:115:in `block in connection'
  connection_pool (2.0.0) lib/connection_pool.rb:58:in `with'
  moped (2.0.0) lib/moped/node.rb:114:in `connection'
  moped (2.0.0) lib/moped/node.rb:177:in `ensure_connected'
  moped (2.0.0) lib/moped/node.rb:589:in `block in flush'
  moped (2.0.0) lib/moped/node.rb:617:in `block in logging'
  activesupport (4.1.2) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.2) lib/active_support/notifications.rb:159:in `instrument'
  moped (2.0.0) lib/moped/instrumentable.rb:31:in `instrument'
  moped (2.0.0) lib/moped/node.rb:616:in `logging'
  moped (2.0.0) lib/moped/node.rb:587:in `flush'
  moped (2.0.0) lib/moped/node.rb:391:in `process'
  moped (2.0.0) lib/moped/operation/read.rb:48:in `execute'
  moped (2.0.0) lib/moped/node.rb:648:in `read'
  moped (2.0.0) lib/moped/node.rb:90:in `command'
  moped (2.0.0) lib/moped/node.rb:432:in `refresh'
  moped (2.0.0) lib/moped/cluster.rb:182:in `block in refresh'
  moped (2.0.0) lib/moped/cluster.rb:368:in `call'
  moped (2.0.0) lib/moped/cluster.rb:368:in `block in refresh_peers'
  moped (2.0.0) lib/moped/cluster.rb:367:in `each'
  moped (2.0.0) lib/moped/cluster.rb:367:in `refresh_peers'
  moped (2.0.0) lib/moped/cluster.rb:187:in `block in refresh'
  moped (2.0.0) lib/moped/cluster.rb:194:in `each'
  moped (2.0.0) lib/moped/cluster.rb:194:in `refresh'
  moped (2.0.0) lib/moped/cluster.rb:151:in `nodes'
  moped (2.0.0) lib/moped/cluster.rb:240:in `with_primary'
  moped (2.0.0) lib/moped/read_preference/primary.rb:55:in `block in with_node'
  moped (2.0.0) lib/moped/read_preference/selectable.rb:65:in `call'
  moped (2.0.0) lib/moped/read_preference/selectable.rb:65:in `with_retry'
  moped (2.0.0) lib/moped/read_preference/primary.rb:54:in `with_node'
  moped (2.0.0) lib/moped/query.rb:127:in `first'
  mongoid (4.0.0) lib/mongoid/query_cache.rb:187:in `block in first_with_cache'
  mongoid (4.0.0) lib/mongoid/query_cache.rb:135:in `with_cache'
  mongoid (4.0.0) lib/mongoid/query_cache.rb:186:in `first_with_cache'
  mongoid (4.0.0) lib/mongoid/contextual/mongo.rb:199:in `block (2 levels) in first'
  mongoid (4.0.0) lib/mongoid/contextual/mongo.rb:535:in `with_sorting'
  mongoid (4.0.0) lib/mongoid/contextual/mongo.rb:198:in `block in first'
  mongoid (4.0.0) lib/mongoid/contextual/mongo.rb:447:in `try_cache'
  mongoid (4.0.0) lib/mongoid/contextual/mongo.rb:197:in `first'
  mongoid (4.0.0) lib/mongoid/contextual.rb:20:in `first'
  mongoid (4.0.0) lib/mongoid/criteria/modifiable.rb:188:in `find_or'
  mongoid (4.0.0) lib/mongoid/criteria/modifiable.rb:68:in `find_or_create_by'
  mongoid (4.0.0) lib/mongoid/findable.rb:15:in `find_or_create_by'
  character (1.0.0) lib/character/settings.rb:68:in `stored_object'
  character (1.0.0) lib/character/settings.rb:72:in `value'
  character (1.0.0) lib/character/settings.rb:12:in `value'
  character (1.0.0) app/controllers/concerns/website_settings.rb:8:in `set_website_settings'
  activesupport (4.1.2) lib/active_support/callbacks.rb:424:in `block in make_lambda'
  activesupport (4.1.2) lib/active_support/callbacks.rb:160:in `call'
  activesupport (4.1.2) lib/active_support/callbacks.rb:160:in `block in halting'
  activesupport (4.1.2) lib/active_support/callbacks.rb:229:in `call'
  activesupport (4.1.2) lib/active_support/callbacks.rb:229:in `block in halting'
  activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `call'
  activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `run_callbacks'
  actionpack (4.1.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.1.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.1.2) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.2) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.1.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  actionpack (4.1.2) lib/abstract_controller/base.rb:136:in `process'
  actionview (4.1.2) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.1.2) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.1.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.1.2) lib/action_controller/metal.rb:232:in `block in action'
  actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `call'
  actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
  actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:50:in `call'
  actionpack (4.1.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:678:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/flash.rb:254:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.1.2) lib/active_support/callbacks.rb:82:in `run_callbacks'
  actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.2) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.2) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.2) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.2) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.1.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.2) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.2) lib/rails/engine.rb:514:in `call'
  railties (4.1.2) lib/rails/application.rb:144:in `call'
  passenger (4.0.42) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
  passenger (4.0.42) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
  passenger (4.0.42) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
  passenger (4.0.42) lib/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'

@jacquescrocker
Copy link

i have no idea how to replicate this, however I was seeing 1,000 of these exceptions reported a day on production

it is using replica sets via mongohq, so there might be some kind of screwed up handling

i'm doing a trial run just using a single server mongodb database setup (with no failover) to see if the errors happen then

let me know if I can do anything to help debug this issue. I've only ever seen it on production, and it seems to happen non-deterministically (some hours i'll get 300 errors, other hours none)

@danielevans
Copy link

@mickeyren Your stack trace is different from the others listed here. Yours is caused by a nil username or password.

@papayaah
Copy link

papayaah commented Aug 8, 2014

@danielevans yes. It was caused by a malformed database yml

@fabiob
Copy link

fabiob commented Aug 18, 2014

Same here, running:

  • ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
  • mongoid 4.0.0
  • moped 2.0.0
  • 2 sidekiq 3.2.2 processes with 25 threads each
  • 3 puma 2.9.0 processes with 16 threads each
  • a MongoHQ elastic deployment, with replica sets
Error Class
TypeError

Error Message
no implicit conversion of nil into String

Error Backtrace
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `block in initialize'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:119:in `handle_socket_errors'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `new'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `block in connect'
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `block in catch'
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:106:in `timeout'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:144:in `connect'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/connection.rb:52:in `connect'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:531:in `connect'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:179:in `block in ensure_connected'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:115:in `block in connection'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/connection_pool-2.0.0/lib/connection_pool.rb:58:in `with'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:114:in `connection'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:177:in `ensure_connected'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:589:in `block in flush'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:617:in `block in logging'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.8/lib/active_support/notifications.rb:159:in `block in instrument'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/activesupport-4.0.8/lib/active_support/notifications.rb:159:in `instrument'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/instrumentable.rb:31:in `instrument'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:616:in `logging'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:587:in `flush'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:391:in `process'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/operation/read.rb:48:in `execute'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:648:in `read'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:90:in `command'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/node.rb:432:in `refresh'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:182:in `block in refresh'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:194:in `each'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/cluster.rb:194:in `refresh'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/read_preference/selectable.rb:70:in `rescue in with_retry'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/read_preference/selectable.rb:64:in `with_retry'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/read_preference/primary.rb:54:in `with_node'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/moped-2.0.0/lib/moped/query.rb:127:in `first'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:187:in `block in first_with_cache'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:135:in `with_cache'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb:186:in `first_with_cache'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:199:in `block (2 levels) in first'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:535:in `with_sorting'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:198:in `block in first'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:447:in `try_cache'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:197:in `first'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/contextual.rb:20:in `first'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/criteria/modifiable.rb:188:in `find_or'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/criteria/modifiable.rb:97:in `find_or_initialize_by'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/mongoid-4.0.0/lib/mongoid/findable.rb:15:in `find_or_initialize_by'
/apps/consyste/releases/20140818022851/app/workers/indexa_documento_worker.rb:15:in `perform'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/processor.rb:52:in `block (2 levels) in process'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:122:in `call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:122:in `block in invoke'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/sidekiq.rb:33:in `block in call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:364:in `perform_action_with_newrelic_trace'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/sidekiq.rb:29:in `call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:124:in `block in invoke'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:124:in `block in invoke'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/server/retry_jobs.rb:73:in `call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:124:in `block in invoke'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/logging.rb:22:in `with_context'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/server/logging.rb:7:in `call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:124:in `block in invoke'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:127:in `call'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/middleware/chain.rb:127:in `invoke'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/processor.rb:51:in `block in process'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/processor.rb:94:in `stats'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/sidekiq-3.2.2/lib/sidekiq/processor.rb:50:in `process'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:122:in `dispatch'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
/apps/consyste/shared/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'

@tobob
Copy link

tobob commented Aug 20, 2014

+1

1 similar comment
@iRonin
Copy link

iRonin commented Aug 20, 2014

+1

@jacquescrocker
Copy link

anyone find any good workaround to this? I'm still seeing thousands of these a day in production

@malconis
Copy link

@railsjedi, not sure if it'll be viable for you, but when we experienced it in our app we surrounded the problematic code with retry logic. Just had to swallow the exception and try again. With Rails we used the around filter and just marked which resource to apply. Since it seemed occurrences were arbitrary and the error didn't look like it happens in succession retrying once after a failure pretty much cleared this up. Though not as good as an actual fix for the issue.

@jacquescrocker
Copy link

i think the root of the problem is just timeouts. So the bug is just that it crashes on timeout instead of giving some sort of reasonable exception (Moped::Timeout or something?)

maybe a way to replicate this bug is to have a mongodb server that takes a couple seconds to respond to queries?

for my project, i switched my prod server to use a dumb hacked fork of moped 2.0 with the default timeouts set to much higher [redacted]

@slowdownitsfine
Copy link

Same issue here ...

TypeError: no implicit conversion of nil into String
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `block in initialize'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:119:in `handle_socket_errors'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection/socket/tcp.rb:20:in `initialize'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `new'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:145:in `block in connect'
  from .rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
  from .rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `block in catch'
  from .rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
  from .rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
  from .rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:106:in `timeout'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection/socket/connectable.rb:144:in `connect'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/connection.rb:52:in `connect'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/node.rb:531:in `connect'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/node.rb:179:in `block in ensure_connected'
  from .rvm/gems/ruby-2.1.2/gems/moped-2.0.0/lib/moped/node.rb:115:in `block in connection'... 34 levels...
  from .rvm/gems/ruby-2.1.2/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:199:in `block (2 levels) in first'
  from .rvm/gems/ruby-2.1.2/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:535:in `with_sorting'
  from .rvm/gems/ruby-2.1.2/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:198:in `block in first'
  from .rvm/gems/ruby-2.1.2/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:447:in `try_cache'
  from .rvm/gems/ruby-2.1.2/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:197:in `first'
  from .rvm/gems/ruby-2.1.2/gems/mongoid-4.0.0/lib/mongoid/contextual.rb:20:in `first'
  from .rvm/gems/ruby-2.1.2/gems/mongoid-4.0.0/lib/mongoid/findable.rb:107:in `find_by'

@parov
Copy link

parov commented Sep 10, 2014

+1

@sebastian-julius
Copy link

We're having the exact same issue. Our production systems are going nuts. I'm in touch with mongohq/compose and will let you know once I found out something.
Our workaround is to restart our heroku dynos every 12 hours... Great 👍

As it always occurs only after a while I guess there're some connections stalling around or so...

@frankdenbow
Copy link

+1

@cmertz
Copy link

cmertz commented Sep 11, 2014

anyone able to reproduce the error?

@leemhenson
Copy link

@sebastian-julius did you speak to compose? what did they say? I tried @railsjedi 's branch but we still got the same errors afterwards.

Anyone have any idea on how to go about setting up a repeatable test environment with which to investigate? It's ominously quiet on this issue and #308...

@sebastian-julius
Copy link

We do not see the timeout any more. Compose had some issues during that timeframe. They and we guess it had to do with that situation!

As it disappeared automagically it's fixed for us now.

@timsegraves
Copy link

Also started getting this error a couple hours after upgrading to 2.1.2. Seems to be timeout related but haven't been able to track anything down yet.

@fabiob
Copy link

fabiob commented Sep 17, 2014

I've installed a caching nameserver on my box ( http://unbound.net/ ), and the errors stopped.

So looks like it's a timeout issue with the DNS resolution.

IMHO, Moped should cache the resolved IP address of the mongo nodes, at least for a while. Less DNS resolution requests should also help improving the performance.

@fernandokosh
Copy link

I see the same error message with a new Rails App. I don't think is the same issue (right?), but can help
It not happens on 4.1.4

kosh@yuna:~/projects/test$ rails c
Loading development environment (Rails 4.1.6)
[1] pry(main)> 
[2] pry(main)> Sender.first
TypeError: no implicit conversion of Fixnum into String
from /home/kosh/.rvm/gems/ruby-2.1.2@msg-gate/gems/moped-2.0.0/lib/moped/protocol/commands/authenticate.rb:35:in `+'
[3] pry(main)>

@arthurnn
Copy link
Contributor

how does the mongoid yml config file look like? specially the host part?

@toothrot
Copy link

See also #275

@chrisckchang
Copy link

all, see pull request: #324 cc @arthurnn

@mhoran
Copy link

mhoran commented Oct 7, 2014

After 24 hours running #324 in production without a single "no implicit conversion of nil into String" error, I'd say we've found a solution to this problem.

@arthurnn
Copy link
Contributor

closing this as #324 was merged and it should solve this issue

@Elyasin
Copy link

Elyasin commented Feb 17, 2015

I am having this issue at this very moment.

Anybody else ?

@arthurnn
Copy link
Contributor

@Elyasin which version of moped are you using?
try using master and see if the error still persists.

@Elyasin
Copy link

Elyasin commented Feb 17, 2015

Thanks for the quick answer.
From the logs: Moped 2.0.3
I will try your suggestion, however this happens on Heroku. On my local machine I never had that issue.
If you need any information let me know. In the meantime I will try your suggestion.

I think I have the latest Moped. I tried using master, but no changes.

EDIT: I thought it was Moped's issue, but it was a red herring :-( Moped could not authenticate because I did not set the environment vars.

Sorry for having wasted your time @arthurnn

@arthurnn
Copy link
Contributor

Maybe moped should give a better error message when the authentication credentials are nil or empty.
If anyone is interested to send a PR with that, I am willing to take a look.
thanks

@mnaqvi78
Copy link

i am having this issue..
how can this be resolved

in open': no implicit conversion of nil into String (TypeError) from ex20a.rb:15:in

'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests