Error 403: invalid token when trying to show/download invoices via web (self-hosted)

Hi,

I am using v5.8.3-C123 as a self-hosted install (docker).
The pdf generation in itself works. PDF is show in the creation of the invoice and also in the mobile/desktop app. Email sending works too. But when trying to download the pdf or showing it fullscreen on the website it shows the error 403: invalid token.

Reproduction
Edit an invoice and click on “Show PDF” in the upper right corner. Download doesn’t work either.

Hi,

It looks like you’re using the latest backend with an older version of the web app. You may need to clear your cache to see the latest version, or alternatively you can download the desktop app.

Maybe. Thing is I don’t know why I am still on an older version of the web app. I tried various browsers (chrome, firefox, edge, vivaldi) and cleared the caches to no avail. I have the feeling it is related to the actual files on my drive that are being served to the browser.

Is it possible that the mapped paths of the docker storage don’t get updated properly (storage, public)? What can I safely delete in these folders so that docker recreates it?

Are you using Cloudflare or any external service which may be caching the files?

Nope, only caddy as a reverse proxy inbetween.

So this has been solved. Sadly I don’t know exactly by what action.

Here is what I did.

I deleted storage/framework/cache

  • ran
    php artisan optimize
    php artisan config:cache
    php artisan route:cache
    ?clear_cache=true

Afterwards I cleared the cache of the browser once more and am now on C147.

The Error 403 is now gone.