SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
805 stars 171 forks source link

Socket Exception when starting the server #145

Closed ymchandra closed 8 years ago

ymchandra commented 8 years ago

06:15:11.768 [main] ERROR org.restheart.Bootstrapper - Error starting RESTHeart. Exiting... java.lang.RuntimeException: java.net.SocketException: Permission denied at io.undertow.Undertow.start(Undertow.java:186) at org.restheart.Bootstrapper.startCoreSystem(Bootstrapper.java:570) at org.restheart.Bootstrapper.startServer(Bootstrapper.java:360) at org.restheart.Bootstrapper.main(Bootstrapper.java:137) Caused by: java.net.SocketException: Permission denied at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:190) at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:243) at io.undertow.Undertow.start(Undertow.java:142) ... 3 common frames omitted

Its better if we have exception message and the source of exception etc..

mkjsix commented 8 years ago

Which version of RESTHeart is it?

ymchandra commented 8 years ago

Its the latest version and am deploying it to Openshift. On my local machine it is working fine.

mkjsix commented 8 years ago

There are several permission-related things to check for Openshift: it could be its java.policy file or other things. AFAIK, you need to be root to bind under port 1024 on Openshift. I suggest to search for "java.net.SocketException: Permission denied" and "openshift", I've already found similar issues for other Java web apps.

ymchandra commented 8 years ago

I don't think that we can get root access on Openshift. How did you solve that problem?

mkjsix commented 8 years ago

This is a specific Openshift's question and it should be addressed to their community. However I have found this: https://access.redhat.com/documentation/en-US/OpenShift_Online/2.0/html/User_Guide/sect-Binding_Applications_to_Ports.html

Nothing we can do on our side, anyway.

mkjsix commented 8 years ago

Additionally, have a look this: https://developers.openshift.com/managing-your-applications/port-binding-routing.html

My understanding is that if your app binds to port 8080 then the apache reverse proxy will route here from its port 80.

mkjsix commented 8 years ago

I'm closing this issue now as it's not directly related to RESTHeart.