Home Forums Support PhantomJs problems with Ubuntu server local PDF

This topic contains 13 replies, has 3 voices, and was last updated by  nickharding 2 months, 1 week ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #20376

    nickharding
    Participant

    Hi all, hope your all all having a good weekend.

    Ive created 2 threads on here before where i have tried hosting invoice ninja at home on a raspberry Pi and couldnt get Phantomjs working so decided to move IN over to my cloud server at digital ocean.

    Its an ubuntu server and is behind https. Everything works great apart from phantomjs and i dont believe its a HTTPS fault as ive tested it via http and https and i get the same result. Heres the error from the larvel log…

    [2019-04-13 16:11:03] production.ERROR: PhantomJS – Invalid response https://www.hardingsheatingandplumbing.co.uk/ninja/view/ueakqjpw9rr7ipk2xqnr2vi8gfzvz2pe?phantomjs=true&phantomjs_secret=wm3x0cnl4elfzxkyz6ecgy8hhnbfsxcz: {“context”:”PHP”,”user_id”:1,”account_id”:1,”user_name”:”Nick Harding”,”method”:”GET”,”user_agent”:”Mozilla/5.0 (Windows NT 6.1; WOW64; rv:66.0) Gecko/20100101 Firefox/66.0″,”locale”:”en”,”ip”:”2a02:c7f:2c5b:e000:c72:30bc:a7aa:95c8″,”count”:1,”is_console”:”no”,”is_api”:”no”,”db_server”:”mysql”,”url”:”test_headless”} []

    And here is the output from the test script..

    [email protected]:/var/www/invoiceninja# phantomjs test.pjs
    \n{
    “contentType”: null,
    “headers”: [],
    “id”: 1,
    “redirectURL”: null,
    “stage”: “end”,
    “status”: null,
    “statusText”: null,
    “time”: “2019-04-13T16:14:56.670Z”,
    “url”: “https://www.hardingsheatingandplumbing.co.uk/ninja/view/ueakqjpw9rr7ipk2xqnr2vi8gfzvz2pe?phantomjs=true&phantomjs_secret=wm3x0cnl4elfzxkyz6ecgy8hhnbfsxcz”,
    “console”: []

    and ignore ssl errors…

    }[email protected]:/var/www/invoiceninja#phantomjs –ignore-ssl-errors=yes test.pjs
    \n{
    “contentType”: null,
    “headers”: [],
    “id”: 1,
    “redirectURL”: null,
    “stage”: “end”,
    “status”: null,
    “statusText”: null,
    “time”: “2019-04-13T16:15:13.679Z”,
    “url”: “https:/www.hardingsheatingandplumbing.co.uk/ninja/view/ueakqjpw9rr7ipk2xqnr2vi8gfzvz2pe?phantomjs=true&phantomjs_secret=wm3x0cnl4elfzxkyz6ecgy8hhnbfsxcz”,
    “console”: []

    Does anyone have any advice? ive been working on this for over 2 months now and i have almost given up. I really like the system and have used it for years but i have moved homes and tried to migrate IN and reconfigure phantomjs etc and i cant sus it out.

    Cheers all!

    #20377

    Hillel Coren
    Keymaster
    #20378

    nickharding
    Participant

    Hi Hillel,

    Where can i get the 65mb prebuilt executable?

    This is what i get when i check its version..

    [email protected]:/var/www/invoiceninja/resources/lang/en_GB# phantomjs -v
    2.1.1

    Cheers.

    • This reply was modified 2 months, 1 week ago by  nickharding.
    #20380

    Hillel Coren
    Keymaster

    Sorry, I don’t know

    #20381

    nickharding
    Participant

    Why is this invoice system so unsupported? i really like the system but im so close to moving away from it.

    #20382

    Hillel Coren
    Keymaster

    I’m attempting to provide support… (and trying not to be insulted by your comment).

    Sorry, I don’t know where you can find the prebuilt executable. The advice I linked to was provided by a member of the community,

    #20383

    Titanfail
    Participant

    From what you’ve posted, it would seem the PhantomJS you have installed is fine, since it’s reporting a version number and not immediately crashing. The prebuilt binary can be found at http://phantomjs.org/download.html. In your case, it doesn’t appear to be needed, but it can’t hurt to try. Just be sure to follow the directions I gave in the other thread and remove what you have currently with apt purge (assuming you installed with apt to begin with).

    However, there does appear to be something wrong with your setup, as something is feeding bad data into PhantomJS, and that’s likely what’s causing the process to fail.

    Unfortunately, one-off issues are exceedingly difficult to track down, especially when a development team is small. They’re trying to help you. I’ve tried to help you (and I’m not even on the team, just a user). But sometimes an issue takes time to figure out, especially when it’s a one-off. Accusing the team of not supporting their software is absolute madness.

    #20384

    nickharding
    Participant

    Didn’t mean to insult, just pulling my hair out over this as been trying to get the bloody thing working for 2 months! its killing me.

    any other suggestions of testing i can try? as apart from running the test script and phantomjs from command line and getting those 2 errors i dont know what else i can do? feel like ive read nearly every page on the web about it

    #20385

    Hillel Coren
    Keymaster
    #20386

    nickharding
    Participant

    Tried all the troubleshooting steps. My invoice system is publicaly available also. Dont know what to do next, just seems i keep reading the same stuff over and over from google.

    #20387

    Hillel Coren
    Keymaster

    – Does Phantom JS Cloud work?
    – Have you tried disabling HTTPS, not just using ‘ignore-ssl-errors’

    I think the point to focus on is that the status result is null, this post has related info:

    https://stackoverflow.com/questions/12021578/phantomjs-failing-to-open-https-site

    #20388

    nickharding
    Participant

    ive tried with the ignore ssl options ..

    }[email protected]:/var/www/invoiceninja# phantomjs –ssl-protocol=any test.pjs
    \n{
    “contentType”: null,
    “headers”: [],
    “id”: 1,
    “redirectURL”: null,
    “stage”: “end”,
    “status”: null,
    “statusText”: null,
    “time”: “2019-04-13T18:46:22.482Z”,
    “url”: “https://www.hardingsheatingandplumbing.co.uk/ninja/view/ueakqjpw9rr7ipk2xqnr2vi8gfzvz2pe?phantomjs=true&phantomjs_secret=wm3x0cnl4elfzxkyz6ecgy8hhnbfsxcz”,
    “console”: []
    }[email protected]:/var/www/invoiceninja#

    Exactly the same result 🙁 i really do apprechiate your help, i just feel like im loosing it so sorry aboutb the earlier comment.

    #20391

    Hillel Coren
    Keymaster

    You aren’t the first user to be frustrated by PhantomJS, we plan to drop it in v2.

    As next steps I suggest testing with PhantomJS Cloud and seeing if disabling HTTPS in the app helps.

    #20392

    nickharding
    Participant

    Right i have an update, my URL had an “s” in it when using the testing script, so no wonder it was failing, after follwoing this… https://www.invoiceninja.com/forums/topic/attach-pdfs-to-emails-using-https-domain/ and making the changes it says “Whoops, something went wrong” so ive had to revert. after removing the “s” in the URL it gave me the pdf in text format, so it works, just need to work out why somethings going wrong apache end!

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

You must be logged in to reply to this topic.

Posted in: