[SOLVED] PDF not generating

I am unable to generate PDFs in preview.

This is the status message I’ve received
exception in stage4 chrome preview. see meta.trace for details on all fatal errors found. errMsg=load targetUrl failed, probable cause: invalid domain. rawMsg=net::ERR_NAME_NOT_RESOLVED at http://invoice.example.com/tmp_pdf/8CeJJ3MQMucy0rmB5lROf0ZXf8zqKfRt

The domain is from a local DNS server that is assigned to Ubuntu 20.04 server from DHCP server. The server can resolve domains from local DNS server. Obviously Chrome is not using my DNS server but probably 8.8.8.8. Additionally, setting my domain in /etc/hosts does not work as well. The PDF is generated because I can access it over the link tmp_pdf link.

Hey there!

Thanks for reporting this to us. In order for us to debug this, can we know how you installed Invoice Ninja? Was it using some guide on forum, Docker or your own manual install?

Thanks!

That may be your issue - this does all seem like DNS - the client computer running Chrome might need to point to your “local DNS Server” instead of 8.8.8.8

The common approach to all this is making the domain known to the greater internet and using it that way, but if you’re doing it locally only, the 8.8.8.8 DNS server won’t resolve that domain.

@ben I followed the guide from here.

@cwl I do not want to register the domain that points to my local IP. Do you know how to point the chrome that invoiceninja uses to my local DNS?

I hear you, sometimes that’s how you want to do things.

First and foremost you have to have a dns server on your local network. Sharing what particular software that is here might help others help you better. Software like BIND (on linux) or Dual DHCP DNS (on Windows) will do it.

Since I know too little about your environment, I can’t help more with the how, but eventually with a DNS server and hosts setup, and the client computer running Chrome pointing at this new DNS server (test it with either nslookup or ping) and the DNS will trnaslate those hosts to an ip address.

As another side point, if you just want a quick way to get the client running Chrome to see the domain and hosts locally, just edit the hosts file - it’s quick and dirty, but may help you work through the concept. This file is ususally located:
Windows: C:\Windows\System32\drivers\etc
Linux: /etc/hosts

@cwl that you for the help.

I was a dummy and didn’t pop my stash that holds one important env (SNAPPDF_EXECUTABLE_PATH=/usr/bin/chromium-browser) so it used remote phantomjs instance.

Apology for the troubles!

Thanks for letting us know that it worked.

Note, you can also download local revision of Chromium to make it work with:

./vendor/bin/snappdf download

For never versions of Invoice Ninja, this command is ran for you after composer installation or update.

1 Like