Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3926

EOFError: end of file reached

    • Type: Icon: Task Task
    • Resolution: Done
    • 5.0.0
    • Affects Version/s: None
    • Component/s: None
    • None

      I'm getting EOFError: end of file reached
      I suspect it is related to MONGOID-92, MONGOID-2377 and threads but I'm using Mongoid with Sneakers not Passenger and have been unable to take insights from those issues.

      I've move Mongoid configuration into post fork code, which appears to have solved Moped::Errors::OperationFailure with nil error that I was getting but the EOFError has persisted

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      Stacktrace (most recent call first):
      
        bson/hash.rb:77:in `readbyte'
          while (type = bson.readbyte.chr) != NULL_BYTE
        bson/hash.rb:77:in `from_bson'
          while (type = bson.readbyte.chr) != NULL_BYTE
        moped/connection.rb:133:in `block (2 levels) in read'
          ::BSON::Document.from_bson(buffer)
        moped/connection.rb:132:in `times'
          reply.documents = reply.count.times.map do
        moped/connection.rb:132:in `each'
          reply.documents = reply.count.times.map do
        moped/connection.rb:132:in `map'
          reply.documents = reply.count.times.map do
        moped/connection.rb:132:in `block in read'
          reply.documents = reply.count.times.map do
        moped/connection.rb:224:in `with_connection'
          yield @sock
        moped/connection.rb:114:in `read'
          with_connection do |socket|
        moped/protocol/query.rb:213:in `receive_replies'
          connection.read
        moped/connection.rb:152:in `block in receive_replies'
          operation.receive_replies(self)
        moped/connection.rb:151:in `map'
          operations.map do |operation|
        moped/connection.rb:151:in `receive_replies'
          operations.map do |operation|
        moped/node.rb:591:in `block (2 levels) in flush'
          replies = conn.receive_replies(operations)
        moped/node.rb:181:in `block in ensure_connected'
          yield(conn)
        moped/node.rb:115:in `block in connection'
          yield(conn)
        connection_pool.rb:58:in `with'
          yield conn
        moped/node.rb:114:in `connection'
          pool.with do |conn|
        moped/node.rb:177:in `ensure_connected'
          connection do |conn|
        moped/node.rb:589:in `block in flush'
          ensure_connected do |conn|
        moped/node.rb:617:in `block in logging'
          yield if block_given?
        active_support/notifications.rb:159:in `block in instrument'
          instrumenter.instrument(name, payload) { yield payload if block_given? }
        active_support/notifications/instrumenter.rb:20:in `instrument'
          yield payload
        active_support/notifications.rb:159:in `instrument'
          instrumenter.instrument(name, payload) { yield payload if block_given? }
        moped/instrumentable.rb:31:in `instrument'
          instrumenter.instrument(name, payload, &block)
        moped/node.rb:616:in `logging'
          instrument(TOPIC, prefix: "  MOPED: #{address.resolved}", ops: operations) do
        newrelic_moped/instrumentation.rb:40:in `block in logging_with_newrelic_trace'
          command = Proc.new { logging_without_newrelic_trace(operations, &blk) }
        newrelic_moped/instrumentation.rb:49:in `call'
          res = command.call
        newrelic_moped/instrumentation.rb:49:in `block in logging_with_newrelic_trace'
          res = command.call
        new_relic/agent/method_tracer.rb:281:in `trace_execution_scoped'
          result = yield
        newrelic_moped/instrumentation.rb:46:in `logging_with_newrelic_trace'
          self.class.trace_execution_scoped(metrics) do
        moped/node.rb:587:in `flush'
          logging(operations) do
        moped/node.rb:391:in `process'
          flush([[ operation, callback ]])
        moped/operation/read.rb:48:in `execute'
          node.process(operation) do |reply|
        moped/node.rb:648:in `read'
          Operation::Read.new(operation).execute(self)
        moped/node.rb:411:in `query'
          read(Protocol::Query.new(database, collection, selector, options))
        moped/query.rb:128:in `block in first'
          node.query(
        moped/cluster.rb:249:in `block in with_primary'
          return yield(node)
        moped/node.rb:204:in `block in ensure_primary'
          yield(self)
        moped/executable.rb:25:in `execute'
          yield(self)
        moped/node.rb:203:in `ensure_primary'
          execute(:ensure_primary) do
        moped/cluster.rb:248:in `with_primary'
          node.ensure_primary do
        moped/read_preference/primary.rb:55:in `block in with_node'
          cluster.with_primary(&block)
        moped/read_preference/selectable.rb:65:in `call'
          block.call
        moped/read_preference/selectable.rb:65:in `with_retry'
          block.call
        moped/read_preference/primary.rb:54:in `with_node'
          with_retry(cluster) do
        moped/query.rb:127:in `first'
          reply = read_preference.with_node(cluster) do |node|
        mongoid/query_cache.rb:187:in `block in first_with_cache'
          first_without_cache
        mongoid/query_cache.rb:135:in `with_cache'
          return yield unless QueryCache.enabled?
        mongoid/query_cache.rb:186:in `first_with_cache'
          with_cache(:first) do
        new_relic/agent/instrumentation/sinatra.rb:151:in `dispatch_and_notice_errors_with_newrelic'
          dispatch_without_newrelic
        new_relic/agent/instrumentation/sinatra.rb:146:in `block in dispatch_with_newrelic'
          dispatch_and_notice_errors_with_newrelic
        new_relic/agent/instrumentation/controller_instrumentation.rb:335:in `perform_action_with_newrelic_trace'
          yield
        new_relic/agent/instrumentation/sinatra.rb:143:in `dispatch_with_newrelic'
          perform_action_with_newrelic_trace(:category => :sinatra,
        sinatra/base.rb:898:in `block in call!'
          invoke { dispatch! }
        sinatra/base.rb:1058:in `block in invoke'
          res = catch(:halt) { yield }
        sinatra/base.rb:1058:in `catch'
          res = catch(:halt) { yield }
        sinatra/base.rb:1058:in `invoke'
          res = catch(:halt) { yield }
        sinatra/base.rb:898:in `call!'
          invoke { dispatch! }
        sinatra/base.rb:886:in `call'
          dup.call!(env)
        new_relic/rack/error_collector.rb:55:in `call'
          @app.call(env)
        new_relic/rack/browser_monitoring.rb:27:in `call'
          result = @app.call(env)   # [status, headers, response]
        new_relic/rack/agent_hooks.rb:32:in `call'
          result = @app.call(env)
        rack/protection/xss_header.rb:18:in `call'
          status, headers, body = @app.call(env)
        rack/protection/path_traversal.rb:16:in `call'
          app.call env
        rack/protection/json_csrf.rb:18:in `call'
          status, headers, body = app.call(env)
        rack/protection/base.rb:49:in `call'
          result or app.call(env)
        rack/protection/base.rb:49:in `call'
          result or app.call(env)
        rack/protection/frame_options.rb:31:in `call'
          status, headers, body        = @app.call(env)
        rack/nulllogger.rb:9:in `call'
          @app.call(env)
        rack/head.rb:11:in `call'
          status, headers, body = @app.call(env)
        sinatra/base.rb:180:in `call'
          result, callback = app.call(env), env['async.callback']
        sinatra/base.rb:2014:in `call'
          @stack.call(env)
        sinatra/base.rb:1478:in `block in call'
          synchronize { prototype.call(env) }
        sinatra/base.rb:1788:in `synchronize'
          yield
        sinatra/base.rb:1478:in `call'
          synchronize { prototype.call(env) }
        rack/urlmap.rb:65:in `block in call'
          return app.call(env)
        rack/urlmap.rb:50:in `each'
          @mapping.each do |host, location, match, app|
        rack/urlmap.rb:50:in `call'
          @mapping.each do |host, location, match, app|
        librato/rack.rb:94:in `process_request'
          response = @app.call(env)
        trakio/api/librato_middleware.rb:28:in `call'
          response, duration = process_request(env)
        new_relic/rack/error_collector.rb:55:in `call'
          @app.call(env)
        new_relic/rack/agent_hooks.rb:32:in `call'
          result = @app.call(env)
        raven/integrations/rack.rb:61:in `call'
          response = @app.call(env)
        trakio/api/consumer/worker.rb:73:in `work'
          self.class.api_application.call(env)
        sneakers/worker.rb:58:in `block (3 levels) in do_work'
          res = work(msg)
        sneakers/metrics/null_metrics.rb:8:in `call'
          block.call
        sneakers/metrics/null_metrics.rb:8:in `timing'
          block.call
        sneakers/worker.rb:54:in `block (2 levels) in do_work'
          metrics.timing("work.#{self.class.name}.time") do
        timeout.rb:91:in `block in timeout'
          return yield(sec)
        timeout.rb:35:in `block in catch'
          ::Kernel.catch(exc) {yield exc}
        timeout.rb:35:in `catch'
          ::Kernel.catch(exc) {yield exc}
        timeout.rb:35:in `catch'
          ::Kernel.catch(exc) {yield exc}
        timeout.rb:106:in `timeout'
          bt = ExitException.catch(message, &bl)
        sneakers/worker.rb:53:in `block in do_work'
          Timeout.timeout(@timeout_after) do
        thread/pool.rb:56:in `call'
          @block.call(*@arguments)
        thread/pool.rb:56:in `execute'
          @block.call(*@arguments)
        thread/pool.rb:384:in `block (2 levels) in spawn_thread'
          task.execute(thread)
        thread/pool.rb:351:in `loop'
          loop do
        thread/pool.rb:351:in `block in spawn_thread'
          loop do
      

      `

            Assignee:
            Unassigned Unassigned
            Reporter:
            msaspence Matthew Spence
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: