Upgrading Sonarqube fom version 9.2.1 to 9.9.4

Make sure to tell us:

  • What version are you upgrading from? 9.2.1

  • System information (Operating system, Java version, Database provider/version) -

  • openjdk version “11.0.23” 2024-04-16 LTS
    OpenJDK Runtime Environment (Red_Hat-11.0.23.0.9-2) (build 11.0.23+9-LTS)
    OpenJDK 64-Bit Server VM (Red_Hat-11.0.23.0.9-2) (build 11.0.23+9-LTS, mixed mode, sharing)
    ]# postgres --version
    postgres (PostgreSQL) 10.23
    ]# uname -r
    4.18.0-513.24.1.el8_9.x86_64

  • What’s the issue you’re facing? - After upgrading when I tried to start sonarqube it asked to manually upgrade db , i tried everyway but could not upgrade the postgres. Can you help with it. and then i tried to integrate sonarqube with ldap i did certificate addition to keystore and then edited the properties file . but again it had issues with starting up. 2:43:48 ERROR app[o.s.a.p.ManagedProcessHandler] Fail to launch process [es]
    java.lang.IllegalStateException: Could not delete Elasticsearch temporary conf directory
    at org.sonar.application.ProcessLauncherImpl.pruneElasticsearchConfDirectory(ProcessLauncherImpl.java:168)
    at org.sonar.application.ProcessLauncherImpl.writeConfFiles(ProcessLauncherImpl.java:155)
    at org.sonar.application.ProcessLauncherImpl.launch(ProcessLauncherImpl.java:92)
    at org.sonar.application.SchedulerImpl.lambda$tryToStartProcess$2(SchedulerImpl.java:196)
    at org.sonar.application.process.ManagedProcessHandler.start(ManagedProcessHandler.java:73)
    at org.sonar.application.SchedulerImpl.tryToStartProcess(SchedulerImpl.java:194)
    at org.sonar.application.SchedulerImpl.tryToStartEs(SchedulerImpl.java:146)
    at org.sonar.application.SchedulerImpl.tryToStartAll(SchedulerImpl.java:138)
    at org.sonar.application.SchedulerImpl.schedule(SchedulerImpl.java:112)
    at org.sonar.application.App.start(App.java:59)
    at org.sonar.application.App.main(App.java:81)
    Caused by: java.nio.file.AccessDeniedException: /opt/sonarqube/temp/conf/es
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:249)
    at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
    at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181)
    at org.sonar.application.ProcessLauncherImpl.pruneElasticsearchConfDirectory(ProcessLauncherImpl.java:166)
    … 10 common frames omitted
    2024.08.28 12:43:48 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
    2024.08.28 12:43:48 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
    2024.08.28 12:43:48 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
    2024.08.28 12:50:14 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
    2024.08.28 12:50:14 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:35713]
    2024.08.28 12:50:14 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
    2024.08.28 12:50:14 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
    2024.08.28 12:50:15 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
    2024.08.28 12:50:15 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
    2024.08.28 12:50:15 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped

Hello @Rashmi_Priya! Welcome back to our community forums!

Can you clarify your problem and provide the error you got when upgrading the database? From the stack trace you posted, you seem to have an issue with the permissions on the ElasticSearch directory:

Could you post the output from stat /opt/sonarqube/temp/conf/es?

Hi Davi! Please find the error print below -
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 86 kB/s | 4.5 kB 00:00
Red Hat Satellite Client 6 for RHEL 8 x86_64 (RPMs) 67 kB/s | 3.8 kB 00:00
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs) 62 kB/s | 4.5 kB 00:00
Red Hat Ansible Engine 2.9 for RHEL 8 x86_64 (RPMs) 69 kB/s | 4.0 kB 00:00
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 82 kB/s | 4.1 kB 00:00
No match for argument: postgresql11-server
No match for argument: postgresql11-contrib
Error: Unable to find a match: postgresql11-server postgresql11-contrib

listing plsql-
ng Subscription Management repositories.
============================================================================================================================== Name & Summary Matched: postgres ==============================================================================================================================
freeradius-postgresql.x86_64 : Postgresql support for freeradius
grafana-postgres.x86_64 : Grafana postgres datasource
pcp-pmda-postgresql.x86_64 : Performance Co-Pilot (PCP) metrics for PostgreSQL
postgresql.x86_64 : PostgreSQL client programs
postgresql-contrib.x86_64 : Extension modules distributed with PostgreSQL
postgresql-docs.x86_64 : Extra documentation for PostgreSQL
postgresql-jdbc.noarch : JDBC driver for PostgreSQL
postgresql-jdbc-javadoc.noarch : API docs for postgresql-jdbc
postgresql-odbc.x86_64 : PostgreSQL ODBC driver
postgresql-plperl.x86_64 : The Perl procedural language for PostgreSQL
postgresql-plpython3.x86_64 : The Python3 procedural language for PostgreSQL
postgresql-pltcl.x86_64 : The Tcl procedural language for PostgreSQL
postgresql-server.x86_64 : The programs needed to create and run a PostgreSQL server
postgresql-server-devel.x86_64 : PostgreSQL development header files and libraries
postgresql-static.x86_64 : Statically linked PostgreSQL libraries
postgresql-test.x86_64 : The test suite distributed with PostgreSQL
postgresql-test-rpm-macros.x86_64 : Convenience RPM macros for build-time testing against PostgreSQL server
postgresql-upgrade.x86_64 : Support for upgrading from the previous major release of PostgreSQL
qt5-qtbase-postgresql.i686 : PostgreSQL driver for Qt5’s SQL classes
qt5-qtbase-postgresql.x86_64 : PostgreSQL driver for Qt5’s SQL classes
tuned-profiles-postgresql.noarch : Additional tuned profile(s) targeted to PostgreSQL server loads
=================================================================================================================================== Name Matched: postgres ===================================================================================================================================
postgresql-odbc-tests.x86_64 : Testsuite files for psqlodbc
postgresql-upgrade-devel.x86_64 : Support for build of extensions required for upgrade process
================================================================================================================================= Summary Matched: postgres ==================================================================================================================================
apr-util-pgsql.x86_64 : APR utility library PostgreSQL DBD driver
dovecot-pgsql.x86_64 : Postgres SQL back end for dovecot
libpgtypes.x86_64 : Map PostgreSQL database types to C equivalents
libpgtypes.i686 : Map PostgreSQL database types to C equivalents
libpq.x86_64 : PostgreSQL client library
libpq.i686 : PostgreSQL client library
libpq-devel.i686 : Development files for building PostgreSQL client tools
libpq-devel.x86_64 : Development files for building PostgreSQL client tools
perl-DBD-Pg.x86_64 : A PostgreSQL interface for perl
php-pgsql.x86_64 : A PostgreSQL database module for PHP
postfix-pgsql.x86_64 : Postfix PostgreSQL map support
python-psycopg2-doc.x86_64 : Documentation for psycopg python PostgreSQL database adapter
python2-psycopg2.x86_64 : A PostgreSQL database adapter for Python 2
python2-psycopg2-debug.x86_64 : A PostgreSQL database adapter for Python 2 (debug build)
python2-psycopg2-tests.x86_64 : A testsuite for A PostgreSQL database adapter for Python 2
python3-psycopg2.x86_64 : A PostgreSQL database adapter for Python 3
python3.11-psycopg2.x86_64 : A PostgreSQL database adapter for Python
python3.11-psycopg2-debug.x86_64 : A PostgreSQL database adapter for Python 3 (debug build)
python3.11-psycopg2-tests.x86_64 : A testsuite for A PostgreSQL database adapter for Python 2
python38-psycopg2.x86_64 : A PostgreSQL database adapter for Python 3
python38-psycopg2-doc.x86_64 : Documentation for psycopg python PostgreSQL database adapter
python38-psycopg2-tests.x86_64 : A testsuite for A PostgreSQL database adapter for Python 2
python39-psycopg2.x86_64 : A PostgreSQL database adapter for Python 3
python39-psycopg2-doc.x86_64 : Documentation for psycopg python PostgreSQL database adapter
python39-psycopg2-tests.x86_64 : A testsuite for A PostgreSQL database adapter for Python 2
rsyslog-pgsql.x86_64 : PostgresSQL support for rsyslog
rubygem-pg.x86_64 : A Ruby interface to the PostgreSQL RDBMS

Hi @Rashmi_Priya.

Tip: you can use three backticks (```) for your output blocks. You can find more tips here.

It looks like you pasted the output of yum install postgresql11-server postgresql11-contrib or something similar to that, right? Unfortunately, I can’t help you upgrade your database, but I would start with the official PostgreSQL docs.

We have a great documentation on the SonarQube upgrade topic. A good place to start is our upgrade roadmap.