-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
Writable canned queries fail with useless non-error against immutable databases #1728
Comments
How did you deploy to Cloud Run?
That's why I upgraded |
If the behaviour you are seeing is because the database is running in immutable mode then that's a bug - you should get a useful error message instead! |
Confirmed - this is a bug where immutable databases fail to show a useful error if you write to them with a canned query. Steps to reproduce:
Then visit http://127.0.0.1:8001/writable/add_name - adding names works. Now do this instead:
And I'm getting a broken error: |
Ah, that would be it! I have a core set of data which doesn't change to which I want authorised users to be able to submit corrections. I was going to deal with the persistence issue by just grabbing the user corrections at regular intervals and saving to GitHub. I might need to rethink. Thanks! |
I've wanted to do stuff like that on Cloud Run too. So far I've assumed that it's not feasible, but recently I've been wondering how hard it would be to have a small (like less than 100KB or so) Datasette instance which persists data to a backing GitHub repository such that when it starts up it can pull the latest copy and any time someone edits it can push their changes. I'm still not sure it would work well on Cloud Run due to the uncertainty at what would happen if Cloud Run decided to boot up a second instance - but it's still an interesting thought exercise. |
A more realistic solution (which I've been using on several of my own projects) is to keep the data itself in GitHub and encourage users to edit it there - using the GitHub web interface to edit YAML files or similar. Needs your users to be comfortable hand-editing YAML though! You can at least guard against critical errors by having CI run tests against their YAML before deploying. I have a dream of building a more friendly web forms interface which edits the YAML back on GitHub for the user, but that's just a concept at the moment. Even more fun would be if a user-friendly form could submit PRs for review without the user having to know what a PR is! |
In terms of this bug, there are a few potential fixes:
I'm not keen on that last one because it would be frustrating if you couldn't launch Datasette just because you had an old canned query lying around in your metadata file. So I'm leaning towards option 2. |
I don't think that'd work for this project. The db is very big, and my aim was to have an environment where researchers could be making use of the data, but be easily able to add corrections to the HTR/OCR extracted data when they came across problems. It's in its immutable (!) form here: https://sydney-stock-exchange-xqtkxtd5za-ts.a.run.app/stock_exchange/stocks |
Nice custom template/theme! Yeah, for that I'd recommend hosting elsewhere - on a regular VPS (I use |
Thanks, I'll give it a try! |
And in terms of the bug, yep I agree that option 2 would be the most useful and least frustrating. |
Decision: I'm going to implement this:
|
Here's what it looks like: I put the |
I've been banging my head against a wall for a while and would appreciate any pointers...
allow
set on the query to accept my GitHub id and a GH organisation./-/actor
gives the same result in both environmentsEverything seems to be the same, but the canned query works perfectly when run locally, and fails when I try it on Cloudrun. I'm redirected back to the canned query page and the db is not changed. There's nothing in the Cloudstor logs to indicate an error.
Any clues as to where I should be looking for the problem?
The text was updated successfully, but these errors were encountered: