PDF Generation failed/Invoice Locking error

how should i go about doing that?

@david I have it now and PDF’s are still not working on either version

this is the error i get now


<!DOCTYPE html>
<html lang="en">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Server Error</title>

        <!-- Fonts -->
        <link rel="dns-prefetch" href="//fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

        <!-- Styles -->
            html, body {
                background-color: #fff;
                color: #636b6f;
                font-family: 'Nunito', sans-serif;
                font-weight: 100;
                height: 100vh;
                margin: 0;

            .full-height {
                height: 100vh;

            .flex-center {
                align-items: center;
                display: flex;
                justify-content: center;

            .position-ref {
                position: relative;

            .code {
                border-right: 2px solid;
                font-size: 26px;
                padding: 0 15px 0 15px;
                text-align: center;

            .message {
                font-size: 18px;
                text-align: center;
        <div class="flex-center position-ref full-height">
            <div class="code">
                500            </div>

            <div class="message" style="padding: 10px;">
                Server Error            </div>

@david @hillel are there any other steps i should attempt to fix this?

@david @hillel I got the pdf generation working I had to add these flags to the .env
SNAPPDF_CHROMIUM_PATH=/snap/bin/chromium(i struggled to find the bin for chromium but it turns out in Ubuntu 20.04 composer installs it using snap, so it ends up in /snap/bin)

Once I added those lines the PDF’s would generate but the logo would not and this would show in it’s place.
2021-04-18 21_18_34-Invoice Ninja

I can access the url by pasting the location in my url bar and it shows up in my logs.

[2021-04-18 20:51:04] production.INFO: the path http://invoicet.kt.loc/storage/2aFJosTJjiRb54D6aLQIsLKFes0NQ2bDVJ5hfLvKacLPe3uOW7HfRaanfVbIuaAi/ZAtmJ0e3WVFwLrxZlfX0tQ70JFgE2SCbWNGhCkwM.png
[2021-04-18 22:30:41] production.ERROR: The file "/var/www/html/ninja/public/storage/2aFJosTJjiRb54D6aLQIsLKFes0NQ2bDVJ5hfLvKacLPe3uOW7HfRaanfVbIuaAi/uB46xNk5KUTUnitIVjdTFuuCiwpQqlTNM766EN96/invoices/INV-2020-0001.pdf" does not exist {"exception":"[object] (Symfony\\Component\\HttpFoundation\\File\\Exception\\FileNotFoundException(code: 0): The file \"/var/www/html/ninja/public/storage/2aFJosTJjiRb54D6aLQIsLKFes0NQ2bDVJ5hfLvKacLPe3uOW7HfRaanfVbIuaAi/uB46xNk5KUTUnitIVjdTFuuCiwpQqlTNM766EN96/invoices/INV-2020-0001.pdf\" does not exist at /var/www/html/ninja/vendor/symfony/http-foundation/File/File.php:36)

Also I am still having the issue where I cannot edit any drafted invoices when it is set to Lock When Sent.


is your system publicly accessible? the image would need to be resolvable.

It is only accessible within my network but It has an internal domain name that resolves to the IP

Hi @kwassef, the problem might be the snap chromium confinement which seem to prevent snappdf getting their headless user flags beeing paresed. It took me hours to find a solution which works even with snakeoil self-certified local domains like .loc or .intranet.
Try this call chromium via “backdoor” confinement-free:
If not, a trutworthy build is offered by suse here:


If all I should do is change this line
to this
and then run php artisan optimize
It did not seem to change anything as the logo is still a broken image

Hi @kwassef, I see. In your early post your Invoice Ninja looked like beeing served over https: - - [13/Apr/2021:10:29:45 -0400] “GET /client/invoice/sGJ5ckZMN1j45KetY7nK8vggNPr2MpLhctqNEBYyfCS885pwXSVodQGktLHk9M9C/download_pdf HTTP/2.0” 500 1558 “https://invoicet.kt.loc/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64)

But the logo seems to be pulled over http not https which might cause the exclusion due to strict cert-error-handling in lastest chromium.

[2021-04-18 20:51:04] production.INFO: the path http://invoicet.kt.loc/storage/2aFJosTJjiRb54D6aLQIsLKFes0NQ2bDVJ5hfLvKacLPe3uOW7HfRaanfVbIuaAi/ZAtmJ0e3WVFwLrxZlfX0tQ70JFgE2SCbWNGhCkwM.png

Did you follow this guide which includes a self-certified installation?

I have managed to setup a local non public facing test installation on ubuntu 20.04.2 lts server on rpi with no missing Logos. Snappdf has updated this issue. It should to list


somewhere in the source it you look up i.e. here

nano /srv/invoiceninja/vendor/beganovich/snappdf/src/Snappdf.php

But maybee its better to refresh nginx too, because in first attempts I forgot to do this an all changes to http/https where not affected:

sudo service nginx reload
sudo service nginx restart

Self certified install is just an easy example method to get running and testing. It will work by authorizing the provider manually, but public facing sites will require a CA provided cert like Letsencrypt which is popular and free, but I would not write a guide on setting up that for every use case. Just to be clear.

The steps I took were very similar to the guide and snappdf does have the --ignore-certificate-errors in Snappdf.php but i am still not getting a logo

hello @kwassef, I assume your evaluation install is not ssl-encrypted or was setup unencrypted and later changed to https via .env edit. Try to setup with self-encrypted on a fresh install. Side-Loading unencrypted content is a security issue and not working with headless chrome. The invoices are genrated in /tmp where you can find files named like this html_YLgVxJ.html
they contain:

<img class=“company-logo” src="http://xyz.intranet/storage/g3f…

but they should use https.

Thats the reason why IN-Footer-Logo shows off properly but user storage content does not.

I deliver https through an nginx reverse proxy, recently I switched it to http to test if the logo would work but still no luck. Also I have a redirect in place for all http requests in my nginx config. so http://invoice.ninja would instantly be redirected to https://invoice.ninja

Hi @kwassef,

it seems that it is a proxy issue.

Maybee @ben can give you an advice wether it is reasonable to add something like below into the snappdf chromium flags (for testing):

-- proxy-server=http://…
-- allow-insecure-localhost
-- proxy-bypass-list

@kwassef can you see if the flags provided by @cdahinten works for you? If so, I’ll adapt them into snappdf, no problem. Thanks.

not having any luck after adding them
just to be sure is this how i would fill these out?(the proxy is hosted on the same machine as the invoice ninja)

Hi @kwassef,

I looked up here for the settings. I made a mistake with quotes:


or if running unencrypted


or in Snappdf.php i.e. like here.


Another issue might be the .loc top-level domain. You can try change to .test.

1 Like

No luck :pensive:
I probably misspoke, all of my sites are on the same machine, so I don’t think i have nginx setup as a reverse proxy, I just have it to serve certain folders when a request is made with a certain subdomain. Also sorry if I am not very understanding, i am still trying to learn all of this stuff.

One thing that might help is switching to our beta cloud PDF generation service.

That is out of my scope, so @david should be able to provide more info if registration for it is open at the moment.



Please see here, our hosted PDF platform is in beta