For the past two years I have suffered from a seemingly random issue where my Unraid server logs will fill up endlessly with errors similar to the following:
This eventually leads to the WebUI becoming slow, then unresponsive. Unless I caught it in time, which was never a given since this could happen at any time, it would lock everything up to the point I could not open the terminal or even click the shut down button. This led to a lot more hard restarts of my server than I would like.
One thing I noted is that the issue would come and go but, for the majority of my time experiencing it, would happen after between 2-3 weeks since the last episode. However back in November 2024, it increased to the point that my server was rebooting and would freeze again within hours. This was, of course, unbearable and forced me to try everything until I found a solution.
In my search for a solution I came upon many possibilities but never found a single location for people to say what worked and what didn't or to list solutions. That is what this post aims to be. My hope would be for others to comment and say what worked and what didn't for them as well.
Here is a list of solutions which I tried based on the myriad of comments on other forum/Reddit posts on this seemingly common issue.
Solutions:
Stale Browser:
For many this issue is caused by a persistent bug within Unraid which triggers these exact same NGINX errors if a browser window to the Unraid GUI is left open and untouched for too long. Despite having fixed the main issue on my server, this bug is still present.
**Please ensure you do not have any stale Unraid GUI browser tabs open on any of your devices.**
This will likely be the solution for most of you.
If this is not your issue, here is a list of other possible solutions, including what ultimately worked for me. I have done my best to credit the original commenters.
If this is not a consistent issue for you and your server has not yet become completely unresponsive:
Manually reboot NGINX via terminal:
`/etc/rc.d/rc.nginx restart`
This can also be triggered automatically via the User Scripts plugin. For a time this resolved my issues, until the error spam became too frequent.
Credit:
https://xavier.cc/servers/unraid/unraid-nchan-out-of-shared-memory-while-allocating
Or, manually restart NGINX via SSH:
#!/usr/bin/env bash
pkill -9 nginx
pkillexitstatus=$?
if [ $pkillexitstatus -eq 0 ]; then
echo "pkill exited normally with nginx killed"
elif [ $pkillexitstatus -eq 1]; then
echo "could not find nginx process to kill"
elif [ $pkillexitstatus -eq 2]; then
echo "syntax error in trying to kill nginx using \'pkill -9 nginx\'"
elif [ $pkillexitstatus -eq 3]; then
echo "fatal error using \'pkill -9 nginx\'"
else
echo UNEXPECTED
fi
/etc/rc.d/rc.nginx start
nginxstatus=$?
if [ $nginxstatus -eq 0 ]; then
echo "nginx restarted normally with exit code " $nginxstatus
else
echo "nginx restart returned an abnormal exit code: " $nginxstatus
fi
Credit & Context:
If the above solutions fail to help, consider the possibility that the issue lies with a docker container or a plugin. Consider booting into safe mode for a time to see if the issue goes away when containers, VMs, and plugins are all disabled. This can be difficult if you frequently use your server for things so you may consider, if the errors are occurring frequently enough, going through and shutting down as many containers, VMs, and plugins as possible.
One user reported that removing Unraid Connect resolved their issue:
Remove Unraid Connect:
Note that this will stop the automatic flash backup of your USB drive to Unraid.
Increase nchan_max_reserved_memory:
This solution has apparently worked for some people as well. It didn't seem to do anything for me but if you're here it's worth a shot.
Open terminal and open the nginx config file located at:
/etc/nginx/nginx.config
You can use the "nano" command to open the file directly in the terminal. Edit your NGINX config file to include:
http {
nchan_max_reserved_memory 128M; # Adjust the value based on your available system memory
}
Credit:
What finally worked for me:
This ultimately fixed the problem for my server, with the exception of the stale browser tab issue which is apparently a chronic Unraid problem. This solution isn't even for Unraid but it solved my issue completely.
Open terminal and open the nginx config file located at:
/etc/nginx/nginx.config
Add the following line within the `http` block:
http {
…
ssl_session_cache shared:SSL:10m;
…
}
Restart NGINX.
Credit: https://futurestud.io/tutorials/nginx-solve-reponse-status-0-worker-process-exited
(May this man have the happiest of lives)
Discouraged:
Increasing log file size. This is an option but it likely will not solve anything. It will only take a bit longer for the log file to fill up and then you will be back to square one again.
Conclusion
There are likely more possible solutions which I have either missed or which people have not yet figured out. If you encounter any, please post them below! I hope at least one of these solutions has resolved your issue!