antrolsan
Posts: 2
Joined: Sun Apr 18, 2021 9:53 pm

Web server goes down after some time idle

Sun Apr 18, 2021 10:05 pm

Hi all,

I'm having a problem that when running any web based programs on my pi 4 everything seems to be working perfectly. But after some time idle (around 1 hour or less) the web servers go down when I try to access them again. The pi keeps working fine, I can ssh into it but I lose connection to the web apps. I was even using it with octoprint to control my 3D printer and it keeps printing fine, but I can't access it through the web interface.
This happens with any kind of application (qbittorrent, octopi, docker containers) and with both wifi and ethernet conection.

After I reboot the system, either with `sudo reboot`or disconnecting/connecting the power everything works fine again

I suspect that some kind of power-saving mode is kicking in and shuts the ports off or something like that. However, I've been doing some research online and I haven't found any relevant information that has been able to solve my problem. I plan to run it as a home server 24/7 and of course I can't use it like that with this problem

Anyone has any ideas of what could be going on or how to solve it?

epoch1970
Posts: 6321
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Web server goes down after some time idle

Tue Apr 20, 2021 10:21 am

Could it happen by the time DHCP leases have to renew?
If you're using docker and dhcpcd, have you added "denyinterfaces veth*" in /etc/dhcpcd.conf? Without that Docker and dhcpcd wrestle for control of the interfaces created by Docker.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

antrolsan
Posts: 2
Joined: Sun Apr 18, 2021 9:53 pm

Re: Web server goes down after some time idle

Tue Apr 20, 2021 2:03 pm

epoch1970 wrote: Could it happen by the time DHCP leases have to renew?
If you're using docker and dhcpcd, have you added "denyinterfaces veth*" in /etc/dhcpcd.conf? Without that Docker and dhcpcd wrestle for control of the interfaces created by Docker.
I had set a permanent ip in the DHCP of my router to the pi, so I don't think that could be the problem. And about the dhcpcd.conf I haven't done that, but I was also running into the same issue without using Docker, so I would say the issue came before docker :?

MiscBits
Posts: 149
Joined: Wed Jan 27, 2021 12:48 pm

Re: Web server goes down after some time idle

Tue Apr 20, 2021 9:06 pm

Given that you can still SSH in I think the network stack is OK so the fault points to the web server.

You need to look at any error logs from the server. In Apache these are often defined in the virtual server configuration file if running multiple hosts else check in at /etc/apache2/sites-available/000-default.conf or /etc/apache2/sites-available/default-ssl.conf for the locations.

Return to “Troubleshooting”