Solved InvoiceNinja PDF Downloads - Route Does Not Exist
After switching to Cloudron, we've run into an issue with our instance of Invoice Ninja.
Using the API instructions here:
We use to be able to use download a PDF using the below url structure
But after switching to Cloudron, we now receive a response of:
"message": "Route does not exist"
Other GET requests we use continue to function fine. For example, we're still able to do a GET request and get JSON for the invoice using the below url structure:
It's just the download url that's not working after our server switch.
Any ideas on how to troubleshoot this would be helpful.
@ryantrunorth Looking into this issue now. There was a invoiceninja patch release yesterday, so it could be related.
In our invoice ninja installation, both of the calls work. @ryantrunorth is there anything in the logs? Also, does the PDF download work in the browser and not just with curl?
curl -X GET https://invoices.ninja/api/v1/invoices/5 -H 'X-Ninja-Token: sometoken'
If the curl download is getting stuck, it's because you have to pass the
curl -X GET https://invoices.ninja/api/v1/download/5 -H 'X-Ninja-Token: asfd' -o foo.pdf
@tamayers Ah, the package is commenting it out for some reason. I think it's a bug in the package. I will push an update shortly.
@tamayers The package comes bundled with phantomjs at
/usr/local/bin/phantomjs(this is set as PHANTOMJS_BIN_PATH). Is there a reason why you disable this and use PhantomJSCloud ?
@girish We have seen issues with PDF generation and downloading when we use the onboard PhantomJS. The github issues from InvoiceNinja have stated that using PhantomJSCloud have fixed that.
Everything was working with PDF downloading with PhantomJSCloud on our old server (non-cloudron). Moved this install to Cloudron and it was fine until 2-3 updates ago.
This worked for us! Thank you so much!