Email/PDF Issues

Hi there,

I’ve recently just installed v5 after i borked my recent install of v4. I realised this was legacy and didn’t have much on it so just decided to switch to 5.

5 was a fresh install. However, since installing v5 i can’t seem to view the PDFs which are created. It seems to just hang and then i get TimeoutException after 0:00:30.000000: Future not completed. I can migrate to /var/www/invoice-ninja/public/storage/XXX/XXX/Invoices and there’s a single PDF in there which is completely blank.

I’ve tried a number of the PDF options and i’m still having this issue.

ErrorException:
file_get_contents(https://xxxxxx.co.uk/dZCoGOahcMDBvvObZfALtzpSZBRrxou5/mIIspibnSDReojuFcNbxKOBFsfTKUNzNYKijtS1b.png): failed to open stream: Connection timed out

The fie itself is there and i’ve re-ran the permissions several times. So it looks like the PDF cannot be generated due to the logo? Ive tried removing my custom logo but it then cannot locate new_logo.png under /public/images.

Currently at a loss here. Hopefully someone can help me

Thanks,

Hi,

It may help to add LOCAL_DOWNLOAD=true in the .env file

https://invoiceninja.github.io/docs/env-variables/

@dadams19

If you enter that URL into your browser, do you see your logo? The full path doesn’t look quite right.

@hillel I’ve tried that and i can now download the PDFs however, they’re blank and i get a non secure download.

@david I entered the URL into my browser and i got a timeout. However, i’ve got debugging enabled and that’s where i got the following:

[2022-01-09 23:45:00] production.ERROR: file_get_contents(https://pay.adamsitsolutions.co.uk/images/new_logo.png): failed to open stream: Connection timed out {“userId”:1,“exception”:"[object] (ErrorException(code: 0): file_get_contents(https://pay.adamsitsolutions.co.uk/images/new_logo.png): failed to open stream: Connection timed out at /var/www/invoice-ninja/app/Models/Presenters/CompanyPresenter.php:73)

This means that your system cannot resolve itself, fyi i was able to hit that URL and it returns normally.

There could be some kind of firewall blocking, or your internal DNS needs to be updated someway so that the server can resolve itself.

Hi David,

I’ve just attempted the link myself and i’m able to access it. Note, i’m currently not connected to my VPN. I’ll attempt to connect to my VPN and try again and update you.

Hi @david

So i’m still investigating as to why my VM cannot communicate with itself (well it can just not by http or https). However, I want to understand as to why the VM needs to contact it’s HTTPS address when the content is already on the VM itself?

From my understanding what’s happening is:

Internal IP > To pay.adamsitsolutions.co.uk > Which then queries itself?

I’m probably not explaining it correctly but from my understanding that’s what is happening.

Update:

DNS was my issue … it’s always DNS they say.

However, PDF preview panel still refuses to load. Is this something you’ve seen before?

@dadams19

ok progress!

Are there any new errors in the logs?

If you are running behind a proxy ensure you have TRUSTED_PROXIES=* (or replace * with your trusted IPs)

@david Much further than before.

I believe it’s in fact a bug. PDFs are displaying perfectly fine via the desktop apps on MacOS and Windows. However, as soon as I attempt to display via a browser such as Chrome/Edge/Firefox we get into a continuous spin as seen below:

Thanks,

@dadams19

can you open your browser console and see what the error is, most likely the URL isn’t resolving.

@david appreciate all your help on this one thank you so much.

Console indicates it was loading over HTTPS but was requesting HTTP so was therefore being blocked. Had a look at my .env file and the site was set at http:// instead of https:// updated that, and it’s working now.

Again, thanks for all your help here, David.

Darren