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

Error: "Protocol not available" #1509

Closed
Kixunil opened this issue May 7, 2018 · 12 comments
Closed

Error: "Protocol not available" #1509

Kixunil opened this issue May 7, 2018 · 12 comments
Labels
A-server Area: server. C-bug Category: bug. Something is wrong. This is bad!

Comments

@Kixunil
Copy link

Kixunil commented May 7, 2018

When trying to run the server:

let core = tokio_core::reactor::Core::new().unwrap();

// I tried both "127.0.0.1:8331", "0.0.0.0:8331" and even "[::1]:8331", also other ports
let addr = std::net::SocketAddr::new(config.bind_address, config.bind_port);
// ProxyHandle implements Service
let service = ProxyHandle(Rc::new(Proxy { config, client: HttpClient::new(&core.handle()), }));

let server = hyper::server::Http::new().bind(&addr, move || Ok(service.clone())).unwrap();
server.run().unwrap();

It panics with OS error "Protocol not available"

nc -l works, so I guess the problem is somewhere in hyper or its dependency.

@seanmonstar
Copy link
Member

Oh noes! What version of hyper are you using?

And when you say it panics, where? At one of the unwraps you have, or inside hyper?

@Kixunil
Copy link
Author

Kixunil commented May 7, 2018

The last one - 0.11.26

It panics on my unwrap - the one at the end of line: let server = hyper::server::Http::new().bind(&addr, move || Ok(service.clone())).unwrap();

@Kixunil
Copy link
Author

Kixunil commented May 7, 2018

FYI, I just rewrote the code to use tokio_core::net::TcpListener::bind(&addr, &handle).unwrap(); and hyper::server::Http::new().serve_incoming(listener.incoming().map(|(socket, _addr)| socket), move || Ok(service.clone())); and it works.

@sfackler
Copy link
Contributor

sfackler commented May 7, 2018

I've seen the "protocol unavailable" message once before myself but I can't remember what the context was unfortunately.

@seanmonstar
Copy link
Member

What OS is this happening on?

@Kixunil
Copy link
Author

Kixunil commented May 7, 2018

Linux Mint

@seanmonstar
Copy link
Member

Do you what version of the Linux kernel it is? 0.11.26 tries to set SO_REUSEPORT and SO_REUSEADDR, so that the newer run_threads can work. Looks like SO_REUSEPORT is only in Linux >=3.9?

@asonix
Copy link

asonix commented May 7, 2018

mint should definitely be at least 3.9, unless that's a really old install.

I was on 3.12 in 2013 on elementary OS (another ubuntu derivative)

@Kixunil
Copy link
Author

Kixunil commented May 7, 2018

3.2.0-48-generic

(Yes, it is old install.)

seanmonstar added a commit that referenced this issue May 8, 2018
@seanmonstar
Copy link
Member

So, I think 2c48101 will fix this, if you want to try it out before I just publish a new version assuming it fixes it :)

@Kixunil
Copy link
Author

Kixunil commented May 9, 2018

I plan to try it. Thank you for quick response!

@seanmonstar seanmonstar added A-server Area: server. C-bug Category: bug. Something is wrong. This is bad! labels May 10, 2018
@seanmonstar
Copy link
Member

I've published v0.11.27 with the fix mentioned here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-server Area: server. C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

No branches or pull requests

4 participants