Can't download multiple invoices

I try to download multiple invoice PDF’s but the file is not generated & the email with download link is not sent.
Same for credit notes.

Downloading the expense documents still works, the zip file is generated & I get an email with download link.

Thx
Thomas

Hi,

Are there any errors in storage/logs?

No errors in the logs, that’s the strange thing.

@david do you have any suggestions?

If I select 2 invoices, then I get an email.
But I want to select 25 & then it doesn’t work. It worked in the past for even more.

What do you see if you run php artisan queue:failed

2024-01-04 15:16:21 80c4c6da-9904-4429-982d-7966e0527b33 … database@default App\Jobs\Invoice\ZipInvoices
2024-01-04 15:14:30 b95b184b-1142-40a6-9b87-1d8fc0fecb58 … database@default App\Jobs\Invoice\ZipInvoices
2024-01-04 12:31:26 feea1f5c-2454-4d25-8be4-d83df4e3e02d … database@default App\Jobs\Invoice\ZipInvoices
2024-01-04 09:36:18 cb69c559-a948-43e3-ba1a-92ac14f00c71 … database@default App\Jobs\Invoice\ZipInvoices
2023-08-29 19:23:21 74a7c6f5-cd87-43b9-ba04-ef36b7c5705d … database@default Illuminate\Events\CallQueuedListener
2023-04-28 05:10:23 8121e202-0b49-43fe-8e79-6032004ba6c0 … database@default App\Jobs\Invoice\CreateEInvoice
2023-04-28 05:10:20 5457c83c-47e3-4640-a59b-0f7a28952afa … database@default App\Jobs\Invoice\CreateEInvoice
2022-06-02 16:54:50 93889060-8001-41d5-8605-3c7a942f72e9 … database@default App\Jobs\Entity\CreateEntityPdf
2022-06-02 16:54:44 c5bbe174-0769-4563-8b91-14b8e308d9d6 … database@default Illuminate\Events\CallQueuedListener
2022-06-02 16:54:37 d5680628-1723-48f7-8b33-e082504920dc … database@default App\Jobs\Entity\CreateEntityPdf
2022-06-02 16:54:29 710818d9-7521-4a5b-a996-8fb9d4815ce1 … database@default Illuminate\Events\CallQueuedListener
2022-06-02 16:54:03 b2362c3a-0a45-4bec-805e-18633e9d2976 … database@default Illuminate\Events\CallQueuedListener
2021-12-04 10:00:26 5c583d43-c2cd-41af-9a81-222447b12d13 … database@default Illuminate\Events\CallQueuedListener
2021-12-01 20:03:14 881ebad1-ae3f-4379-bcf0-a8e29e07d9b9 … database@default Illuminate\Events\CallQueuedListener
2021-12-01 19:36:29 a55d018d-7c58-4a9e-82db-27a8f2b6586a … database@default Illuminate\Events\CallQueuedListener
2021-11-28 12:42:33 c89f031a-9ffc-4fcc-82a6-6ffe360458cd … database@default Illuminate\Events\CallQueuedListener
2021-11-28 12:41:31 d00160d5-73ac-40fa-9822-173d23b73512 … database@default Illuminate\Events\CallQueuedListener
2021-11-28 12:35:45 e2a33126-c28b-4dad-8253-f4917842b643 … database@default Illuminate\Events\CallQueuedListener
2021-11-28 12:33:21 423cdc90-73e9-481b-a675-5de4ff353998 … database@default Illuminate\Events\CallQueuedListener
2021-09-28 13:15:29 39643e49-32b0-4fa2-a1d1-4427df03b19d … database@default Illuminate\Events\CallQueuedListener

Thanks, it looks like the jobs are failing.

There should be more details in the failed_jobs table in the database.


Illuminate\Queue\TimeoutExceededException: App\Jobs\Invoice\ZipInvoices has timed out. in /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/TimeoutExceededException.php:15

Stack trace:

#0 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Worker.php(796): Illuminate\Queue\TimeoutExceededException::forJob()

#1 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Worker.php(217): Illuminate\Queue\Worker->timeoutExceededException()

#2 /data/sites/web//vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2396): Illuminate\Queue\Worker->Illuminate\Queue\{closure}()

#3 [internal function]: Illuminate\Database\Eloquent\Model->__wakeup()

#4 /data/sites/web//vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(310): unserialize()

#5 /data/sites/web//vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(68): Illuminate\Cache\FileStore->getPayload()

#6 /data/sites/web//vendor/laravel/framework/src/Illuminate/Cache/Repository.php(99): Illuminate\Cache\FileStore->get()

#7 /data/sites/web//vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(429): Illuminate\Cache\Repository->get()

#8 /data/sites/web//vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(355): Illuminate\Cache\CacheManager->__call()

#9 /data/sites/web//app/Models/Client.php(419): Illuminate\Support\Facades\Facade::__callStatic()

#10 /data/sites/web//app/Utils/Number.php(142): App\Models\Client->currency()

#11 /data/sites/web//app/Utils/HtmlEngine.php(575): App\Utils\Number::formatMoney()

#12 /data/sites/web//app/Utils/HtmlEngine.php(789): App\Utils\HtmlEngine->buildEntityDataArray()

#13 /data/sites/web//app/Services/Pdf/PdfService.php(146): App\Utils\HtmlEngine->generateLabelsAndValues()

#14 /data/sites/web//app/Services/Pdf/PdfService.php(75): App\Services\Pdf\PdfService->init()

#15 /data/sites/web//app/Jobs/Entity/CreateRawPdf.php(102): App\Services\Pdf\PdfService->boot()

#16 /data/sites/web//app/Services/Invoice/InvoiceService.php(193): App\Jobs\Entity\CreateRawPdf->handle()

#17 /data/sites/web//app/Jobs/Invoice/ZipInvoices.php(71): App\Services\Invoice\InvoiceService->getRawInvoicePdf()

#18 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Jobs\Invoice\ZipInvoices->handle()

#19 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

#20 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

#21 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()

#22 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()

#23 /data/sites/web//vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call()

#24 /data/sites/web//vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()

#25 /data/sites/web//vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

#26 /data/sites/web//vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()

#27 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(124): Illuminate\Bus\Dispatcher->dispatchNow()

#28 /data/sites/web//vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()

#29 /data/sites/web//vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

#30 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(126): Illuminate\Pipeline\Pipeline->then()

#31 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()

#32 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\Queue\CallQueuedHandler->call()

#33 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\Queue\Jobs\Job->fire()

#34 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\Queue\Worker->process()

#35 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\Queue\Worker->runJob()

#36 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(138): Illuminate\Queue\Worker->daemon()

#37 /data/sites/web//vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(121): Illuminate\Queue\Console\WorkCommand->runWorker()

#38 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()

#39 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

#40 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

#41 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()

#42 /data/sites/web//vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()

#43 /data/sites/web//vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()

#44 /data/sites/web//vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()

#45 /data/sites/web//vendor/laravel/framework/src/Illuminate/Console/Command.php(181): Symfony\Component\Console\Command\Command->run()

#46 /data/sites/web//vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run()

#47 /data/sites/web//vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()

#48 /data/sites/web//vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()

#49 /data/sites/web//vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()

#50 /data/sites/web//artisan(37): Illuminate\Foundation\Console\Kernel->handle()

#51 {main}

It seems to be a Timeout. Any ideas on the cause? It worked in the past for more documents at once.

@david what do you think about adding this to the job file.

public $timeout = 0;

Forcing on the class isn’t ideal, the best solution here is to define the timeout within the queue:work command

/usr/bin/php8.1 /path/to/invoiceninja/artisan queue:work --sleep=3 --tries=1 --memory=768 --timeout=10800

I’d never advise a timeout of 0, something very long like 3hrs (10800) would be the max i would suggest

2 Likes

I adapted this & restarted the queue & now it’s working.

Thanks! :wink:

Hi,

i have the same Problem. Where can i adapt this?

Thanks.

You need to login via SSH on your hosting package and run the command @david posted.
@david , is this something that will be fixed in the near future? Because I still needed to do this to download my invoices.