Error displaying Top Referred Topics

After updating Discourse, the following error appears in the dashboard in Top Referred Topics section:
Sorry, an error occurred while executing the query

The error is also explained in the log as follows:
Error while computing report top_referred_topics: PG::ReadOnlySqlTransaction: ERROR: cannot execute UPDATE in a read-only transaction /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rack-mini-pro

Did you upgrade from the Admin panel?

If so, I would try rebuilding through the console; it fixes most of the problems.
I upgraded an instance, and I’m unable to reproduce it. :thinking:

Might be related to https://github.com/discourse/discourse/pull/31011/.

hi @Arkshine
I upgraded from the Admin panel and then ran ./launcher rebuild app, but the problem still exists.