Issues while setup a staging instance

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 9.8

  • how is SonarQube deployed: zip, Docker, Helm
    zip

  • what are you trying to achieve
    My organisation recently upgraded licence to Enterprise. I am trying to setup a staging licence in staging environment which comes up with Enterprise.

  • what have you tried so far to achieve this
    Have done following steps
    1 Staging db setup by copying data from production.

  1. New staging instance setup with sonarqube 9.8 - pointed to staging db
    We are migrating our production version to 9.9 LTS with in next two weeks and trying to use this staging environment as a playground to practise upgrade.
  2. Installed it as a service in linux.
  3. Started the sonarqube. The process failed in web server with following error

2023.11.07 01:41:16 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile kubernetes/Sonar way
2023.11.07 01:41:16 INFO web[][o.s.s.q.RegisterQualityProfiles] Update profile css/Sonar way
2023.11.07 01:41:16 WARN web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jdk.internal.loader.ClassLoaders$AppClassLoader@5bc2b487-org.sonar.server.qualityprofile.RegisterQualityProfiles’: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Duplicate key ignoreSelectors
2023.11.07 01:41:16 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jdk.internal.loader.ClassLoaders$AppClassLoader@5bc2b487-org.sonar.server.qualityprofile.RegisterQualityProfiles’: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Duplicate key ignoreSelectors

Tried these steps to triage

  1. Checked web.log and can see that it connects to DB and produced a new server ID
  2. Deleted the contents in es7 directory and re-started sonarqube. still the same issue
    Can I try installing 9.9 LTS directly on staging environment(which is connected to a database which still has 9.8 schema)
    Appreciate a help to reslove this issue. Attaching the web.log and es.log with topic.
    web.log (17.6 KB)
    es.log (12.4 KB)

Hey there.

Yes, you can, which will immediately trigger the upgrade procedure.

If I had to make a guess about this error message:

java.lang.IllegalArgumentException: Duplicate key ignoreSelectors
  • Either a corrupted database backup
  • Plugins installed in the extensions/plugins folder that shouldn’t be.

Can you try restoring the database again (making sure the target is empty before restoring), and also list any plugins you have installed?

Hey Colin,
Corrupted database was the culprit. After a fresh import it worked.
Thank you for your help.

1 Like