Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved InvoiceNinja PDF Downloads - Route Does Not Exist

    Invoice Ninja
    invoiceninja
    3
    9
    598
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      ryantrunorth last edited by

      After switching to Cloudron, we've run into an issue with our instance of Invoice Ninja.

      Using the API instructions here:
      https://invoice-ninja.readthedocs.io/en/latest/api.html

      We use to be able to use download a PDF using the below url structure
      https://account.website.com/api/v1/download/6488

      But after switching to Cloudron, we now receive a response of:
      "error": {
      "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:
      https://account.website.com/api/v1/invoices/6488

      It's just the download url that's not working after our server switch.

      Any ideas on how to troubleshoot this would be helpful.

      Thank you!

      1 Reply Last reply Reply Quote 0
      • girish
        girish Staff last edited by

        @ryantrunorth Looking into this issue now. There was a invoiceninja patch release yesterday, so it could be related.

        1 Reply Last reply Reply Quote 0
        • girish
          girish Staff last edited by

          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 -o option.

          curl -X GET https://invoices.ninja/api/v1/download/5 -H 'X-Ninja-Token: asfd' -o foo.pdf
          
          1 Reply Last reply Reply Quote 0
          • T
            tamayers last edited by

            @girish I work with @ryantrunorth. I believe this is an issue with PhantomJSCloud. I am trying to use PhantomJSCloud but it keeps getting commented out of the .env file on restart.

            #PHANTOMJS_CLOUD_KEY=XXXX

            1 Reply Last reply Reply Quote 0
            • girish
              girish Staff last edited by

              @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.

              1 Reply Last reply Reply Quote 1
              • girish
                girish Staff last edited by

                @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 ?

                T 1 Reply Last reply Reply Quote 0
                • T
                  tamayers @girish last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • girish
                    girish Staff last edited by

                    @ryantrunorth @tamayers I have pushed an update to invoice ninja. After update, uncomment out the PHANTOMJS_CLOUD_KEY line and restart the app. Let me know if that works.

                    1 Reply Last reply Reply Quote 0
                    • T
                      tamayers last edited by

                      This worked for us! Thank you so much!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Powered by NodeBB