I’m having a weird issue with NPM on my Proxmox virtual machine. When I restart the VM, NPM starts working perfectly fine. But then after some time it just stops functioning without any warning. Sometimes it keeps running for several days, other times it breaks after just a couple of hours.
The strange part is that I don’t get any error messages in the terminal. The proxy configurations for my internal services just stop responding. When I reboot the VM again, everything works normally until it fails again randomly.
This problem started recently and I haven’t modified any configurations between the working and non-working states. Has anyone experienced similar behavior with NPM? What could be causing these random failures?
I encountered something very similar about six months ago and it drove me crazy for weeks. The root cause turned out to be memory-related in my case. NPM was gradually consuming more RAM over time, likely due to some kind of memory leak or inefficient garbage collection, especially when handling SSL certificates and frequent proxy requests. What finally helped me diagnose it was monitoring the system resources more closely. I started checking memory usage before and after the failures occurred. Sure enough, the VM was running out of available memory even though NPM itself wasn’t throwing any errors. The process would just become unresponsive. I ended up allocating more RAM to the VM and also implemented a simple cron job that restarts the NPM container every 48 hours as a preventive measure. Haven’t had the random failures since then. You might want to check your memory allocation and see if there’s a pattern with resource usage when these failures happen.
check your disk space too, had same issue and it was npm logs filling up the drive. when storage gets low docker starts acting weird but doesnt throw obvious errors. cleared out old logs and havent had problems since
This sounds like a container networking issue I dealt with last year on my homelab setup. The symptoms you describe match what happens when the Docker bridge network gets into an inconsistent state. NPM container appears to be running fine but loses its ability to properly route traffic to backend services. In my experience, this often occurs when there are port conflicts or when Docker’s internal DNS resolution starts failing. The container stays alive but essentially becomes deaf to incoming requests. What worked for me was recreating the Docker network entirely rather than just restarting the container. I also discovered that having multiple containers competing for the same port ranges was triggering this behavior. Try running docker network ls and docker network inspect on your NPM network when it fails. You might notice stale entries or conflicting IP assignments. I now recreate my custom bridge network monthly to prevent this from happening again.