question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

after_request update user session on read_only database connection. Should it be an error?

See original GitHub issue

Error 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ankushcommented, Aug 30, 2022

v9

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.

0reactions
ankushcommented, Sep 8, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Applicationintent=ReadOnly Failed to update database ...
When I try to connect ReadOnly Replica on Azure Managed Instance (Business Critical ) I am taking following error.
Read more >
Attempt to write to a readonly database error - Stack Overflow
I initially thought there is some permission issue with my SQLite db file however the correct user has permission to access the file...
Read more >
Error while connecting to the database with the read-only user
Click the Tools menu >> Databases >> Alias Manager >> Edit Alias. 3. In the "Edit Alias" dialogue check the option "Enable SQL...
Read more >
in-db error: statement not permitted in read only session
IN-DB newbie here. I successfully created a Database Connection to an IBM Netezza DB and can see the tables. However when I try...
Read more >
API — Flask Documentation (2.2.x)
Register a function to run before each request. For example, this can be used to open a database connection, or to load the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found