Problems updating Sonar Enterprise from 8.1 to 8.9.X

Hi all,
this is my first post looking for help from the experts. I’ve been trying to update Sonarqube Enterprise from 8.1 to 8.9.X and up until now, I haven’t succeeded because looks like there is something wrong when upgrading the DB.
This is the problem description:

  1. Upgrade process from 8.0 to 8.9.0/8.9.2 get hanged at step 3543.
  2. This process seems to do an ALTER TABLE to live_measures table, that have 95208033 records.
  3. This process seems to take more than 10 minutes.
  4. I noticed that when Postgres stops processing the query/table (by monitoring disc and CPU usage), Postgres talks back to the Sonarqube process on SonarQube server, but this does not reply, although the TCP connection is in ESTABLISHED status.
  5. Connection to the server changes to “idle in transaction” and it eventually dies (is removed)
  6. No activity (CPU or DISK) from this point onward.

I think it may be some kind of bug or connection issue on the SonarQube, as it is not answering to the notification. The issue could be related to the amount of time that step 3543 takes.

Could give me some advice or tip to make this process work?

Thanks in advance!


Hello @xaviersojo ,

Welcome to SonarSource community :sonarsource:

Can you zip your $SONARQUBE_HOME/logs and attach them here? If you prefer a private thread, please let me know also.


Hello @xaviersojo ,

Before we proceed with further troubleshooting, please backup your database, copy it to another database, and we will test the migration on a test instance of SonarQube. This ensures we do not harm your production data once we have a good plan to fix this issue.

Next, can you confirm if the primary key pk_live_measures exists on the uuid column of live_measures table?

One way to get all the PKs on all your tables:

select kcu.table_schema,
       kcu.ordinal_position as position,
       kcu.column_name as key_column
from information_schema.table_constraints tco
join information_schema.key_column_usage kcu 
     on kcu.constraint_name = tco.constraint_name
     and kcu.constraint_schema = tco.constraint_schema
     and kcu.constraint_name = tco.constraint_name
where tco.constraint_type = 'PRIMARY KEY'
order by kcu.table_schema,

In any case, I suggest you perform a VACUUM FULL ANALYZE as discussed in this Community guide.

After that, please try running your migration once more. If it hangs again at step 3543, please notify me.


Hello @Joe ,

Thanks a lot for your answer.
I’m Xavi’s co-worker. We can confirm that this primary key exists in the table lives_measures as you indicate.
We will try it again next week.


1 Like

Hi @Sergio_Lopez ,

Thanks for the update. If you can, can you try stopping the upgrade (quit SonarQube), then retry the upgrade (restart SonarQube and go to the URL <YOUR-SONARQUBE-URL>/setup) and see what happens?


Hi @Joe,

We did rollback and we continue working with Version 8.1
Now the message in /setup is " Database is up-to-date".
We’ll try the sonar update again next week.


1 Like