March 18, 2020 at 1:18 pm #23948
I’ve had zero luck getting a localized PhantomJS working after checking every suggestion I could find, it simply doesn’t work. I just get “Failed to load PDF document.” when testing in Chrome and in the laravel error logs the “Invalid response” as many others experience. If I try the phantomJS test script, it works but it won’t work from invoice ninja.
I’ve tried repository installs, manually installing and ensuring permissions are correct for phantomjs but it just simply doesn’t work despite everything I’ve tried.
I’m happy to use PhantomJS cloud but that doesn’t work either. I signed up for a phantomJS cloud and have an API key.
In the Invoice Ninja documentation, it says I need to modify this entry:
My API key has hypens (eg. ak-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx).
My questions are:
1. Do the hyphens for the API key need to be there or not?
2. Do the apostrophes need to be there at either ends of the API key for the PHANTOMJS_CLOUD_KEY entry?
I have tried just about everything and enabled “attach PDF” under email settings. There is simply no PDF attached to the emails, only an XML file (which I don’t actually want to be attached?)
I have also tried with and without a random entry in the .env file for PHANTOMJS_SECRET=.
Any ideas of what else I could try to get PhantomJS cloud working? I’m out of luck.March 19, 2020 at 7:49 am #23951
Dumb question, but when you tried the local install, did you delete or comment out the
PHANTOMJS_CLOUD_KEYfrom your .env file, and did you add a line for
PHANTOMJS_BIN_PATH?March 20, 2020 at 12:51 am #23953
Titanfail, yes I did. I never used PHANTOMJS_CLOUD_KEY and PHANTOMJS_BIN_PATH at the same time in the .env file.
Everytime I made a change I also restarted apache2 for good measure.
I’ve given up on the local install working, but I can’t even get the cloud working.
Do you have any insight to the formatting questions above you could assist with?March 20, 2020 at 1:26 am #23954
I think something might have changed in newer versions of PhantomJS Cloud, because I can’t get it working either. I have a local binary that works, so I just stick with that.
AFAIK, if the key they give you has hyphens, those stay in, and the singlequotes get dropped as they’re just enclosing the key to separate it from any other text surrounding it.
Out of curiosity, what was your path when you tried the local install?March 20, 2020 at 2:50 am #23956
Okay so I’ll consider PhantomJS cloud broken at the moment if it’s also not working for you.
I tried using /usr/local/bin/phantomjs and also /usr/bin/phantomjs. Of course moving the binary location accordingly.
I set the permissions to -775 each time and had played around trying different users, including root:root.
In my laravel error log I just got the “production.ERROR: PhantomJS – Invalid response”
I tried also editing my hosts file and changing the invoice ninja URL etc. but just got the same error regardless.
Which local binary version are you using and do you remember where you got it from?March 20, 2020 at 4:07 am #23957
I’m using the pre-built 2.1.1 binary from https://phantomjs.org/download.html and stuck it in /usr/bin/ with permissions set at 775 and the owner as root.
It shouldn’t make a difference, but I also did a quick
apt purge phantomjsto get rid of the garbage repository version before trying to use the standalone binary.March 20, 2020 at 11:20 am #23987
I have similar problems. I CAN get the cloud option to work, but not the local binary option.
And in my case I don’t even get error logs.
Are you using the dockerized option by any chance?March 20, 2020 at 1:40 pm #23991
How is your API key formatted after PHANTOMJS_CLOUD_KEY=, bryanp?March 20, 2020 at 4:05 pm #23999
I think it was
Are you using docker?March 20, 2020 at 4:09 pm #24000
Nah, not using docker.
Not sure why I can’t get either working. At this rate I think I’ll try getting it working tomorrow for the last time and if I can’t I’ll wait for invoice ninja V2 in order to use the PDF attachment feature!March 21, 2020 at 9:26 am #24003
Another thing to note is that using a local version of PhantomJS requires you to set
PHANTOMJS_SECRETin the .env file. This can be pretty much any alphanumeric string you want.
When I comment out that line in my .env file, I get “Invalid Response” in the laravel error log as well. Uncomment the line, it’s back to working again.March 21, 2020 at 9:33 am #24004
Thanks for the suggestion however I mentioned this in my original post.
I tried with and without a random numeric value for PHANTOMJS_SECRET and it made no difference.
You must be logged in to reply to this topic.