after_request update user session on read_only database connection. Should it be an error?
See original GitHub issueError when run a report.
Traceback (most recent call last): File "/**********************/site-packages/gunicorn/workers/sync.py", line 135, in handle self.handle_request(listener, req, client, addr) File "/**********************/site-packages/gunicorn/workers/sync.py", line 176, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/**********************/site-packages/werkzeug/local.py", line 228, in application return ClosingIterator(app(environ, start_response), self.cleanup) File "/**********************/site-packages/werkzeug/wrappers.py", line 301, in application return f(*args[:-2] + (request,))(*args[-2:]) File "/**********************/frappe-bench/apps/frappe/frappe/app.py", line 86, in application rollback = after_request(rollback) File "/**********************/frappe-bench/apps/frappe/frappe/app.py", line 194, in after_request updated_in_db = frappe.local.session_obj.update() File "/**********************/frappe-bench/apps/frappe/frappe/sessions.py", line 378, in update self.data['sid'])) File "/**********************/frappe-bench/apps/frappe/frappe/database.py", line 154, in sql self._cursor.execute(query, values) File "/**********************/MySQLdb/cursors.py", line 250, in execute self.errorhandler(self, exc, value) File "/**********************/MySQLdb/connections.py", line 50, in defaulterrorhandler raise errorvalue OperationalError: (1290, 'The MariaDB server is running with the --read-only option so it cannot execute this statement')
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
That’s ancient version 😄 only v13 and v14 are officially supported now.
I don’t have a replica setup handy but AFAIK many users use it for reports so it should be working just fine.
Couldn’t reproduce this on latest version. Probably fixed years ago, read_only wrapper switches connection as soon as read-only parts are completed.
https://github.com/frappe/frappe/blob/88928d4da8c1c36a2a1e7b5c9bd425c5677b1ac1/frappe/__init__.py#L775-L792