[Q] SONARQUBE_PASSWORD must have at least 12 characters

After the latest update (via the bitnami docker image), docker logs shows the following issue: SONARQUBE_PASSWORD must have at least 12 characters

How can I fix or change the database user’s password w/o breaking things? This does not concern the admin user, but the DB user accessing the sonarqube DB

  • version: bitnami/sonarqube:latest → 2025.2 (?)
  • env: docker
  • situation: on start of the docker image
  • measures: I will ask, before making things worse…

Seems an issue w/ the latest SonarQube version:

I reverted back to bitnami/sonarqube:25.3.0, and deleted the mounted es8 folder
(as it got changed by the latest sonarqube docker image, and invalidated the index). We are running against bitnami/postgresql:15.5.0

Hi,

Welcome to the community!

You shouldn’t need to change the DB user’s password. This is about SonarQube users’ passwords. I.e. the passwords to log into SonarQube itself (not the DB).

 
HTH,
Ann

Hi,

The message is during startup of the SonarQube container; this is not a user-related issue (it is LDAP in our case); something odd is going on, as the password is provided via the flag --env SONARQUBE_DATABASE_PASSWORD=....

Hi,

Can you share the log?

 
Ann

the following docker run command

docker run -d --name sonarqube2 --hostname sonarqube2 \
  -p 9000:9000 \
  --env SONARQUBE_DATABASE_HOST=hostname \
  --env SONARQUBE_DATABASE_PORT_NUMBER=5432 \
  --env SONARQUBE_DATABASE_NAME=sonarqube \
  --env SONARQUBE_DATABASE_USER=sonarqube \
  --env SONARQUBE_DATABASE_PASSWORD=<password> \
  --volume /tank1/data/sonarqube/bitnami:/bitnami \
  --volume /tank1/data/sonarqube/backup:/mnt/backup \
  bitnami/sonarqube:latest

here the docker logs <container-name>:

sonarqube 16:12:23.64 INFO  ==> 
sonarqube 16:12:23.64 INFO  ==> Welcome to the Bitnami sonarqube container
sonarqube 16:12:23.64 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
sonarqube 16:12:23.64 INFO  ==> Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami/ for more information.
sonarqube 16:12:23.64 INFO  ==> 
sonarqube 16:12:23.65 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
string length is less than 12
sonarqube 16:12:23.69 ERROR ==> SONARQUBE_PASSWORD must have at least 12 characters

and then startup stops…

Hi,

I wasn’t aware of a change to the DB password length requirement, and I’m not finding anything in Jira (altho that doesn’t rule it out…).

Can you try that with a vanilla SonarQube image? I.e. straight from us and not from Bitnami, and see if you get the same thing?

 
Thx,
Ann

I could try that, yes.

The version that is working is the following (currently for our production pipeline):
image

Mmm. I might see an issue; the official docker images from SonarQube do not work with Postgres 15 (?) And the tables might not be compatible (last time I checked).

Hi,

25.5 has been released. That’s the version you want to be targeting.

And per the docs, it’s compatible with Postgres 13 through 17.

Ehm… If you’ve run SonarQube’s schema upgrade then this should not be the case.

 
HTH,
Ann

1 Like

25.5 and latest (from the bitnami distribution) are the same, and these introduce the issue w/ the DB password.

Hi,

I’ve checked with the developers, and they’re telling me this isn’t us.

I’m not sure where else to look to place the blame (or understand the change). I suppose the easiest thing would be to just adopt a longer password?

Sorry I can’t be more help.

 
Ann

1 Like

Hi,

It looks like you’ve already figured out that this validation was added by Bitnami in their SonarQube 25.5 container image. Why they added it? No idea, you might want to ask them directly.

At this point, your options are:

  1. Open an issue on the Bitnami repo to ask why the password validation was added.
  2. Change your database password to meet their new criteria and update the relevant environment variable.
  3. Switch to the official SonarQube image, which doesn’t include this custom validation.
2 Likes

Official SonarQube images seem to adapt (or init) the (PostgreSQL) tables and thus “create” a fresh installation of SonarQube; I loose all the settings of the former instance (Bitnami-based). Is there a way to migrate that data w/o loosing any of that data/settings?

Hi,

SonarQube will only init the DB in an empty schema (or at least, one where it doesn’t see its own tables.)

 
HTH,
Ann