Link to home
Start Free TrialLog in
Avatar of Jasmin shahrzad
Jasmin shahrzad

asked on

sonar exited with code 0

sonarqube on docker on ubuntu.
i try to install sonarqube 7.7-community with postgres version 11.3
its failed with
 
 ERROR web[][o.a.c.h.Http11NioProtocol] Failed to initialize end point associated with ProtocolHandler ["http-nio-"my-ip-9000"]
sonar      | java.net.BindException: Cannot assign requested address
ERROR web[][o.s.s.a.EmbeddedTomcat] Fail to start web server
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:113)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:556)
 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143

Open in new window


the port 9000 is not occupied.
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Try: netstat -an | grep 9000

what to you get? I suspect something is LISTENing to that port.
Avatar of Jasmin shahrzad
Jasmin shahrzad

ASKER

Nothing is on port 9000. Netstat -an | grel 9000 show nothing.
What i did is i have alredy running postgres container for Artifactory and i change the port to 5430 . Maybe this is problem, beacuse it look like sonar Can not connect to database.
Is it possible to create a sonar database and connect sonar to existing database via docker-Compose?
If i Can then i Can use the official port 5432
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i change port from 9000 to 9500
and i have nothing running in this port
# netstat -an | grep 9500
#
error log is :

ERROR web[][o.s.s.a.EmbeddedTomcat] Fail to start web server
sonar      | org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
sonar      |         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
sonar      |         at org.apache.catalina.startup.Tomcat.start(Tomcat.java:427)
sonar      |         at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:61)
sonar      |         at org.sonar.server.app.WebServer.start(WebServer.java:51)
sonar      |         at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:113)
sonar      |         at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:100)
sonar      |         at org.sonar.server.app.WebServer.main(WebServer.java:91)
sonar      | Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardService[Tomcat]]
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
sonar      |         at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
sonar      |         ... 7 common frames omitted
sonar      | Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
sonar      |         at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
sonar      |         ... 9 common frames omitted
sonar      | 2019.05.16 05:10:59 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start web
sonar      | java.lang.RuntimeException: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
sonar      |         at com.google.common.base.Throwables.propagate(Throwables.java:160)
sonar      |         at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:65)
sonar      |         at org.sonar.server.app.WebServer.start(WebServer.java:51)
sonar      |         at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:113)
sonar      |         at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:100)
sonar      |         at org.sonar.server.app.WebServer.main(WebServer.java:91)
sonar      | Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
sonar      |         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
sonar      |         at org.apache.catalina.startup.Tomcat.start(Tomcat.java:427)
sonar      |         at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:61)
sonar      |         ... 4 common frames omitted
sonar      | Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardService[Tomcat]]
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
sonar      |         at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
sonar      |         ... 7 common frames omitted
sonar      | Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
sonar      |         at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
sonar      |         at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
sonar      |         ... 9 common frames omitted
sonar      | 2019.05.16 05:10:59 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped
sonar      | 2019.05.16 05:11:00 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
sonar      | 2019.05.16 05:11:00 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
sonar      | 2019.05.16 05:11:00 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
sonar exited with code 0
Looks like your change was not done in the right place:

Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
yes i can see it.
here is my docker-compose file. doesn't mater which port i  write in my compose file. it's totally ignored and try to connect to 9000
-----
  version: "3"
services:
  db:
    image: postgres:11.3
    restart: unless-stopped
    container_name: sonar-postgresql
    ports:
     - 5430:5432
    environment:
      POSTGRES_DB: sonar
      POSTGRES_USER: sonar
      POSTGRES_PASSWORD: Sonar
    volumes:
      - /containers/postgres/sonar/sonar_data:/var/lib/postgresql/data
      - /containers/postgres/sonar/sonar_db:/var/lib/postgres
    restart: always
    ulimits:
      nproc: 65535
      nofile:
        soft: 32000
        hard: 40000
  sonarqube:
    image: sonarqube:7.7-community
    restart: unless-stopped
    container_name: PF-sonar
    ports:
      - 9100:9000
      - 9092:9092
    volumes:
      - /containers/sonar/sonarqube_conf:/opt/sonarqube/conf
      - /containers/sonar/sonarqube_data:/opt/sonarqube/data
      - /containers/sonar/sonarqube_extensions:/opt/sonarqube/extensions
      - /containers/sonar/sonarqube_plugins:/opt/sonarqube/lib/bundled-plugins
    environment:
      - sonar.jdbc.url=jdbc:postgresql://db:5432/sonar
      - DB_TYPE=postgresql
      - DB_USER=sonar
      - DB_PASSWORD=Sonar
    ulimits:
      nproc: 65535
      nofile:
        soft: 32000
        hard: 40000
