Sonar way quality profile broken after database backend update

Hello,

I use SonarQube Developer Edition Version 9.9 (build 65466). Deployed as a zip.

I have updated the backend with the database to the latest version of Debian 12 and PostgreSQL 16.
Since then, I have an error on my CI :

org.sonar.api.batch.rule.internal.DefaultActiveRules]: Factory method 'provide' threw exception; nested exception is org.sonarqube.ws.client.HttpException: Error 404 on https://my.domain.com/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt,updatedAt,deprecatedKeys&activation=true&qprofile=AW0Fj3r4xzjhhfRSlNYS&ps=500&p=1 : {"errors":[{"msg":"The specified qualityProfile \u0027AW0Fj3r4xzjhhfRSlNYS\u0027 does not exist"}]}

When I list the available qualityProfiles with the URL https://my.domain.com/profiles - can see the identifier AW0Fj3r4xzjhhfRSlNYS in the list :

...
    {
      "key": "AW0Fj3r4xzjhhfRSlNYS",
      "name": "Sonar way",
      "language": "flex",
      "languageName": "Flex",
      "isInherited": false,
      "isDefault": true,
      "activeRuleCount": 47,
      "activeDeprecatedRuleCount": 0,
      "rulesUpdatedAt": "2021-05-27T21:56:18+0000",
      "isBuiltIn": true,
      "actions": {
        "edit": false,
        "setAsDefault": false,
        "copy": true,
        "associateProjects": false,
        "delete": false
      }
    },
...

I don’t have any Flex code, but anyway. (I have troubleshooted all the Languages and found out I have the same issue with XML language. I keep explaining here below with the Flex language.)

When I try to view the profile from the UI, I go to https://my.domain.com/profiles/show?name=Sonar+way&language=flex, and then I have the error message on the page :

I found similar problems on the web :

I share some thoughts :

  • Is there a was to restore de Sonar way built-in quality profile ? From this post : (Updating Sonar Way profile) I have a confirmation that

…This is a built-in profile that cannot be updated…
– Colin - Community Manager

Unfortunately I did not find any solution in the documentation "9.9 | Instance administration | Quality profiles : Managing quality profiles in SonarCloud

Hi,

Welcome to the community!

What happens when you try that URL manually in a browser?

Is analysis actually failing, or does it log this error and keep going?

 
Ann

Same 404.

The analysis stops.

Hi,

It’s time to look at this via the UI.

Can you pull up, in the UI, the profile for AW0Fj3r4xzjhhfRSlNYS? Does it have rules in it?

 
Ann

Hi,

no rules are available, see the screen below :

Hi,

Does the Flex Sonar way profile show up on the list of profiles (the page before this one)?

 
Thx,
Ann

Hi,

Yes, Flex Sonar way profile is displayed on the previous page.

Regards

Hi,

I think your DB has gotten into a bad state. I’m going to flag this for more expert eyes.

 
Ann

Hi @evguen

Before we can advance on that topic we have a few more question to ask that would help us.

  1. Could you send us the list of plugins that are deployed under $SQ_HOME/lib/extensions ?
  2. Did you try cleaning of your Postgres after migration as mentioned in the doc

Thanks

2 Likes

Hello Mathieu,

The extensions are the default one provided with sonar.
Since the last time, I have tried an upgrade to the latest version of SonarQube 9.9.6. I had another error which prevents SonarQube from starting :frowning:

But I followed your advice on cleaning myPostgres after migration following your doc and everithing went back to normal state.

VACUUM FULL
REINDEX DATABASE <db>
ANALYZE

Thank you for your assistance!