Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP::Server stopped working for me since 0.20.3 #3812

Closed
ctxcode opened this issue Jan 1, 2017 · 4 comments · Fixed by #3818
Closed

HTTP::Server stopped working for me since 0.20.3 #3812

ctxcode opened this issue Jan 1, 2017 · 4 comments · Fixed by #3818

Comments

@ctxcode
Copy link

ctxcode commented Jan 1, 2017

Error:

setsockopt: Invalid argument (Errno)
0x473aa7: *CallStack::unwind:Array(Pointer(Void)) at ??
0x473a3a: *CallStack#initialize:Array(Pointer(Void)) at ??
0x473a0a: *CallStack::new:CallStack at ??
0x46aa0e: *raise<Errno>:NoReturn at ??
0x52f92e: *TCPServer at ??
0x52f893: *TCPServer at ??
0x52f825: *TCPServer at ??
0x52f951: *TCPServer at ??
0x52e3d8: *TCPServer#initialize<String, Int32, Int32, Nil>:Nil at ??
0x52db41: *TCPServer#initialize<String, Int32>:Nil at ??
0x52daf3: *TCPServer::new<String, Int32>:TCPServer at ??
0x525eec: *HTTP::Server#bind:TCPServer at ??
0x525e1a: *HTTP::Server#listen:Nil at ??
0x4600a5: ??? at ??
0x46e249: main at ??
0x7fce6d601f45: __libc_start_main at ??
0x45f7a9: ??? at ??
0x0: ??? at ??

Any idea why? I'm using "Bash on Ubuntu on Windows", i used the basic example from the website. It used to work on previous versions.
( Sidenote: Compile time improved alot! 👍 )

@ysbaddaden
Copy link
Contributor

What platform are you using? If Linux, which kernel version?

Maybe we should rescue self.reuse_port = true since it may fail on some platforms.

@ctxcode
Copy link
Author

ctxcode commented Jan 1, 2017

Ubuntu 14.04.5 LTS
Linux version 3.4.0-Microsoft (Microsoft@Microsoft.com) (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Wed Dec 31 14:42:53 PST 2014

@ysbaddaden
Copy link
Contributor

Bingo. SO_REUSEPORT is only available in Linux 3.9 and onwards. I'll patch this.

@Svenskunganka
Copy link

I am able to reproduce this issue on a 4.4 kernel on WSL:

Linux version 4.4.0-43-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014

Disabling reuseport works as expected. More info here: microsoft/WSL#1419
I don't think there's anything we can do about it, but just thought I'd add this here for any future users that has the same issue. If you're using Amber for example, you can disable it for your dev environment by adding port_reuse: false to config/environments/development.yml, which will keep it enabled for when you deploy but disabled during development.

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

Successfully merging a pull request may close this issue.

4 participants