------
i think i find more in log file.
FATAL:  password authentication failed for user "sonar"
in my docker-compose is password Sonar. But it's not accept. i just connect to database via
docker exec -it sonar psql -U sonar
and i change password to sonar via
\password sonar   command
and commit my docker container.
try to start up
sonar-postgresql | 2019-05-16 11:20:57.325 UTC [31] FATAL:  password authentication failed for user "sonar"
sonar-postgresql | 2019-05-16 11:20:57.325 UTC [31] DETAIL:  Password does not match for user "sonar".
sonar-postgresql |      Connection matched pg_hba.conf line 95: "host all all all md5"
ERROR web[][o.s.s.p.Platform] Web server startup failed

it should be ok for entry all all all md5 i have the same for artifactory
it should be reported i change it to trust and commit my email for postgres. now it's running
Well done 👍
Now i do not connect to sonar. Please Help.
i use 9100 on compose file but ip:9100 syas page not found. i can see netstat -an | grep 9100 and 9092 is listen. but i can't connect to it.
i have had a old sonar (7.4) stand alone and i used  the old sonar.properties and just rename database and connection.
but what happen if i don't have it? it's look like is not running correct.
still try to connect to  port 9000
and i have something else in this port
PF-sonar     | 2019.05.16 12:57:56 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
i can running on 9100 now when i remove the file but still warning for file is not find (/opt/sonarqube/conf/sonar.properties)
and can not create the file. do you have a correct one or when i get some sonar.properties file.
Thank you.
You're welcome ;)
i still missing sonar.properties. do you know where i can download one?
But you have one in your SonarQube home folder under conf - the file just needs to be configured, it's not something you just download.
no i do not have.  sonar start and say the file is missing. i have a one from earlier version. but what happen if it was first installation?
i need to reinstall sonarqube this time i select port 9200 and set host all all all trust in postgres. i get the same error HELP

2019.05.22 18:12:20 ERROR web[][o.s.s.a.EmbeddedTomcat] Fail to start web server
PF-sonar     | org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
PF-sonar     |  at org.apache.catalina.startup.Tomcat.start(Tomcat.java:427)
PF-sonar     |  at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:61)
PF-sonar     |  at org.sonar.server.app.WebServer.start(WebServer.java:51)
PF-sonar     |  at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:113)
PF-sonar     |  at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:100)
PF-sonar     |  at org.sonar.server.app.WebServer.main(WebServer.java:91)
PF-sonar     | Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardService[Tomcat]]
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
PF-sonar     |  at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
PF-sonar     |  ... 7 common frames omitted
PF-sonar     | Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
PF-sonar     |  at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
PF-sonar     |  ... 9 common frames omitted
PF-sonar     | 2019.05.22 18:12:20 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start web
PF-sonar     | java.lang.RuntimeException: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
PF-sonar     |  at com.google.common.base.Throwables.propagate(Throwables.java:160)
PF-sonar     |  at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:65)
PF-sonar     |  at org.sonar.server.app.WebServer.start(WebServer.java:51)
PF-sonar     |  at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:113)
PF-sonar     |  at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:100)
PF-sonar     |  at org.sonar.server.app.WebServer.main(WebServer.java:91)
PF-sonar     | Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
PF-sonar     |  at org.apache.catalina.startup.Tomcat.start(Tomcat.java:427)
PF-sonar     |  at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:61)
PF-sonar     |  ... 4 common frames omitted
PF-sonar     | Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardService[Tomcat]]
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
PF-sonar     |  at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
PF-sonar     |  ... 7 common frames omitted
PF-sonar     | Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-9000]]
PF-sonar     |  at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
PF-sonar     |  at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)