felddy/foundryvtt-docker

Occasional memory issue crashes docker container

kuchrk24 opened this issue · 10 comments

Bug description

Running this docker container in Unraid v6.12.3. Docker container is crashing on occasion. It happens all the time through the use of a specific module, but has happened outside the context of that module as well. When it happens, I am seeing the following in the unraid logs: error.txt

I've reached out to the module developer and he does not believe it is his module and I agree since I am not able to repo it on the Foundry provided software.

I'm not super familiar with the workings of docker or unraid, but it seems to be some sort of memory issue.

Steps to reproduce

Most commonly I am seeing this happen when I try to do an import using MrPrimates DDB Importer module, but I have seen it happen without having used his module. I have not been able to repro this running my server on the .exe that is provided from the foundry website.

In the case of that module:

  1. Navigate to compendium packs
  2. Click DDB Muncher
  3. Go to Items tab
  4. Click Item munch
  5. While the module is doing its work, the browser will lose connection to the server. Going to the server will show that the container has stopped.

Expected behavior

Docker container does not crash.

Container metadata

com.foundryvtt.version = "11.306"
org.opencontainers.image.authors = "markf+github@geekpad.com"
org.opencontainers.image.created = "2023-07-21T16:28:47.154Z"
org.opencontainers.image.description = "An easy-to-deploy Dockerized Foundry Virtual Tabletop server."
org.opencontainers.image.licenses = "MIT"
org.opencontainers.image.revision = "f379bf9645ef353c5a80fae0ad64866d374a2269"
org.opencontainers.image.source = "https://github.com/felddy/foundryvtt-docker"
org.opencontainers.image.title = "foundryvtt-docker"
org.opencontainers.image.url = "https://github.com/felddy/foundryvtt-docker"
org.opencontainers.image.vendor = "Geekpad"
org.opencontainers.image.version = "11.306.0"

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
felddy commented

While I'm not intimately familiar with how Unraid manages containers, the error log suggests that there are limits set on the cgroup. It seems likely that the default memory allocation provided by Unraid might not be sufficient for your deployment and plugins.

To investigate this, I recommend monitoring the container using the docker stats command or inspecting its configuration with docker inspect. Once you've determined the amount of memory allocated to the container, consider either doubling this amount or removing the memory restrictions altogether.

Please note that the container is not designed to use any unusual or proprietary techniques that could impact memory usage. It's engineered to run FoundryVTT as efficiently and securely as possible, but like any software, its performance is ultimately determined by the resources allocated to it.

For more information on setting memory limits in Docker, you can refer to the following documentation: Docker Resource Constraints.

I encourage you to adjust the memory settings and continue monitoring the container's usage. Please let me know what you discover.

So I did add a memory limit as part of trying to resolve this which didn't make a difference. I removed it again after your message and it also didn't have an impact. I still see the container stopping after using this module. It seems to crash at around 4-5 gigs and there is no longer any error message in Unraid because the server still has memory to spare (64 gig total). I don't see any console errors in the browser before it happens. Just messages about losing connection to the server. I guess I'll try and see if anything gets logged in the Foundry logs.

I'm getting nothing now. The container just dies without anything in Unraid, or Foundry logs... Kind of at a loss.

felddy commented

How much memory did the standalone (.exe) version of the FoundryVTT use when you did your testing? I'm assuming that is a Windows machine you're testing the exe on. Are you running unraid on the same machine?

I'll have to set it back up. I uninstalled it after testing as I don't intend to use it for my sessions. I tried it on my windows PC, but i have a separate machine running Unraid.

Ok so after loading my world, the standalone exe was hovering around a gig. Using the module that is causing issues on the container, I saw it spike up to 3 gigs at one point but went no higher.

To provide some more information, I tried this on a fresh world with only the module that I am able to reliably cause the issue with and it's dependencies (though again it sometime happens just at random times like opening journals or displaying images). I was thinking that maybe the world I use just had something corrupted as it has been upgraded through the last several Foundry major versions. But that is not the case as it happened on a clean world.

Just to continue to provide more information, I tried this other container that is available in the app store in unraid and it does not have the same issue. Unfortunately I will have to switch to this one for now.

This issue has been automatically marked as stale because it has been inactive for 28 days. To reactivate the issue, simply post a comment with the requested information to help us diagnose this issue. If this issue remains inactive for another 7 days, it will be automatically closed.

This issue has been automatically closed due to inactivity. If you are still experiencing problems, please open a new issue.