Downloading multiple Invoices Fails

Hi there,

I am using the self hosted version. When selecting multiple invoices and downloading them or printing them I receive no email / or an error when printing is chosen.

The Logs show the following error everytime I request multiple invoices to download:
[2024-06-14 19:27:31] production.ERROR: Typed property App\Jobs\Entity\CreateRawPdf::$entity must not be accessed before initialization {"userId":1,"exception":"[object] (Error(code: 0): Typed property App\\Jobs\\Entity\\CreateRawPdf::$entity must not be accessed before initialization at /home/forge/

I had it run on PHP 8.3 and after receiving the rror I have switched to PHP 8.2, since I thought it might be a compatibility issue, but turns out the switch to PHP 8.2 didn’t change anything. I have double checked and also the the jobs are running on PHP 8.2.

Does anyone have any tips if this is a hosting issue or something else?

My best,

I have a self hosted version and just tested this and could not duplicate the issue. I am using PHP 8.3 and do not have a problem. I chose 3 random, active invoices and selected download. An email was sent immediately with a link to download the zipped file including all invoices.

Doing a very quick internet search, the $entity must not be accessed before initialization is definitely a PHP error.

Have you checked your PHP logs? That should be a good place to start. I would also recommend checking in your laravel logs, there could be more information there. Do you have both PHP 8.2 and 8.3 installed? Having multiple versions has caused me some headache in the past. So, you may want to think about removing one version (I don’t think it matters which you keep for now). It also depends on which version of PHP your .env file points at.

Thanks for your feedback regarding PHP 8.3. I suppose it is not a PHP 8.3 error, so I switched back to PHP 8.3 and got rid of PHP 8.2, which I have only installed to test if it has something to do with the PHP version. Now the server only has PHP 8.3 running.

Curiously after switchting back to PHP 8.3, it is now working fine. I am not sure what changed, since the issue appeared with ?H? 8.3 originally, without PHP 8.2 being installed. Maybe this has something to do with old code being in the OPcache, just a random guess though – even though that should have been fixed by switchting the PHP version of both the queue and the server. So no clue why this was happening.

Another wild guess: the server ram is not maxed out, but it would be possible that the different queues etc reserved too much memory, if this error could be traced back to a memory issue. Not sure, just a thought.

FYI the error is from the laravel log.

Since the issue is resolved now, I declare this as closed – even though I have no clue what caused it.

1 Like

I suppose clearing the cache would have been something else to try. Glad to hear it’s working now.

Are you referring to the ram or vram of the server as a whole? Another thought is whether not the memory settings within PHP and/or PHP-fpm are set high enough for IN to run well. Because if not set high enough, it could be running out of memory that way.

Just a couple more thoughts I’d had, that was all. Glad you got it working again.