Proposal PDF download error

Hi,

After I created a proposal and tried to download it after saving the it the downloaded PDF file has zero bytes even though it can easily seen via the portal. Would you know how I can download a proposal PDF and view it on my computer?

Thanks.

Are you using invoiceninja.com or are you self hosting?

Self Hosting. I forgot to mention that in my previous post.

  • Does the ‘test’ link by ‘Attach PDF’ work on /settings/email_settings
  • Are there any errors in storage/logs/laravel-error.log
  • Yes
  • Yes. See below.

[2018-05-25 15:59:28] production.ERROR: PhantomJS - Unable to decode [WEBSITE URL]/public/view/yskzkzj4giaqkp7hqayqnkqmobktxseo?phantomjs=true&phantomjs_secret= {“context”:“PHP”,“user_id”:1,“account_id”:“1”,“user_name”:"[USERNAME]",“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36”,“locale”:“en”,“ip”:"[IP ADDRESS]",“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“payments”}

Do you require a password for your clients? You may need to set a value for phantomjs_secret

http://docs.invoiceninja.com/en/latest/configure.html#troubleshooting

No.

I’ve tried setting the phantomjs_secret to a random string, but then the ‘test’ link by ‘Attach PDF’ in /settings/email_settings does work.

Are you using the latest version?

The error has ‘public/view/yskzkzj’ but for a proposal I’d expect to see ‘public/proposal/yskzkzj’

v4.4.3

Try deleting the error log, downloading a proposal and then checking for errors.

I’d like to confirm we’re looking at the right error

Done. Below is a recent error code.

[2018-05-29 05:51:11] production.ERROR: PhantomJS - Unable to decode [WEBSITE]/public/view/yskzkzj4giaqkp7hqayqnkqmobktxseo?phantomjs=true&phantomjs_secret=EUsNoFNaP {“context”:“PHP”,“user_id”:1,“account_id”:“1”,“user_name”:"[username]",“method”:“GET”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36”,“locale”:“en”,“ip”:"[IP]",“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“test_headless”}

What do you see if you try loading the link in a browser with phantomjs set to true or false?

Would I need to update/add the phantomjs true or false setting in the .env or somewhere else?

In the link: qmobktxseo?phantomjs=true&phantomjs

True: It seems fine, but download still is zero byte.
False: It gives a long base64 code

Here is another error code that may be helpful.

[2018-05-29 05:51:10] production.ERROR: TypeError: Attempting to change value of a readonly property. {“context”:“JavaScript”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“user_agent”:“Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) Safari/534.34 PhantomJS/2.0.0 (PhantomJsCloud.com/2.0.1)”,“locale”:“en”,“ip”:“35.184..”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“log_error”} []

Have you tried downloading in both the admin part of the app and the client portal?

If you want to email a proposal link in the client portal to contact@invoiceninja.com it may help me debug it.

Yes.

Done.

Thanks! I notice you have ‘/public’ in your app url, it could be related. Have you tried removing it?

Also, have you tried downloading from the admin area of the app?

No problem. I’ve tried removing it but that throws a “Not Found/ 404 Error”.

Yes, but that PDF document still shows zero bytes.

From: http://docs.invoiceninja.com/en/latest/install.html

To remove public/ from the URL map the webroot to the /public folder, alternatively you can uncomment RewriteRule ^(.*)$ public/$1 [L] in the .htaccess file.