-
-
Notifications
You must be signed in to change notification settings - Fork 702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
500 "attempt to write a readonly database" error caused by "PRAGMA schema_version" #2058
Comments
I thought it might relate to the "defensive mode" issue described here: But I have since determined that the Datasette official Docker image does NOT run anything in defensive mode, so I don't think it's related to that. |
Asked on the SQLite Forum if anyone has seen this before: https://sqlite.org/forum/forumpost/793a2ed75b |
Here's the relevant code: Lines 421 to 437 in 5890a20
This function is called on almost every request (everything that subclasses datasette/datasette/views/base.py Lines 101 to 103 in 5890a20
It uses This was already the cause of a subtle bug here: |
Here's a potential workaround: when I store the schema versions, I could also score an MD5 hash of the full schema ( The performance overhead of this needs investigating - how much more expensive is |
I got ChatGPT (code execution alpha) to run a micro-benchmark for me. This was the conclusion:
Here's the chart it drew me: (It's a pretty rubbish chart though, it only took measurements at 100 and 200 and drew a line between the two, I should have told it to measure every 10 and plot that) And the full transcript: https://gist.github.com/simonw/2fc46effbfbe49e6de0bcfdc9e31b235 The benchmark looks good enough on first glance that I don't feel the need to be more thorough with it. I'm tempted to add something to the |
Really interesting how you are using ChatGPT in this. |
I tried deploying the fix you submitted, but still getting the same errors. I can past the logs here if needed, but I really don't see anything new in them. |
I've not been able to replicate this myself yet, but I've seen log files from a user affected by it.
That's running the official Datasette Docker image on https://fly.io/ - it's causing 500 errors on every page of their site.
The text was updated successfully, but these errors were encountered: