0

In brief: Is there a way of configuring all Ports used by management-agent.jar (introduced in SonarQube 5.5) or even disabling it?

More Info: I'm trying to run SonarQube on OpenShift (again), this time version 5.5/5.6. On startup I get the following error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 0; nested exception is: java.net.BindException: Permission denied.

What I found out so far is that

In addition to setting the ports explicitly to the allowed range on OpenShift (ports 15000-35530), I tried the -XX:+DisableAttachMechanism option with no luck.

Any ideas how to work around that? Can SonarQube work without the agent?

How to reproduce: Create an OpenShift app from this, then change the SONAR_VERSION to 5.5 or 5.6 in .openshift/action_hooks/build

Full Stacktrace

2016.06.02 16:09:34 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[es]: java -Djava.awt.headless=true -javaagent:jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 0; nested exception is: 
    java.net.BindException: Permission denied
Exception in thread "main" java.lang.reflect.InvocationTargetException
    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:606)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:384)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397)
Caused by: java.lang.RuntimeException: Exception thrown by the agent 
    at sun.management.Agent.error(Agent.java:520)
    at sun.management.Agent.error(Agent.java:511)
    at sun.management.Agent.startAgent(Agent.java:268)
    at sun.management.Agent.agentmain(Agent.java:134)
    at sun.management.Agent.premain(Agent.java:116)
    ... 6 more
Community
  • 1
  • 1
schnatterer
  • 7,525
  • 7
  • 61
  • 80

1 Answers1

1

Unfortunately this feedback is given just after the release of version 5.6 LTS ! There are no workarounds. Problem is referenced at https://jira.sonarsource.com/browse/SONAR-7730.

Simon Brandhof
  • 5,137
  • 1
  • 21
  • 28