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

[Sonarqube] bitnami.service restart failing #1520

Closed
Alok650 opened this issue May 4, 2024 · 9 comments
Closed

[Sonarqube] bitnami.service restart failing #1520

Alok650 opened this issue May 4, 2024 · 9 comments
Assignees
Labels
how-to How to issues reported by users solved sonarqube stale 15 days without activity triage Triage is needed

Comments

@Alok650
Copy link

Alok650 commented May 4, 2024

Describe your issue as much as you can

Hi guys,

I am trying to upgrade my sonarqube version to 9.9.5 following the document: https://docs.bitnami.com/aws/apps/sonarqube/administration/upgrade/

on restarting bitnami.service using cmd : sudo /opt/bitnami/ctlscript.sh restart sonarqube, the service stops running. The logs which I get from journalctl -u bitnami.service are:

systemd[1]: bitnami.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: bitnami.service: Failed with result 'exit-code'.
systemd[1]: Failed to start LSB: bitnami init script.
systemd[1]: Starting LSB: bitnami init script...
bitnami[2729]: ## 2024-05-04 07:37:57+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/010_resize_fs...
bitnami[2729]: resize2fs 1.44.5 (15-Dec-2018)
bitnami[2729]: open: No such file or directory while opening /dev/xvda
bitnami[2729]: ## 2024-05-04 07:37:57+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/020_hostname...
bitnami[2729]: ## 2024-05-04 07:37:57+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/030_swap_file...
bitnami[2729]: ## 2024-05-04 07:37:57+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/040_check_if_demo_machine...
bitnami[2729]: ## 2024-05-04 07:37:57+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/050_change_boot_log_permissions...
bitnami[2729]: ## 2024-05-04 07:37:57+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/060_get_default_passwords...
bitnami[2729]: ## 2024-05-04 07:37:57+00:00 ## INFO ## Starting services...
bitnami[2729]: 2024-05-04T07:37:58.528Z - info: Saving configuration info to disk
bitnami[2729]: 2024-05-04T07:37:58.826Z - info: Performing service start operation for postgresql
bitnami[2729]: postgresql 07:38:04.10 INFO  ==> postgresql started
bitnami[2729]: 2024-05-04T07:38:04.110Z - info: Performing service start operation for apache
bitnami[2729]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
bitnami[2729]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
bitnami[2729]: no listening sockets available, shutting down
bitnami[2729]: AH00015: Unable to open logs

What is the right way to restart sonarqube? Why do we get this error and how to avoid this?

@Alok650 Alok650 added the how-to How to issues reported by users label May 4, 2024
@github-actions github-actions bot added the triage Triage is needed label May 4, 2024
@jotamartos
Copy link
Collaborator

bitnami[2729]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
bitnami[2729]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

It seems Apache can't be started because there is another process using that port. Did you install Apache using apt? You can take a look at this other post to know how to disable that other service and start the Bitnami one.

#26 (comment)

@jotamartos jotamartos changed the title Sonarqube bitnami.service restart failing [Sonarqube] bitnami.service restart failing May 6, 2024
@Alok650
Copy link
Author

Alok650 commented May 6, 2024

sudo service apache2 disable
Usage: apache2 {start|stop|graceful-stop|restart|reload|force-reload}
I stopped apache and started it with bitnami: sudo /opt/bitnami/ctlscript.sh start apache

currently after stopping apache, the port 80 is occupied with
tcp6 0 0 :::80 :::* LISTEN 10671/httpd

Is there a way to completely stop all components of bitnami.service (apache, Postgres, sonarqube) and restart them without getting these errors like port occupied...etc?

@jotamartos
Copy link
Collaborator

currently after stopping apache, the port 80 is occupied with
tcp6 0 0 :::80 :::* LISTEN 10671/httpd

That's Apache. Try stopping and disabling it this way

#1005 (comment)

Is there a way to completely stop all components of bitnami.service (apache, Postgres, sonarqube) and restart them without getting these errors like port occupied...etc?

This error is caused due to some changes you made in the instance. The default Bitnami installation doesn't come with extra services that use those ports. We install Apache, PostgreSQL and Sonarqube and ensure that there is no other process that prevents them from starting.

@Alok650
Copy link
Author

Alok650 commented May 7, 2024

Hi @jotamartos

I was able to get sonarqube to start by removing apache using https://github.com/bitnami/vms/issues/1005#issuecomment-1607937270 and using systemctl restart bitnami.service.

Currently, we are using sonarqube Community EditionVersion 8.9.3. I am trying to upgrade it to 9.9.5. For this, I am following Upgrade Only SonarQube In The Bitnami Package For SonarQube™ section of the bitnami documentation.

Currently I stop the bitnami.service before starting the above changes for the upgrade.

Update the contents of the /opt/bitnami/sonarqube/conf/sonar.properties and /opt/bitnami/sonarqube/conf/wrapper.conf files with the settings of the related files in the /opt/bitnami/sonarqube-backup/conf backup directory. To do so, use an editor to modify them with the old settings (web server URL, database, LDAP settings, etc.).

For the above, I copy the contents of sonar.properties and wrapper.conf from the sonarqube backend and update these files. I don't make any change to these files.

When I restart the bitnami.service using sudo systemctl restart bitnami.service, the sonarqube fails to restart. The logs are :

Journalctl logs:

