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

Listening Address on Linux not working #1173

Closed
jpylypiw opened this issue Jun 5, 2020 · 1 comment · Fixed by #1174
Closed

Listening Address on Linux not working #1173

jpylypiw opened this issue Jun 5, 2020 · 1 comment · Fixed by #1174
Assignees
Labels
bug Something isn't working

Comments

@jpylypiw
Copy link

jpylypiw commented Jun 5, 2020

At first I want to thank all evelopers for that huge effort you have spent into this software!

Issue description

I have installed scm-server on Debian Linux and it is running fine. Lately I wanted to use the server behind a Apache2 Reverse-Proxy to increase the performance and caching.

To achieve this I configured the following in /etc/default/scm-server:

...
# scm-server host interface
HOST=127.0.0.1

# scm-server port
PORT=8080
...

after restarting the daemon my systemctl status scm-manager got the following output:

... 
Process: 53190 ExecStart=/opt/scm-server/bin/scm-server start (code=exited, status=0/SUCCESS)
 Main PID: 53197 (jsvc-linux-x86_)
    Tasks: 28 (limit: 2326)
   Memory: 354.7M
   CGroup: /system.slice/scm-server.service
           ├─53197 jsvc.exec -cp :/opt/scm-server/conf:/opt/scm-server/lib/* -Djava.awt.headless=true -Dlogback.configurationFile=logging.xml -Xms1g -Xmx1g -Djetty.host=127.0.0.1 -Djetty.port=8080 -user scm -outfile /var/log/scm/scm-server.out -errfile /var/log/scm/scm-server.err -pidfile /var/run/scm/scm.pid -jvm server -home /usr/lib/jvm/java-11-openjdk-amd64 -Dapp.name=scm
           └─53198 jsvc.exec -cp :/opt/scm-server/conf:/opt/scm-server/lib/* -Djava.awt.headless=true -Dlogback.configurationFile=logging.xml -Xms1g -Xmx1g -Djetty.host=127.0.0.1 -Djetty.port=8080 -user scm -outfile /var/log/scm/scm-server.out -errfile /var/log/scm/scm-server.err -pidfile /var/run/scm/scm.pid -jvm server -home /usr/lib/jvm/java-11-openjdk-amd64 -Dapp.name=scm

...

The port and host seems fine in the process arguments.

Nevertheless the daemon is listening on all interfaces as netstat -lntp says:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
...
tcp6       0      0 :::8080                 :::*                    LISTEN      53198/jsvc.exec
...

Do you have any idea how to fix that?

My current workaround is a iptables DROP rule for outgoing traffic on 8080, but this is not a long-term solution.

Bug Report

Describe how to reproduce the bug

see description above

Describe your SCM-Manager setup

I set up scm-manager today and have installed the following non-default plugins:

  • Pushlog
  • LDAP
    *Path Write Protection

Which operating system, browser and versions do you use?

Server:
Linux hostname 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 GNU/Linux

Client:
Google Chrome
Version 83.0.4103.61 (Official Build) (64-Bit)

Log of the bug

Output of /var/log/scm/scm-server.err

2020-06-05 17:23:17.223:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@3434a4f0{SCM-Manager 2.0.0,/scm,file:///var/cache/scm/work/webapp/webapp/,AVAILABLE}{/opt/scm-server/var/webapp/scm-webapp.war}
2020-06-05 17:23:17.233:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2020-06-05 17:23:17.235:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@4b325930{/,[file:///opt/scm-server/var/webapp/docroot/],AVAILABLE}
2020-06-05 17:23:17.278:INFO:oejs.AbstractConnector:main: Started ServerConnector@3abbfa04{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2020-06-05 17:23:17.280:INFO:oejs.Server:main: Started @7796ms

Further information like screenshots

none

@sdorra sdorra self-assigned this Jun 7, 2020
@sdorra sdorra added the bug Something isn't working label Jun 7, 2020
@pfeuffer
Copy link
Member

pfeuffer commented Jun 8, 2020

Thank you for this report. My colleague fixed this for the next version to come. In the meantime, you can fix it for your installation by editing /etc/scm/server-config.xml: Around line 60 there should be an xml part where the port is set. Add a similar part for the host so that the whole Call looks like this:

  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.server.ServerConnector">
        <Arg name="server">
          <Ref refid="ScmServer" />
        </Arg>
        <Arg name="factories">
          <Array type="org.eclipse.jetty.server.ConnectionFactory">
            <Item>
              <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                <Arg name="config">
                  <Ref refid="httpConfig" />
                </Arg>
              </New>
            </Item>
          </Array>
        </Arg>
        <Set name="host">
          <SystemProperty name="jetty.host" default="0.0.0.0" />
        </Set>
        <Set name="port">
          <SystemProperty name="jetty.port" default="8080" />
        </Set>
      </New>
    </Arg>
  </Call>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants