Home Forums Support PhantomJS Problems/Questions (Cloud API key)

This topic contains 11 replies, has 3 voices, and was last updated by  kylegp 2 weeks, 1 day ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #23948

    kylegp
    Participant

    Hi there,

    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:
    PHANTOMJS_CLOUD_KEY=’a-demo-key-with-low-quota-per-ip-address’

    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.

    #23951

    Titanfail
    Participant

    Dumb question, but when you tried the local install, did you delete or comment out the PHANTOMJS_CLOUD_KEY from your .env file, and did you add a line for PHANTOMJS_BIN_PATH?

    #23953

    kylegp
    Participant

    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?

    #23954

    Titanfail
    Participant

    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?

    #23956

    kylegp
    Participant

    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?

    #23957

    Titanfail
    Participant

    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 phantomjs to get rid of the garbage repository version before trying to use the standalone binary.

    #23987

    bryanp
    Participant

    I have similar problems. I CAN get the cloud option to work, but not the local binary option.

    Tried everything.

    And in my case I don’t even get error logs.

    Are you using the dockerized option by any chance?

    #23991

    kylegp
    Participant

    How is your API key formatted after PHANTOMJS_CLOUD_KEY=, bryanp?

    #23999

    bryanp
    Participant

    I think it was PHANTOMJS_CLOUD_KEY: a-demo-key-with-low-quota-per-ip-address

    Are you using docker?

    #24000

    kylegp
    Participant

    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!

    #24003

    Titanfail
    Participant

    Another thing to note is that using a local version of PhantomJS requires you to set PHANTOMJS_SECRET in 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.

    #24004

    kylegp
    Participant

    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.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Posted in: