Docker instance crash attempting to run report

So I think I crashed instance crashed a few minutes ago and I found the docker container stopped and the resulting console output will be below. I was able to restart IN and all seems to be okay with no data loss. I guess I am wondering how/if I could run some kind of year long expense report that included the associated documents? My assumption is that I tried to run a report that included too many documents resulting in a crash.

Environment:
Docker image running on unRAID server
Server has 32GB of RAM and invoice ninja is NOT restricted in anyway.

What I was doing:
I entered several expenses with attached receipts (documents). I then went to look into some reports. I ran an expense report trying out the “attach documents” option as I was curious if this would somehow include my uploaded receipts (documents). Now I had selected a custom time range for ALL of 2024 and nearly all of my expenses have files attached. The spreadsheet report was produced, however no documents that I found. I went back into IN and noticed some “spinning wheel” activity trying to look at expenses.

I found my invoice ninja docker instance fully stopped with this as the last log entry:

In ZipFile.php line 1748:
                                                                               
  Allowed memory size of 268435456 bytes exhausted (tried to allocate 1640331  
  60 bytes)                                                                    
                                                                               

2025-01-30 14:37:31,271 WARN exited: queue-worker_01 (exit status 255; not expected)
2025-01-30 14:37:32,277 INFO spawned: 'queue-worker_01' with pid 8123
2025-01-30 14:37:32,278 WARN received SIGQUIT indicating exit request
2025-01-30 14:37:32,279 INFO waiting for shutdown, nginx_00, php-fpm, queue-worker_00, queue-worker_01, scheduler to die
2025-01-30 14:37:32,289 WARN stopped: scheduler (terminated by SIGTERM)
2025-01-30 14:37:32,290 WARN stopped: queue-worker_01 (terminated by SIGTERM)
2025-01-30 14:37:32,295 WARN stopped: queue-worker_00 (terminated by SIGTERM)
2025-01-30 14:37:32,332 INFO stopped: php-fpm (exit status 0)
2025-01-30 14:37:32,363 INFO stopped: nginx_00 (exit status 0)
2025-01-30 14:37:32,364 WARN stopped: shutdown (terminated by SIGTERM)

** Press ANY KEY to close this window ** 

On further inspection I DID find that this docker instance IS memory limited. My apologies. I can increase the allowed memory use but I’m wondering if some optimization is needed so IN can process large reports in chunks rather than trying to allocate all the memory it needs to process a report in it it’s entirety?

Conversing with myself but what is the “standard” memory requirement or suggestion for Invoice Ninja? Seems my instance was limited to 256M and it was using all of that at idle basically. I just set it to 512M and it is using most of that at idle with no one logged into it. I have plenty of RAM just curious and I want to have enough allocated to run year end reports.

Hi,

Sorry I’m not sure, I suggest asking in a discussion on GitHub.

I will try it again with the increased memory limit. Are there no guidelines for system requirements? I’ve never felt IN to be slow in my instance but since doubling the RAM it has access to, it does feel a bit more snappy but maybe that’s in head.

It depends on the individual usage.

dockerfiles/debian/php/php.ini at debian · invoiceninja/dockerfiles · GitHub is a starter.

memory_limit is not set => 128MB

I’m still on the alpine based image but interested in trying to get the Debian based image into the unRAID docker environment.

Anyway I’m not sure what part you are responding to. My monitoring appears as though my instance has a setting to limit ram but even since double it I’ve seen it use more yet so now it appears it is not limited again :man_shrugging:

I guess there is still the question of how or why IN crashed trying to run a year long report with documents. Perhaps it is not optimized to run that big of a report…well it did produce it just without any of the documents. I guess I don’t really know what the output is supposed to be when you run an expense report with the documents option enabled it was just my assumption it was too much due memory limits “somewhere” and/or the app is able to break up a workload when there is a lot of documents. I could try the report again but I don’t want to create an issue that could cause corruption or data loss so I am hesitant.

I tried to answer your question about “…memory requirement or suggestion for Invoice Ninja?”, it depends on your deployment. 128MB is sufficient to start. 1024MB is required/recommended if you want to run the updater inside invoiceninja (not relevant for docker)

Gotcha thanks. I guess that begs the question then, why my instance crashed out running a report with well more than 128MB available to it.