I noticed it says it's running via. Python2, and I don't know if this is an issue. Got the following when typing the ps -ef (...) command from the error screen;
By bet is that one of these lines - probably the Python install one, resulted in this happening, but I am not 100% sure sadly...
On newer Raspberry Pi's (newly flashed ones, within at least a year), this issue has not occurred once, and exactly the same lines as above ^ are being executed every day, without issues.
What did you already try to solve it?
I tried serving OctoPrint myself via. SSH, and it gave me the following error, which has the full error trace; octoprint_log.log (5.5 KB)
My guess is that the issue is Python2/3 related.
Have you tried running in safe mode?
No, after the error above I did not think trying safe mode would make a difference.
Complete Logs
There were nothing in the logs, as OctoPrint never made it to log anything after the issues started happening. Nothing in the old logs either.
OctoPrint version: 1.5.1
Problem occurred on a Pi 2 this time, but has happened on a Pi 3B before as well (without me having the log to be 100% certain, but the issue with the other user seemed identical; after updating OctoPrint won't start)
I have not been able to re-create this problem myself, as both times I have encountered it, it's been a user seeking our help. This time I went into TeamViewer and everything in this post is from what I have gathered there.
It doesn't necessarily seem to be a Pi 2-related issue, as the error doesn't indicate that it simply doesn't have enough power. It didn't run or or anything.
Hope the error above ^ makes sense to someone in here! Thanks, and sorry for the long read.
Will figure out which OctoPi version it is - you're probably on to something. I know this is most likely fixed by a fresh install, just wanted to see if there was possible to get it fixed, in case it happens again and the next user isn't too happy about a re-flash.
The 'address already in use' means there was an incomplete shutdown of OctoPrint. Reboot the Pi, it should start again.
Then, post the list of plugins installed and I'll look and see if there is any I recognize. I had an issue where running a plugin with multiprocessing would block shutdown if there were non-daemon threads, since OctoPrint only waits 15 secs for them to terminate. Some reason with multiple processes the server bindings are not released properly.
For clarification, I have seen this issues several times before (some people on discord even pinged me since I had done quite a lot of work into this), and I don't think it is python 2/3 related at all, usually bad shutdown.
And contributed a PR to core OP to make this less likely, since there was a util method (octoprint.util.ResettableTimer) that was not daemon by default and was causing this.
One I am aware has an issue is 'DiscordRemote' since it used non-daemon threads.
Awesome! Thanks for the points. We did try restarting quite a few times, which didn't help. Might be best to boot, make sure the OctoPrint service doesn't start automatically, so the "bad startup" will be monitored with a manual serve of OP?
I'll contact the guy who had the issue tomorrow, and do as you suggested