Landscape is broken when postgresql leader re-elected with ReadOnlySqlTransaction

Bug #2059251 reported by Aliaksandr Vasiuk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Server
New
Undecided
Unassigned

Bug Description

Hi,

Current result:

The Landscape is getting broken with 'ReadOnlySqlTransaction' error when Postgresql leader changes until appserver is manually restarted.

Expected result:

When Postgresql leader changes, Landscape-appserver picks up the update and starts communicate to the new leader.

Steps to reproduce:
1. Deploy the latest/stable landscape-server and 14/stable PostgreSQL environment: https://pastebin.ubuntu.com/p/6Xjx3Jh4RF/
2. Login and do some update, for example, go to Account and change the Account name.
3. Log in into PostgreSQL Primary unit with `juju ssh`
4. Restart PostgreSQL snap, with `sudo snap restart charmed-postgresql`
5. Wait unit juju settles.
6. Go to the Landscape application. I will look working. But then do any writable change. For example, Account, and do the Account name change.
7. You will receive an error that operation is failed. In the landscape-appserver logs you will see ReadOnlySqlTransaction: https://pastebin.ubuntu.com/p/yJvpTVBsQ8/

Workaround steps:
8. Restart landscape-appserver service with `sudo systemctl restart landscape-appserver`
9. After that changing the Account name will work fine, appserver logs will report
```
Mar 27 10:23:21 juju-8245a5-15 appserver-1[23737]: POST /ajax/ method=POST path=/ajax/ status=200 ip=10.57.136.103 proto=HTTP/1.1 request_length=52 request_type="application/x-www-form-urlencoded; charset=UTF-8>
```

Best Regards,
Alex.

information type: Proprietary → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.