Skip to content

Rails server spams log due to getsockopt(2) TCP_INFO ENOPROTOPT #1982

@ArsalanDotMe

Description

@ArsalanDotMe

Microsoft Windows [Version 10.0.15063]

Clean installed rails 5.0.2 on Ruby 2.4.0 through rebenv 1.1.0-2-g4f8925a.
Went into a directory owned by Windows. Created a new project and started the server with rails s. The command was extremely slow to start and once it showed the following output, I made a simple GET request to localhost:3000.

/home/arsalan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /home/arsalan/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.1 (ruby 2.4.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

On making the GET request, the following error showed up.

2017-04-22 11:40:02 +0500: Read error: #<Errno::ENOPROTOOPT: Protocol not available - getsockopt(2)>
/home/arsalan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.1/lib/puma/server.rb:124:in `getsockopt'
/home/arsalan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.1/lib/puma/server.rb:124:in `closed_socket?'
/home/arsalan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.1/lib/puma/server.rb:563:in `handle_request'
/home/arsalan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.1/lib/puma/server.rb:425:in `process_client'
/home/arsalan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.1/lib/puma/server.rb:289:in `block in run'
/home/arsalan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.1/lib/puma/thread_pool.rb:120:in `block in spawn_thread'

I don't know if strace of this command will be useful as it keeps continuously spitting out lines at the speed of light. Never exits.

The relevant error-throwing line from puma seems to be

socket.getsockopt(Socket::SOL_TCP, Socket::TCP_INFO)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions