ERROR Errno::ECONNRESET: Connection reset by peer
Asked Answered
G

3

20
gem 'rails', '3.0.0'
gem 'devise'
gem 'bson_ext', '>= 1.0.7'
gem 'bson', '>= 1.0.7'
gem 'mongo_mapper', :branch => 'rails3', :git => 'http://github.com/jnunemaker/mongomapper.git'
gem 'devise-mongo_mapper', :git => 'git://github.com/collectiveidea/devise-mongo_mapper'

With the above setup I get the following errors on requests:

Started GET "/users/sign_out" for 127.0.0.1 at 2010-09-27 13:16:30 +0300
  Processing by Devise::SessionsController#destroy as HTML
Redirected to http://localhost:3000/
Completed 302 Found in 19ms
[2010-09-27 13:16:31] ERROR Errno::ECONNRESET: Connection reset by peer
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `eof?'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `run'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'


Started GET "/users/edit" for 127.0.0.1 at 2010-09-27 13:16:35 +0300
  Processing by Devise::RegistrationsController#edit as HTML
Completed   in 16ms
[2010-09-27 13:16:35] ERROR Errno::ECONNRESET: Connection reset by peer
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `eof?'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `run'
    /usr/local/ruby/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

The user model:

class User
  include MongoMapper::Document
  plugin MongoMapper::Devise
  devise :registerable, :database_authenticatable, :recoverable
end

Ideas?

Gasket answered 27/9, 2010 at 10:23 Comment(1)
What's in the view? Is it the standard devise view or have you customized it?Cartload
M
4

My quick guess is this looks like you have a problem with your sessions and protect_from_forgery is kicking in.

I had a similar problem and smashed my head against the wall for a few days, it turned out to be I was assigning an entire object to a session object instead of just the id. A quick note, non-GET requests are the ones that trigger the protect_from_forgery.

Mcarthur answered 3/2, 2012 at 6:38 Comment(1)
I just migrated an application from OpenShift 2 to OpenShift 3 and now I'm getting this. I suspect the issue may be what you describe, but my session[:...] assignments look fine. Could it be anything else that I may grep for?Jardena
L
15

WebRick has been replaced with Thin.

Doing the following worked for me:

Gemfile:

gem 'thin' 

Now do bundle install

Lawman answered 26/12, 2014 at 7:19 Comment(0)
M
4

My quick guess is this looks like you have a problem with your sessions and protect_from_forgery is kicking in.

I had a similar problem and smashed my head against the wall for a few days, it turned out to be I was assigning an entire object to a session object instead of just the id. A quick note, non-GET requests are the ones that trigger the protect_from_forgery.

Mcarthur answered 3/2, 2012 at 6:38 Comment(1)
I just migrated an application from OpenShift 2 to OpenShift 3 and now I'm getting this. I suspect the issue may be what you describe, but my session[:...] assignments look fine. Could it be anything else that I may grep for?Jardena
C
0

Adding this to my development.rb file fixed the issue.

 config.assets.raise_runtime_errors = true
  config.web_console.whitelisted_ips = replace_this_with_the_public_ip
Caricature answered 25/3, 2017 at 17:8 Comment(2)
I still get this issue whenever I try to load redmine from the browser. I am not sure what is missing. I usded thin, there is no error, but the page is not loading.Horotelic
In my case the problem was a corrupted svg image that could not be loaded. Replacing the file fixed the issue.Costumier

© 2022 - 2024 — McMap. All rights reserved.