Hi,
Many thanks for making Invoice Ninja available to the community.
I’ve installed Invoice Ninja v4.5.6 on a Debian Stretch server running Apache2 which sits behind a nginx proxy (also running Debian Stretch). Everything is working great, except invoice PDFs are not being attached to emails sent out. I have read the various reports on the forum, but have not yet been able to make it work. I feel I’m pretty close and would very much appreciate your help finding the issue.
Invoices are attached successfully when I use PhantomJS Cloud, but I really hope I can avoid having to send my invoices through the cloud. Another reason, perhaps more important, is that access to the server is restricted and I would very much prefer to keep it that way instead of having to make it accessible to PhantomJSCloud and thus to the world.
I’m using PhantomJS v2.1.1 installed from the Debian repositories. Relevant contents of .env are:
APP_URL=https://<my.domain.com>
REQUIRE_HTTPS=true
PHANTOMJS_SECRET=verysecret
PHANTOMJS_BIN_PATH=/usr/bin/phantomjs
PHANTOMJS=phantomjs-2.1.1-linux-x86_64
TRUSTED_PROXIES=<IP-address-of-nginx-proxy>/32
From laravel-error.log:
production.ERROR: PhantomJS - Invalid response https://<my.domain.com>/view/dkx8i3asloqichtckz7l9dntj6wck0nv?phantomjs=true&phantomjs_secret=verysecret: {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:"<company name>",“method”:“PUT”,“user_agent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0”,“locale”:“en”,“ip”:"<client-ip-address>",“count”:9,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“invoices/3”} []
Running phantomjs test.pjs with the URL from the laravel-error log results in something that looks good, well… I think it does. Note PDF encoded text removed.
\n{
“body”: “”,
“bodySize”: 185,
“contentType”: “text/html”,
“headers”: [
{
“name”: “Server”,
“value”: “nginx/1.10.3”
},
{
“name”: “Date”,
“value”: “Tue, 04 Dec 2018 05:06:10 GMT”
},
{
“name”: “Content-Type”,
“value”: “text/html”
},
{
“name”: “Content-Length”,
“value”: “185”
},
{
“name”: “Connection”,
“value”: “keep-alive”
},
{
“name”: “Location”,
“value”: “https://<my.domain.com>/view/dkx8i3asloqichtckz7l9dntj6wck0nv?phantomjs=true&phantomjs_secret=verysecret”
}
],
“id”: 1,
“redirectURL”: “https://<my.domain.com>/view/dkx8i3asloqichtckz7l9dntj6wck0nv?phantomjs=true&phantomjs_secret=verysecret”,
“stage”: “start”,
“status”: 301,
“statusText”: “Moved Permanently”,
“time”: “2018-12-04T05:06:10.334Z”,
“url”: “http://<my.domain.com>/view/dkx8i3asloqichtckz7l9dntj6wck0nv?phantomjs=true&phantomjs_secret=verysecret”,
“content”: “<head></head><body>data:application/pdf;base64,<base64-encloded-pdf-removed>body>”,
“console”: []
I’ve tried various entries in /etc/hosts (such as <local-ip-address>, 127.0.0.1, <public-ip-address>
kind regards,
Jan