go trunk: permission denied

137 views
Skip to first unread message

Tamas Papp

unread,
May 6, 2013, 3:12:24 PM5/6/13
to git...@googlegroups.com
hi All,

$ /usr/bin/java -server -Xmx1024M -Djava.awt.headless=true -jar gitblit.jar --baseFolder /data/gitblit
INFO ***********************************************************
INFO _____ _ _ _ _ _ _
INFO | __ \(_)| | | | | |(_)| |
INFO | | \/ _ | |_ | |__ | | _ | |_
INFO | | __ | || __|| '_ \ | || || __|
INFO | |_\ \| || |_ | |_) || || || |_
INFO \____/|_| \__||_.__/ |_||_| \__|
INFO Gitblit v1.3.0-SNAPSHOT
INFO
INFO ***********************************************************
INFO Running on Linux (3.8.0-16-generic)
INFO Setting up SocketConnector on port 50
INFO Using JCE Unlimited Strength Jurisdiction Policy files
INFO allowing SSL renegotiation on Java 1.7.0_21
INFO certificate alias = localhost
INFO keyStorePath = /data/gitblit/serverKeyStore.jks
INFO trustStorePath = /data/gitblit/serverTrustStore.jks
INFO crlPath = /data/gitblit/certs/caRevocationList.crl
INFO Setting up NIO SslSocketConnector on port 8443
INFO Gitblit base folder = /data/gitblit
INFO Git repositories folder = /data/gitblit/git
INFO Gitblit settings = /data/gitblit/gitblit.properties
INFO Identifying available repositories...
INFO 0 repositories identified with calculated folder sizes in 6 msecs
INFO JVM timezone is Europe/Budapest (CEST +0200)
INFO Gitblit timezone is Europe/Budapest (CEST +0200)
INFO Setting up user service GitblitUserService
INFO GUS delegating to ConfigUserService(/data/gitblit/users.conf)
INFO Mail executor is scheduled to process the message queue every 2 minutes.
INFO Lucene executor is scheduled to process indexed branches every 2 minutes.
WARN Federation passphrase is blank! This server can not be PULLED from.
INFO Shutdown Monitor listening on port 8081
INFO jetty-7.6.8.v20121106
INFO Extract jar:file:/data/apps/gitblit/2013-05-05/gitblit.jar!/ to /data/gitblit/temp/webapp
INFO NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
INFO started
o.e.j.w.WebAppContext{/,file:/data/gitblit/temp/webapp/},file:/data/apps/gitblit/2013-05-05/gitblit.jar
INFO [GitBlitWebApp] init: Wicket core library initializer
INFO [GitBlitWebApp] init: Wicket extensions initializer
INFO [GitBlitWebApp] Started Wicket version 1.4.21 in deployment mode
WARN FAILED SocketC...@0.0.0.0:50: java.net.BindException: Permission denied
java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:181)
at org.eclipse.jetty.server.bio.SocketConnector.newServerSocket(SocketConnector.java:96)
at org.eclipse.jetty.server.bio.SocketConnector.open(SocketConnector.java:85)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:286)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.gitblit.GitBlitServer.start(GitBlitServer.java:396)
at com.gitblit.GitBlitServer.main(GitBlitServer.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.moxie.MxLauncher.main(MxLauncher.java:129)
INFO Enabled Protocols [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2] of [SSLv2Hello, SSLv3, TLSv1,
TLSv1.1, TLSv1.2]
INFO Started SslSocket...@0.0.0.0:8443
WARN FAILED org.eclipse.jetty.server.Server@1bc119d5: java.net.BindException: Permission denied
java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:181)
at org.eclipse.jetty.server.bio.SocketConnector.newServerSocket(SocketConnector.java:96)
at org.eclipse.jetty.server.bio.SocketConnector.open(SocketConnector.java:85)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:286)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.gitblit.GitBlitServer.start(GitBlitServer.java:396)
at com.gitblit.GitBlitServer.main(GitBlitServer.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.moxie.MxLauncher.main(MxLauncher.java:129)
java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:181)
at org.eclipse.jetty.server.bio.SocketConnector.newServerSocket(SocketConnector.java:96)
at org.eclipse.jetty.server.bio.SocketConnector.open(SocketConnector.java:85)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:156)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:286)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.gitblit.GitBlitServer.start(GitBlitServer.java:396)
at com.gitblit.GitBlitServer.main(GitBlitServer.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.moxie.MxLauncher.main(MxLauncher.java:129)


I tested and v1.2.1 works fine, so I think it's a bug.

Additionally, is there a official way to configure logging for go version?


Thank you,
tamas

James Moger

unread,
May 6, 2013, 3:18:21 PM5/6/13
to git...@googlegroups.com
Port 50 on a nix box requires root permissions.  Are you launching as root?

You are also listening on all interfaces (0.0.0.0).  Do you possibly have another server listening on those ports?  Perhaps a second copy of Gitblit using the same port configuration?

Logging...
java -Dlog4j.configuration=file:///home/james/log4j.properties -jar gitblit.jar <optional_gitblit_args>

Current defaults...
https://demo-gitblit.rhcloud.com/blob/gitblit.git/HEAD/src!main!java!log4j.properties

​-J

Tamas Papp

unread,
May 6, 2013, 4:02:37 PM5/6/13
to git...@googlegroups.com
On 05/06/2013 09:18 PM, James Moger wrote:
> Port 50 on a nix box requires root permissions. Are you launching as root?

No.
And yes, I wanted to ask you about this. What is this and how can I disable it?

> You are also listening on all interfaces (0.0.0.0). Do you possibly have another server listening
> on those ports? Perhaps a second copy of Gitblit using the same port configuration?


No, there are nothing.
Does it works for you fine?

> |java -Dlog4j.configuration=file:///home/james/log4j.properties -jar gitblit.jar <optional_gitblit_args>|

I setup properly(?), but doesn't log anything.

This is the command:

java -server -Xmx1024M java -Dlog4j.configuration=file:///data/gitblit/log4j.properties
-Djava.awt.headless=true -jar gitblit.jar --baseFolder /data/gitblit

tamas

James Moger

unread,
May 6, 2013, 4:10:00 PM5/6/13
to git...@googlegroups.com
​I don't think you can disable the root permissions requirement for port < 1024.
But I'm not a sysadmin, perhaps there is a way.

Serving > 1024 (e.g. 8443) works fine for me with normal accounts.

Log4j.  Your command-line looks right.

-J

-J

Tamas Papp

unread,
May 6, 2013, 4:13:14 PM5/6/13
to git...@googlegroups.com
On 05/06/2013 10:10 PM, James Moger wrote:
> I don't think you can disable the root permissions requirement for port < 1024.

I mean, what it wants to bind to 50/tcp? What service is that?

> But I'm not a sysadmin, perhaps there is a way.

Well, there are, but they all are some kind of hacks.

> Serving > 1024 (e.g. 8443) works fine for me with normal accounts.
>
> Log4j. Your command-line looks right.


So the main question is, that it works fine for you? As I said, v1.2.1 is just OK with the same
configuration.


10x
tamas

James Moger

unread,
May 6, 2013, 4:46:03 PM5/6/13
to git...@googlegroups.com
On Mon, May 6, 2013 at 4:13 PM, Tamas Papp <tom...@martos.bme.hu> wrote:
On 05/06/2013 10:10 PM, James Moger wrote:
I don't think you can disable the root permissions requirement for port < 1024.

I mean, what it wants to bind to 50/tcp? What service is that?


According to your log, you are trying to start the http connector on port 50.
 


So the main question is, that it works fine for you? As I said, v1.2.1 is just OK with the same configuration.


It's been a while since I overrode the log4j properties.  I will check that.

I don't know why 1.3.0-SNAPSHOT is causing trouble where 1.2.1 is fine.
I'll put it on the list to review.

-J

Tamas Papp

unread,
May 6, 2013, 5:33:49 PM5/6/13
to git...@googlegroups.com
On 05/06/2013 10:46 PM, James Moger wrote:
>
> According to your log, you are trying to start the http connector on port 50.

It's value is 8080.

If I set it to 0, the server starts successfully.
If httpsPort is 8443, it also fine.

So httpsPort = 8080, httpPort = 8443:

WARN FAILED SelectChannelConnector@0:50: java.net.SocketException: Permission denied
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:344)
at sun.nio.ch.Net.bind(Net.java:336)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:286)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.gitblit.GitBlitServer.start(GitBlitServer.java:396)
at com.gitblit.GitBlitServer.main(GitBlitServer.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.moxie.MxLauncher.main(MxLauncher.java:129)
INFO Enabled Protocols [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2] of [SSLv2Hello, SSLv3, TLSv1,
TLSv1.1, TLSv1.2]
INFO Started SslSelectCha...@0.0.0.0:8443
WARN FAILED org.eclipse.jetty.server.Server@46b3e75d: java.net.SocketException: Permission denied
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:344)
at sun.nio.ch.Net.bind(Net.java:336)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:286)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.gitblit.GitBlitServer.start(GitBlitServer.java:396)
at com.gitblit.GitBlitServer.main(GitBlitServer.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.moxie.MxLauncher.main(MxLauncher.java:129)
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:344)
at sun.nio.ch.Net.bind(Net.java:336)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.Server.doStart(Server.java:286)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.gitblit.GitBlitServer.start(GitBlitServer.java:396)
at com.gitblit.GitBlitServer.main(GitBlitServer.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.moxie.MxLauncher.main(MxLauncher.java:129)

httpPort = 0, httpsPort = 8443:


INFO Enabled Protocols [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2] of [SSLv2Hello, SSLv3, TLSv1,
TLSv1.1, TLSv1.2]
INFO Started SslSelectCha...@0.0.0.0:8443


> The default port for this is 0, which is disabled.
>
> https://demo-gitblit.rhcloud.com/blob/gitblit.git/8c92559a483cf0b01b33d926421ec17605b5ff75/src!main!distrib!data!gitblit.properties#L1278
>
>
>
> So the main question is, that it works fine for you? As I said, v1.2.1 is just OK with the same
> configuration.
>
>
> It's been a while since I overrode the log4j properties. I will check that.
>
> I don't know why 1.3.0-SNAPSHOT is causing trouble where 1.2.1 is fine.
> I'll put it on the list to review.

I mean not logging, but go version compiled from trunk. Does it work for you (in linux?).
I not, I'll try to track this down, since I'm pretty sure, it was OK a couple of days ago.


Thanks,
tamas

James Moger

unread,
May 6, 2013, 11:26:34 PM5/6/13
to git...@googlegroups.com
Found the bug.  You mentioning that it worked a few days ago and the number 50 helped jog my memory.

-J

Tamas Papp

unread,
May 7, 2013, 4:41:54 AM5/7/13
to git...@googlegroups.com
On 05/07/2013 05:26 AM, James Moger wrote:
> Found the bug. You mentioning that it worked a few days ago and the number 50 helped jog my memory.

Tested and perfect.

Thank you,
tamas

Reply all
Reply to author
Forward
0 new messages