# Facing an issue with starting up Sonarqube using SonarSource helm chart

**URL:** <https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536>\
**Category:** SonarQube Server / Community Build\
**Tags:** kubernetes, helm\
**Created:** [August 10, 2022, 2:17am UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536 "2022-08-10T02:17:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjhumkhawala](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@mjhumkhawala](https://community.sonarsource.com/u/mjhumkhawala)\
**Post date:** [August 10, 2022, 2:17am UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536/1 "2022-08-10T02:17:34Z")

</div>

I’m trying to deploy Sonarqube Enterprise version on a Kubernetes cluster using SonarSource’s helm chart, but the application container fails to start up and throws the following error -

```auto
Type Reason Age From Message
  ---- ------ ---- ---- -------
  Warning Failed 34m (x35129 over 5d7h) kubelet Error: secret "sonarqube-sonarqube" not found

```

Here is my values.yaml

```auto
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: sonarqube
  namespace: sonarqube
spec:
  chart:
    spec:
      version: "4.0.2"
      sourceRef:
        kind: HelmRepository
        name: sonarsource
        namespace: sonarqube
  values:
    edition: enterprise
    image:
      repository: sonarqube
      tag: 9.0.1-enterprise
    ingress:
      enabled: false
      hosts:
        - name: "hostname"
    readinessProbe:
      # If an ingress *path* other than the root (/) is defined, it should be reflected here
      # A trailing "/" must be included
      sonarWebContext: /sonar/
    livenessProbe:
      sonarWebContext: /sonar/
    postgresql: 
      # Using external postgres db 
      enabled: false
      postgresqlServer: "postgres-server-name"
      # Usinig external secret 
      # line below: 
      existingSecret: "sonar-postgres-password"
      postgresqlUsername: "sonar"
      postgresqlDatabase: "sonar"

```

I don’t know what’s the origin of that error. Is there a config property that I need to set in order to not require `sonar-sonarqube` secret? I used to use Oteemo’s sonarqube helm chart, and never faced this issue. Does anyone know how to resolve this?

---

<div class="post-metadata">

**Author:** ![leo.geoffroy](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/leo.geoffroy/32/68603_2.png) [@leo.geoffroy](https://community.sonarsource.com/u/leo.geoffroy)\
**Post date:** [August 10, 2022, 2:02pm UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536/3 "2022-08-10T14:02:39Z")

</div>

Hi @mjhumkhawala and welcome to the community!

I’m not sure about the expected result of the helm chart configuration:

You are configuring the PostgreSQL section:

```auto
    postgresql: 
      # Using external postgres db 
      enabled: false
      postgresqlServer: "postgres-server-name"
      # Usinig external secret 
      # line below: 
      existingSecret: "sonar-postgres-password"
      postgresqlUsername: "sonar"
      postgresqlDatabase: "sonar"

```

Yet the postgresql.enabled flag is set to false, so it will never be created.

Do you expect to connect to an external database or connect to the embedded PostgreSQL database?

In case of external database, you need to specify `jdbcOverwrite` section in your values

---

<div class="post-metadata">

**Author:** ![mjhumkhawala](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@mjhumkhawala](https://community.sonarsource.com/u/mjhumkhawala)\
**Post date:** [August 10, 2022, 5:10pm UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536/4 "2022-08-10T17:10:42Z")

</div>

Hi,

The pod logs showed that the container failed to start up with `CreateContainerConfigError`, which means the container is waiting for a missing ConfigMap or Secret. So I created a dummy Secret called secret.yaml -

```auto
apiVersion: v1
kind: Secret
metadata:
 name: sonarqube-sonarqube
 namespace: sonarqube
type: Opaque
stringData:
 DB_USER: "userName"
 DB_PASSWORD: "password"

```

and applied it, and restarted the pods. This time the error was -

```auto
Warning Failed 4s (x5 over 35s) kubelet Error: couldn't find key jdbc-password in Secret sonarqube/sonarqube-sonarqube

```

I updated my values.yaml and added jdbcOverwrite section

```auto
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: sonarqube
  namespace: sonarqube
spec:
  chart:
    spec:
      version: "4.0.2"
      sourceRef:
        kind: HelmRepository
        name: sonarsource
        namespace: sonarqube
  values:
    edition: enterprise
    image:
      repository: sonarqube
      tag: 9.0.1-enterprise
    ingress:
      enabled: false
      hosts:
        - name: "hostname"
    readinessProbe:
      # If an ingress *path* other than the root (/) is defined, it should be reflected here
      # A trailing "/" must be included
      sonarWebContext: /sonar/
    livenessProbe:
      sonarWebContext: /sonar/
    jdbcOverwrite:
      enabled: true
      jdbcUrl: jdbc:postgresql://rdsEndpoint:portNumber/dbNameIsSonar?socketTimeout=150
      jdbcUsername: sonar
      jdbcSecretName: sonar-postgres-password #Using k8s secret instead of password in plaintext
    postgresql: 
      # Using external postgres db 
      enabled: false
      postgresqlServer: "postgres-server-name"
      # Usinig external secret 
      # line below: 
      existingSecret: "sonar-postgres-password"
      postgresqlUsername: "sonar"
      postgresqlDatabase: "sonar"

```

This did not resolve the issue. I don’t understand why is Sonarqube looking for a k8s secret with jdbc username and password during container start up?

---

<div class="post-metadata">

**Author:** ![DefinitelyNotTobi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/definitelynottobi/32/22664_2.png) [@DefinitelyNotTobi](https://community.sonarsource.com/u/DefinitelyNotTobi)\
**Post date:** [August 10, 2022, 6:56pm UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536/5 "2022-08-10T18:56:46Z")

</div>

Hi @mjhumkhawala ,

the error you are facing originates from the secret you created. it is expected that it holds information about the JDBC password from a specific key. Per default that key would be `jdbc-password` but it can be configured to be something different with `jdbcOverwrite.jdbcSecretPasswordKey` as stated in the [README](https://github.com/SonarSource/helm-chart-sonarqube/tree/master/charts/sonarqube#jdbc-overwrite).

assuming your secret looks like the one you posted, a valid configuration would look like this:

```nohighlight
    jdbcOverwrite:
      enabled: true
      jdbcUrl: jdbc:postgresql://rdsEndpoint:portNumber/dbNameIsSonar?socketTimeout=150
      jdbcUsername: sonar
      jdbcSecretName: sonarqube-sonarqube 
      jdbcSecretPasswordKey: DB_PASSWORD

```

hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![memelet](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/memelet/32/603_2.png) [@memelet](https://community.sonarsource.com/u/memelet)\
**Post date:** [February 18, 2024, 6:25pm UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536/7 "2024-02-18T18:25:27Z")

</div>

Where in the docs does it say that the default key is `jdbc-password` ?

---

<div class="post-metadata">

**Author:** ![memelet](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/memelet/32/603_2.png) [@memelet](https://community.sonarsource.com/u/memelet)\
**Post date:** [February 18, 2024, 6:27pm UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536/8 "2024-02-18T18:27:40Z")

</div>

I guess its in the values.yaml, but not the docs.

---

<div class="post-metadata">

**Author:** ![Joe](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/joe/32/14820_2.png) [@Joe](https://community.sonarsource.com/u/Joe)\
**Post date:** [March 21, 2024, 5:56pm UTC](https://community.sonarsource.com/t/facing-an-issue-with-starting-up-sonarqube-using-sonarsource-helm-chart/69536/9 "2024-03-21T17:56:07Z")

</div>

> [@memelet](#):
>
> Where in the docs does it say that the default key is `jdbc-password` ?

The default password is `sonarPass`, listed in the [values.yaml](https://github.com/SonarSource/helm-chart-sonarqube/blob/a9450ed5eba02a8819f5297850b13456e7df441a/charts/sonarqube/values.yaml#L434) or the same place in ArtifactHub: [https://artifacthub.io/packages/helm/sonarqube/sonarqube#jdbc-overwrite](https://artifacthub.io/packages/helm/sonarqube/sonarqube#jdbc-overwrite)