systemd[1]: Starting LSB: bitnami init script... bitnami[605]: ## 2024-05-07 10:01:29+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/010_resize_fs... bitnami[605]: resize2fs 1.44.5 (15-Dec-2018) bitnami[605]: open: No such file or directory while opening /dev/xvda bitnami[605]: ## 2024-05-07 10:01:29+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/020_hostname... bitnami[605]: ## 2024-05-07 10:01:29+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/030_swap_file... bitnami[605]: ## 2024-05-07 10:01:29+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/040_check_if_demo_machine... bitnami[605]: ## 2024-05-07 10:01:31+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/050_change_boot_log_permissions... bitnami[605]: ## 2024-05-07 10:01:31+00:00 ## INFO ## Running /opt/bitnami/var/init/pre-start/060_get_default_passwords... bitnami[605]: ## 2024-05-07 10:01:32+00:00 ## INFO ## Starting services... bitnami[605]: 2024-05-07T10:01:37.763Z - info: Saving configuration info to disk bitnami[605]: 2024-05-07T10:01:38.672Z - info: Data disk not present bitnami[605]: 2024-05-07T10:01:38.675Z - info: Performing service start operation for postgresql bitnami[605]: postgresql 10:01:44.07 INFO ==> postgresql started bitnami[605]: 2024-05-07T10:01:44.076Z - info: Performing service start operation for apache bitnami[605]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 bitnami[605]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 bitnami[605]: no listening sockets available, shutting down bitnami[605]: AH00015: Unable to open logs bitnami[605]: 2024-05-07T10:01:45.734Z - error: Unable to perform start operation Export start for apache failed with exit code 1 bitnami[605]: ## 2024-05-07 10:01:45+00:00 ## INFO ## Running /opt/bitnami/var/init/post-start/010_bitnami_agent_extra... bitnami[605]: ## 2024-05-07 10:01:45+00:00 ## INFO ## Running /opt/bitnami/var/init/post-start/020_bitnami_agent... su[1338]: (to bitnami) root on none su[1338]: pam_unix(su-l:session): session opened for user bitnami by (uid=0) bitnami[605]: ## 2024-05-07 10:01:47+00:00 ## INFO ## Running /opt/bitnami/var/init/post-start/030_update_welcome_file... bitnami[605]: ## 2024-05-07 10:01:47+00:00 ## INFO ## Running /opt/bitnami/var/init/post-start/040_bitnami_credentials_file... bitnami[605]: ## 2024-05-07 10:01:47+00:00 ## INFO ## Running /opt/bitnami/var/init/post-start/050_clean_metadata... systemd[1]: bitnami.service: Control process exited, code=exited, status=1/FAILURE systemd[1]: bitnami.service: Failed with result 'exit-code'. systemd[1]: Failed to start LSB: bitnami init script. systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: /etc/systemd/system/bitnami.service:16: Support for option SysVStartPriority= has been removed and it is ignored systemd[1]: bitnami.service: Found left-over process 1177 (postgres) in control group while starting unit. Ignoring. systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies. systemd[1]: bitnami.service: Found left-over process 1237 (postgres) in control group while starting unit. Ignoring. systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies. systemd[1]: bitnami.service: Found left-over process 1239 (postgres) in control group while starting unit. Ignoring. systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.

@jotamartos
Copy link
Collaborator

There is no clear information about the error there, please try to get the information from the log of the application. You will need to look for that inside the /opt/bitnami/sonarqube folder.

Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label May 25, 2024
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
@Alok650
Copy link
Author

Alok650 commented Jun 24, 2024

@jotamartos
getting this error in my sonar.log:

2024.06.24 11:11:10 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/bitnami/sonarqube/temp
2024.06.24 11:11:10 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:39701]
2024.06.24 11:11:11 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/bitnami/sonarqube/elasticsearch]: /opt/bitnami/sonarqube/elasticsearch/bin/elasticsearch
2024.06.24 11:11:11 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.06.24 11:11:12 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2024.06.24 11:11:12 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [/opt/bitnami/sonarqube]: /opt/bitnami/java/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/bitnami/sonarqube/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx971m -Xms388m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.5.90363.jar:/opt/bitnami/sonarqube/lib/jdbc/postgresql/postgresql-42.5.1.jar org.sonar.server.app.WebServer /opt/bitnami/sonarqube/temp/sq-process16879507935916711793properties
2024.06.24 11:11:13 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [Web Server]: 1
2024.06.24 11:11:13 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2024.06.24 11:11:13 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.06.24 11:11:13 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 143
2024.06.24 11:11:13 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

it fails with exit code 143

@jotamartos
Copy link
Collaborator

2024.06.24 11:11:12 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [/opt/bitnami/sonarqube]: /opt/bitnami/java/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/bitnami/sonarqube/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx971m -Xms388m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.5.90363.jar:/opt/bitnami/sonarqube/lib/jdbc/postgresql/postgresql-42.5.1.jar org.sonar.server.app.WebServer /opt/bitnami/sonarqube/temp/sq-process16879507935916711793properties
2024.06.24 11:11:13 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [Web Server]: 1

It seems there is a problem with the app. Please take a look at the Sonarqube's official documentation and enable the debug mode to obtain more information. The error is not clear when checking that information in the log file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
how-to How to issues reported by users solved sonarqube stale 15 days without activity triage Triage is needed
Projects
None yet
Development

No branches or pull requests

3 participants