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

{setsockopt-reuseport}: Protocol not available: [(null)]:443 #122

Closed
jissereitsma opened this issue Sep 19, 2016 · 8 comments
Closed

{setsockopt-reuseport}: Protocol not available: [(null)]:443 #122

jissereitsma opened this issue Sep 19, 2016 · 8 comments

Comments

@jissereitsma
Copy link

jissereitsma commented Sep 19, 2016

I hope I'm not bugging you guys with this, but I'm trying to get Hitch working, but getting the following error {setsockopt-reuseport}: Protocol not available: [(null)]:443. To simplify things, I've narrowed it down to a simple start of Hitch using the following command: hitch --backend=[127.0.0.1]:80 --frontend=[127.0.0.1]:443+/var/lib/acme/live/example.com/haproxy (the certificate was generated using Acme). Replacing the host 127.0.0.1 with * or the external IP does not make a difference.

The error seems to suggest that the port is taken, but lsof -i TCP:443 returns no results.

Any idea what might cause this error?

I'm not a kernel developer, but I've read now the following somewhere: "Prior to Linux 3.9, only the option SO_REUSEADDR existed." The kernel I'm using is of version 2.6. Might it be that the latest source of Hitch only works with modern kernels?

@lkarsten
Copy link
Contributor

Hi. Thanks for reporting. There is no trouble, this is what this issue tracker is for.

Did you build from source? Which operating system and/or distribution is this?

@jissereitsma
Copy link
Author

Hi, thanks and great to hear! I'm using CentOS 6.8 (2.6.32.60xls-domU, x86_64) and used the RPM package hitch-1.3.1-1.el6.x86_64. The only trace I have so far is that the kernel might be missing an option reuseport (while reuseaddr exists). But upgrading the kernel to version 3 might not be an option for this server.

@lkarsten
Copy link
Contributor

lkarsten commented Sep 19, 2016

Hi. This sounds like a platform issue, where SO_REUSEPORT is defined but the kernel doesn't support it.

I don't think we actually require SO_REUSEPORT to be set, it is just an optimization.

If you rebuild from source you can just comment out the setsocketopt() lines that is failing, it is here:
https://github.com/varnish/hitch/blob/master/src/hitch.c#L1779 (UPDATED!)

We can perhaps add a autoconf test for reuseport to handle this more intelligently. What kind of system is this? Searching hints at a cpanel installation of sorts? Is this a legacy system?

@jissereitsma
Copy link
Author

I'll try to compile from source later. The system is just a plain CentOS 6.8 bare install, no control panel, just a manual install on top of a VPS.

@jissereitsma
Copy link
Author

I've compiled version 1.4 from source, and found the issue to be still there. Next I changed the source as described, and found the issue to be fixed. I've created a PR #123 which simply removes the lines, as a crazy lunatic. I'm not sure if the PR is sensible, but hey, it works for me.

lkarsten pushed a commit that referenced this issue Sep 26, 2016
On Centos 6.8 with 2.6.32.60xls-domU from issue #122, SO_REUSEPORT is
defined but setsockopt() fail.

Add a configure snippet that checks if setsockopt succeeds.

Changes taken from SO_RECVTIMEO checks in Varnish.

Tested on Debian stretch (detected working) and CentOS 5 (detected
non-working).

Fixes: #122

Ref: #123
@lkarsten
Copy link
Contributor

Hi.

I've added a build-time check on this now.

Can you perhaps try git master and see if it builds without your changes now?

@lkarsten lkarsten reopened this Sep 26, 2016
@jissereitsma
Copy link
Author

I've just checked and it works for me! Many thanks!

@lkarsten
Copy link
Contributor

Excellent! Thanks for testing it.

lkarsten pushed a commit that referenced this issue Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants