Sonarqube8.8 to 8.9 postgres db upgrade 12 to 13 schema issues

Hello,

recently we tried to upgrade our dev CE instance from Sonarqube 8.8 to 8.9 and noticed that Postgres needs to be updated from 12 to 13 as well. After updating db and pushing data from 12 to 13 , ran into issues due to schema updates done on postgres13 . here is a sample log of errors

            from notifications
            order by created_at asc
            limit $1
2021-06-11 15:14:34.951 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x ERROR:  column "uuid" does not exist at character 8
2021-06-11 15:14:34.951 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x HINT:  Perhaps you meant to reference the column "notifications.id".
2021-06-11 15:14:34.951 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x STATEMENT:  select uuid, data, created_at
            from notifications
            order by created_at asc
            limit $1
2021-06-11 15:15:34.441 UTC [2885] db=,user=,app=,client= LOG:  checkpoint starting: time
2021-06-11 15:15:35.202 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x ERROR:  column "uuid" does not exist at character 8
2021-06-11 15:15:35.202 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x HINT:  Perhaps you meant to reference the column "notifications.id".
2021-06-11 15:15:35.202 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x STATEMENT:  select uuid, data, created_at
            from notifications
            order by created_at asc
            limit $1
2021-06-11 15:16:35.454 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x ERROR:  column "uuid" does not exist at character 8
2021-06-11 15:16:35.454 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x HINT:  Perhaps you meant to reference the column "notifications.id".
2021-06-11 15:16:35.454 UTC [26991] db=sonarqube,user=sonarqube,app=PostgreSQL JDBC Driver,client=x.x.x.x STATEMENT:  select uuid, data, created_at
            from notifications
            order by created_at asc
            limit $```


is there any migration script available for DB upgrades around postgres-13

thanks
CHakri

Hello @Chakriv
thanks for reaching out with this report.

noticed that Postgres needs to be updated from 12 to 13 as well.

Can you clarify what made you believe this PostgreSQL upgrade was needed? I could find not any hint about such requirement anywhere in our documentation:

Knowing that, you have two options:

  • stay on PG12 or restore your DB connection to your PG12 DB
  • find a way to apply a PG upgrade that is safe for your SonarQube data.

And to answer your question:

is there any migration script available for DB upgrades around postgres-13

No SonarSource does not provide any script for this, the database and its maintenance is SonarQube user’s responsibility.
Afaiu, no such script should be needed. If you happen to find what was the root cause of your problem or can share some details about how you applied your db upgrade (pg_upgrade, dump file re-import, …), don’t hesitate to share; this might help other users.

Best regards
Sylvain