Strange 500 errors #9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For some reason on some URLs I get 500 errors.
Example:
https://structables.bloat.cat/MechaMaven-the-Educational-Robot-Explorer/
https://structables.bloat.cat/contest/
https://structables.bloat.cat/teachers/
It works on official instance though.
Here are some log messages:
I'm using Docker image; couldn't figure what is wrong 😞
I believe you are seeing two different issues there. I think I know what is causing the first – your instance probably never initialized its cache. I have released a new version,
v0.3.12
, which should address this. Simply loading/cron/
made the/teachers/
category load fine for me on your instance.The first issue in your second code block looks like you are not on the latest release:
This has already been fixed in
e845caff0e
, which was included in the previousv0.3.11
release (in fact, that was the only change in that release). Please try updating tov0.3.12
(a.k.a.latest
in Docker Hub), or the latest commit if you are building the container yourself.The third issue is due to a change in the structure of the Instructables website, which will have to be reflected in the Structables code. I will move that part to a separate issue.
Pulled latest image from DockerHub, still have this issue.
Removed info about /contest/This is on /projects/
/teachers/ works fine.
I'm getting random 500 errors. Sometimes everything loads fine if I try reloading again and again
Hmm, that still sounds like it's related to cache initialization. But I can't reproduce the issue on your instance right now - no matter how often I try to load
/projects/
, it loads perfectly fine each time.Tried on another computer with Windows 10 in Chrome, it is less frequent than on Linux in Firefox but I still managed to get 500 error
I think you need to spam so it gets 500... Probably not the issue then.
/privacypolicy/ is not loading too
Do you have logs for that?
Sure, here it is:
/projects/
/teachers/
/contest/
If I keep spamming reload button, eventually I'll get the page, but once reloaded, I'll get 500 again (/teachers/ and /projects/ can load this way, /privacypolicy/ and /contests/ aren't loaded even if I spam)
Alright, that one should be trivial to fix, I just have to catch that exception. I'll do that on the train later. Although you should probably provide a privacy policy.
Question: Do you load ˋ/cron/ˋ, like, ever?
And do you see "Updating data..." at any point in your logs?
Yes, if I don't load then I think I'll never get /teachers/ and /projects/ to load, so everytime I restart a container I go to /cron/ page
Then there's your issue. ˋ/cron/ˋ has to be run regularly, ideally, but at least once on each worker thread. The individual uwsgi workers don't have a shared state/dataset.
Do you see "Updating data..." in your logs before you manually load ˋ/cron/ˋ? Since the last release, the cron function should be executed automatically on start of a new worker.
I have created a new release with a fix for the privacy policy issue and moved the data loading to an earlier point in the initialization, that should ensure that every new worker thread comes with data to display. Could you please test?
Yes, I do.
Yes, It seems it works automatically, but not as frequent...
Pulled the latest image, everything is fine exept I'm still getting an error on /priacypolicy/
How do I do it?
Ah, you use Docker, right? No clue, to be honest, never tested that. I assume you'd have to bind (is that the word?) a privacy.txt or privacy.md into the working directory in the container.
Erm. You're not running the latest code. That's line 362 now, not 361.
I tried binding privacy.txt to /opt/venv/privacy.txt but I don't this this is the right way since /privacypolicy/ doesn't show itI guess I need to set STRUCTABLES_PRIVACY_FILE env variable for it to work. Update: it works! This info should be in README.md I think, not in the code.Sorry, my bad. Now everything is fine. Closing the issue
That info wasn't even in my brain anymore. 😂 I'll add it to the README.md.
Anyway, I think the working directory in a Docker container is
/
by default, so moving it there should work as well.