Unable to open Bulk PDF Downloads (Emailed link)

Version 5.12.0

Environment Truenas Community Edition

Checklist

  • Tested in the demo? - No (Option can’t be found)
  • Checked for existing issues? - Yes closest issue is Batch PDF download: 404 error (v5.2.14-C56) - #2 by hillel
  • Have you inspected the logs in storage/logs/laravel.log for any errors? - Yes I can’t find them or the /logs/ folder in storage just a /framework/ folder.

Describe the bug

I’m trying to bulk download PDF’s via selecting multiple in the invoices view and then under actions clicking ‘Download PDF’. A notification comes up saying “An email will be sent with the PDF’s”. Then when the email is recieved it displays a 404 error page. The URL Presented is
/storage/cjsOLvHRCdacmCCrJmhSCLSYsmqqkKrk/89IwzoqYrVTl3az4L1EqLiIXhzRvvVL7fuVpobkZ/GOIqhpU7IBZYzQs4b4kJjVVJ3g3cMLZI/invoices/2025-06-25_Invoices.zip

But as mentioned there’s no subfolders under storage except /framework/ I’m assuming there’s an issue with permission in the TrueNAS datasets but the datasets have the same permissions as the DB ones and they’re working fine (Including downloading emailed backups)

Steps To Reproduce

  • Go to the invoices page.
  • Select multiple invoices.
  • Click Actions → Download PDF’s
  • Open email and click download
  • 404 Error screen is returned.

Expected Behavior

2025-06-25_Invoices.zip should download

Additional context

Screenshots

Logs

Hi,

I assume it’s a configuration issue but I’m not sure exactly, here’s what ChatGPT suggests in case it’s helpul.

Thanks for the detailed report. Based on your environment and symptoms, here’s what’s likely happening and how to resolve it.


:light_bulb: Problem Summary

The bulk download feature in Invoice Ninja generates a ZIP of PDFs, stores it in the storage folder, and emails you a direct link to that file. The 404 you’re seeing means the file either doesn’t exist, was deleted, or is inaccessible via the web.

Since you’re running on TrueNAS Community Edition, permissions and storage mounts are likely culprits.


:white_check_mark: What Should Be There

The ZIP file should be saved at something like:

storage/app/public/invoices/2025-06-25_Invoices.zip

And accessible via:

yourdomain.com/storage/...

Which is symbolic for:

public/storage → storage/app/public

:magnifying_glass_tilted_left: Things to Check

1. Does the file exist?

SSH into your server or use the TrueNAS shell:

ls -la storage/app/public/invoices/

If the file isn’t there, the job failed to write it.


2. Is the symbolic link missing?

Run this from your app root:

php artisan storage:link

This creates the public/storage symlink.


3. Check write permissions

Ensure your web server can write to storage/:

chmod -R 775 storage
chown -R www-data:www-data storage  # or your PHP/web user

On TrueNAS, this can get tricky with datasets. Make sure ACLs or POSIX permissions actually allow PHP to write.


4. Check Laravel logs

You said there’s no storage/logs, but this means the app can’t write logs — another sign of permission issues. Try:

mkdir -p storage/logs
touch storage/logs/laravel.log
chmod -R 775 storage/logs

Then retry the download process and check the log:

tail -f storage/logs/laravel.log

5. Check if queue is working

Bulk PDF generation uses a queued job. Run this to see failed jobs:

php artisan queue:failed

And process the queue manually:

php artisan queue:work

:hammer_and_wrench: Fix Summary

  1. Ensure php artisan storage:link is set up.
  2. Verify the file exists in storage/app/public/....
  3. Ensure proper write permissions to the storage/ and bootstrap/cache/ directories.
  4. Confirm the queue is running and processing jobs.

:speech_balloon: Final Tip

If everything else works (like backups), but the bulk PDF download fails, it’s likely:

  • Either the file is being generated but deleted before being downloaded,
  • Or the symbolic link isn’t allowing it to be accessed publicly.

Let me know what you find from the above checks, and I can help further.

Kia ora Hillel,

Thank you for the response I’ve tried to follow those instructions but honestly they’re going a little over my head. I’ve enable all permissions for the folder for all users and it’s still running into issues.

I’ve also just noticed the company logo for the account isn’t saving either I assume that’s because it’s having write issues as well. I’ve asked on the TrueNAS forums and they’ve referred me back here as well.

Below is the only relevant logs I can get from the truenas logs being generated so it’s creating everything fine it’s still just not -saving- them.

2025-06-27 09:30:18 App\Jobs\Invoice\ZipInvoices xkLNE3GpN9PgP9A9O5z7QQG9CNzp3xXh RUNNING
2025-06-27 09:30:34 App\Jobs\Invoice\ZipInvoices xkLNE3GpN9PgP9A9O5z7QQG9CNzp3xXh 15s DONE
2025-06-27 09:30:34 App\Jobs\Mail\NinjaMailerJob dsaN5Wnvxjwh9CnDPu17j1h0AQptuspP RUNNING
2025-06-27 09:30:39 App\Jobs\Mail\NinjaMailerJob dsaN5Wnvxjwh9CnDPu17j1h0AQptuspP 5s DONE
2025-06-27 09:30:39 App\Events\Socket\DownloadAvailable tfXMa5NYwPvsIdRgdWoI2PeiNRxnfO6c RUNNING
2025-06-27 09:30:39 App\Events\Socket\DownloadAvailable tfXMa5NYwPvsIdRgdWoI2PeiNRxnfO6c 13.84ms DONE

Did you try running php artisan storage:link