And suddenly : "The OctoPrint server is currently not running"

What is the problem?

I've been using OctoPrint for a couple of years with no problems ; only problems I had were plugins problems. But now it seems it's a problem with OctoPrint, related to networking.

I recently rewired my home network. Until then, I was using a PiHole with its DHCP server enabled (and static leases). I removed the PiHole (for now) and reactivated the DHCP on the DSL modem/router ; I always use static IP leases. Internet works fine, TV and Netflix work fine, the local network works fine, but not OctoPrint ! The static leases are the same (IP = 192.168.0.28 since the very begining, and it never changed ; the 3D printer is 192.168.0.28, period !).

When I power the OctoPi ON, on the local display (a 7" touch display), I get a "The OctoPrint server is currently not running" screen. Hitting F5 on a keyboard solves the problem...
The weird thing is that if the OctoPi is NOT connected to the LAN (cable disconnected), OctoPrint starts as usual. If I reconnect the Pi to the network and reboot, the problem is back.

It seems something is slowing octoprint service down so Chromium loads before OctoPrint completed its loading. I can't understand why.

After deactivating the modem/router DHCP server and reactivating the PiHole, the problem disapeared...

But before I plug a PiHole into my switch (one year or so ago), OctoPrint was working flawlessly.

What did you already try to solve it?

Nothing relevant as I don't understand what's happening.
Disabling anonymous tracking has no effect.
Adding a line with "service octoprint start" before the chromium-browser call in "root/etc/xdg/openbox/autostart" gives a BSOD (black !). (I use TouchUI and it comes with openbox window manager). Disabling the TouchUI UI has no effect. Disabling the TouchUI plugin has no effect.

Reactivating the PiHole + its DHCP and deactivating it on the modem/router solves the problem.

Logs (syslog, dmesg, ... no logs, no support)

octoprint.log shows no error ; 4 seconds between the first line and "user logged in" ; what other log files should I look to ? I'm not a Linux specialist and have a very basic networking knowledge !

Additional information about your network (Hardware you are trying to connect to, hardware you are trying to connect from, router, access point, used operating systems, ...)

Reflashing the SD card with a known good backup image (8 of august) does not solve the problem.

What could do or need OctoPrint that has a blocking / slowing effect ???
I had a look to the queries in the PiHole Query Log Page, when starting, OctoPrint is connecting to Google, googleapis, github, and octoprint.org, and gets quick anwers (with PiHole DHCP being in use ; didn't test with the modem/router DHCP).

Forgot to say : I always use the same DNS, primary and secondary, from my ISP. (of course the DNS for the DSL modem is set to the PiHole IP when it is used as a DHCP server, and the PiHole DHCP is deactivated if I use the modem/ router one).

Really weird issue.

1 Like

Mine isn't working as well. I didn't change anything in my network.

Also, this came shortly after the update, but worked fine for a few prints until last night when the server isn't responding in chrome or on Putty.

Seems like a problem with your ISP modem/router. I know some ISPs limit the range of the DHCP leases they offer (I.e. in the country I live in, my ISPs router default configuration is to offer 10 leases, no more), have you checked that you have sufficient leases (or that the range contains enough IP addresses).

On a side note, PiHole seems to be responsible for DNS on your network, but what I don't understand from the lines quoted is whether your set PiHole to forward the DNS queries to your ISP's DNS or does it queries for DNS itself? And what about when you deactivate PiHole? Do you change your DNS settings in the DHCP configuration of the router?

OctoPrint works fine when the PiHole is the DHCP server.
The "box" allows for 255 usable LAN IP leases. 3 being used for the internet box ("server", and "player"that can be Ethernet and WiFi) : french Freebox 4K Mini, that comes in two enclosures, one for the modem and LAN, and another one for everything related to the TV and multimedia.
Currently, I use 32 leases (thirty two peripherals) without a problem, except OctoPrint if the DHCP is the "box". (in France we usually call these modem/routers "box")
I run OctoPrint 1.6.1 + OctoPi 0.18.0 because last version of OctoPrint (1.7.0) is not compatible with TouchUI (this is usual with new versions and Foosel explained to me why on a Thomas Salanderer video comment section a couple months ago : TouchUI makes use of undocumented features, and I can't live without TouchUI).

The problem is with the RasPi and with the RasPi only : it always responded to SSH connections. It is something that slows OctoPrint service down. I can see it running with top, I can get it in a PC browser, but not locally. Have to "F5" locally. It is solved with PiHole as DHCP.

Writing this I just remember that I recently activated an experimental feature of my box : an ad filter (somthing that could be similar to PiHole, but with no control over what it does). Will try ASAP to run the box DHCP without this feature. I cannot tinker with the internet while the wife is not sleeping... Or I risk my life.

English translation below

Je connais bien ces boxes, j'en ai moi-même une (j'ai eu la Revolution, puis la Mini 4K et maintenant la Pop). C'est d'ailleurs pour cela que j'ai pensé à ce problème d'étendue DHCP, la confguration par défault de la Révolution étant à 10 ou 20 baux, et il fallait aller dans l'interface de configuration pour étendre la plage. Par contre, je l'utilise en mode bridge car j'ai un ordinateur qui joue le rôle de firewall/routeur/proxy.

Je voudrais être sûr d'avoir bien compris : vous pouvez accéder à l'interface d'OctoPrint depuis d'autres ordinateurs sur le réseau, mais sur le navigateur en local sur le Pi n'affiche pas l'interface si vous ne rafraîchissez pas la page ? Et ce problème n'apparaît pas quand vous utilisez le PiHole ? Mais pourquoi ne pas utiliser l'adresse http://127.0.0.1:5000 au lieu de http://octopi.local ou de l'adresse que vous avez configurée ? Comme cela l'interface serait toujours accessible, même si le RasPi ne se connecte pas au réseau...


I'm very familiar with those boxes, having one myself (had the Freebox Revolution, then the Mini 4K, now the Pop). That's why I raised the issue about the number of leases available, as the Freebox Revolution default configuration allowed only 10 to 20 leases, and you had to go to the configuration interface to expand the range. Although I use mine in bridge mode as I have a computer playing the role of firewall/router/proxy.

So let me see if I understand correctly: you can access the octoprint interface from other computers on the network, but locally the browser will not show the UI until you hit refresh a few times? And that this problem doesn't appear if PiHole is present? But couldn't you point the browser on the RasPi to http://127.0.0.1:5000 instead of http://octopi.local or the one you have configured? This would work even if the RasPi doesn't connect to the network.

I'm writing this post while testing...

-> everything is now suddenly working fine again for no reason, after one week, and hours attempting to understand <-

I also first had a Revolution then a 4K (tired with the stupid Philippe S+ark unstable 3 feet design). (and before, had a Orange/Wanadoo box, the one with "la m*rde blanche' as nickname). Revolution or Mini 4K, LAN adresses can extend from 192.168.xxx.001 to 192.168.xxx.255 ; the router is 192.168.0.254, the PiHole is 192.168.0.253 no problem with that ! I had 20+ leases (currently 32) for 10+ years without any problem using the Revolution then the Mini 4K, with no PiHole (we have a lot of PCs, phones, tablets : nerd house !). The problem is probably not there (but I never ran all machines simultaneously).

I don't use it as a bridge because I need it as a router for the Player (Canal+, Netflix), the Seedbox (HDD shares needed) and WiFi (I hooked a HDD to it for TV recording, and Torrent)

I mainly decided to add a PiHole with its DHCP because when the DSL was failing (rarely !), I was losing my LAN because the box has to be recognized by Free servers before the DHCP is allowed to run... I also had from time to time really ennoying problems with the DHCP connecting WiFi machines but not hard wired ones (never understood what was happening !) : had to wait a couple of hours before I get my whole LAN again !

(next experimentations : connecting a phone to the PiHole using USB and sharing the 4G connection over the LAN ; off topic !)

This being said, this is right : I can't get the Octoprint or TouchUI interface on the local machine (OctoPi) without hitting F5 (refreshing display) if I use the Freebox DHCP. And there's no problem if I use the PiHole DHCP.

With PiHole DHCP :
I first tested with these two addresses :
'localhost' -> local machine works fine
'0.0.0.0' -> local machine works fine
And now with '127.0.0.1' , according to your suggestion -> black screen. Can't access the browser or TouchUI interface on the local Pi, but no problem remotely (browser or SSH or samba/SMB shares, black screen with VNC of course)

(I removed the "http://" from the IPs because of silly links in the post !
The port (5000) is not set ; it is default, isn't it ? So no need to write it (?) (I only use one printer)

'0.0.0.0' is an old fix (1 year or so) for a logscreen loop that occured with 'localhost' with an earlier version of TouchUI. It can be found on TouchUI Git (among the closed issues).

Now with the Freebox DHCP, the PiHole DHCP being deactivated (oeuf corse !)
The internet box and the PiHole are restarted (hot restart, remotely)

'localhost' -> local machine (Pi) works fine, no need for a refresh
'0.0.0.0' -> local machine (Pi) works fine, no need for a refresh
'127.0.0.1' -> local machine (Pi) = black screen, refresh has no effect

Previously, I had to refresh locally ONLY if the Pi was connected to the netowork. No refresh was needed if the Pi was unplugged.

THE PROBLEM DISAPPEARED !!!
I don't understand why and how !
Today, everything is working as usual ?!?! It's been ennoying me for one week !
I changed nothing except DHCP, swapping from the "box" to the PiHole and vice-versa.

All reboots are cold reboots, not system restarts ; the power is turned off then on after a "system shutdown"

Here's my autostart ; TouchUI is NOT installed with the installer. I installed X , openbox, chromium and TouchUI (no desktop), and then created a autostart after some readings about the options, copying / pasting from here and there ; most of this script comes from die-antwort.eu :

#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#

# If you want to use GNOME config tools...
#
#if test -x /usr/lib/arm-linux-gnueabihf/gnome-settings-daemon >/dev/null; then
#  /usr/lib/arm-linux-gnueabihf/gnome-settings-daemon &
#elif which gnome-settings-daemon >/dev/null 2>&1; then
#  gnome-settings-daemon &
#fi

# If you want to use XFCE config tools...
#
#xfce-mcs-manager &

# https://die-antwort.eu/techblog/2017-12-setup-raspberry-pi-for-kiosk-mode/

# Disable any form of screen saver / screen blanking / power management

xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace

setxkbmap -option terminate:ctrl_alt_bksp

# Start Chromium in kiosk mode

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences

# hide mouse cursor

unclutter -idle 0.01 ?

# open OctoPrint webpage : no pinch, no bars, no scrollbars
# in case of a log loop, replace 'localhost' with 'http://0.0.0.0'

# command line with with localhost
#chromium-browser --enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter --disable-infobars --disable-pinch --disable-overlay-scrollbars --kiosk 'localhost'

# command line with with http://0.0.0.0
chromium-browser --enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter --disable-infobars --disable-pinch --disable-overlay-scrollbars --kiosk ''http://0.0.0.0'

# command line with with http://127.0.0.1
#chromium-browser --enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter --disable-infobars --disable-pinch --disable-overlay-scrollbars --kiosk ''http://127.0.0.1'

I'd really like to understand...
Where could I find some information ? octoprint.log shows no errors...

Actually the port is needed as the default HTTP port is 80. I'm not entirely sure the HAProxy configuration works in this case, so you'd need to actually put the :5000 at the end of the URL, for it to work everytime. Basically OctoPrint always listens on 127.0.0.1:5000, unless you've changed some settings in the server section of the config.yaml file...

Yeah that kind of error wouldn't show up in OctoPrint's logs, you could try to look though systemd's journal (using journalctl) but basically all the messages from all the services on the Pi end up here, so it's like finding a needle in a haystack. What I would think of is some kind of DNS related issue, with the RasPi DNS cache being cleared after one week, but it sounds far fetched...

OK, I'll add the ports to the addresses.
Will have a look to these log files.

I've been thinking of some problem related to the Chromium cache. But flushing had no effect.

The more I think to this issue, the more I think it has nothing to do OctoPrint : the problem still persisted after flashing a 2 months old image.

Anyway, I think that Chromium shouldn't start before OctoPrint is ready. There's something to do in order to prevent such a situation, but this needs some knowledge I don't have. Or maybe OctoPrint service could tell the browser (if any) to auto refresh when ready...

I have been having similar problems on my RPi4, notably loss of network connectivity, since update 1.7.0 - suddenly the server was Offline and ping/putty no longer works. A reboot would solve the problem temporarily.
Finally Octoprint would no longer load due to the SD card being full, all the space was taken by kern.log (23 GB) filled with :

brcmf_sdio_htclk ht avail timeout request error: -5

This would appear to be linked to the WLAN driver. I'll be seeing if there is a kernel update available once my current print has finished.

Raspberry Pi's filling up the logs with wifi errors is nothing new, and has been an issue I've been aware of for as long as I can remember. The Pi's network is not known for it's stability round here anymore, and there's a number of these cases dotted about over the last year, 64GB SD cards filled up with wifi logs!

1 Like

I have done a...

sudo apt update
sudo apt upgrade

...and it would appear to have fixed the problem; no more messages in kern.log, server staying up and running since my last post.

Makes me think that at the same time, I had an issue with apt-get on two Pis, OctoPi and PiHole : apt aborted with a message saying the OS was a "oldstable" version (I had to force the updates using a command line option I found on the web...

1 Like

Yesterday my Pi was running great, never had any downtime, since about April 2020 when I bought the printer, today I am getting the message that Octoprint is not running, I cannot access the logs etc via putty or WinSCP, it says I don't have permission :frowning:
I will post a new thread as I don't want to hijack your post :slight_smile: