New Install, can't print/dl invoices

Using the Turnkey Linux install of IN, everything works fine except when I try to print or download an invoice, it just spins it’s wheels and I get nothing.

I’ve gone into the invoice design and if I turn on HTML viewing, I can see an invoice there, but there seems to be no way to actually get an invoice to print or display at the actual invoice page.

I tried looking for a log file that might help show what’s going wrong, I suspect it’s something with the snappdf generator but I’m not sure how to test or fix that.

Running server on Debian with 5.15.60 kernel, version of IN is v5.5.48-C102

from the commandline try:

./vendor/bin/snappdf download
root@invoice-ninja .../www/invoiceninja# ./vendor/bin/snappdf download
Chromium binary already downloaded. Provide --force to download again.
root@invoice-ninja .../www/invoiceninja# ./vendor/bin/snappdf download --force
Starting download. Revision: 1084837
Download completed. Extracting the zip archive.
Archive extracted.
Completed! 1084837-Linux_x64 currently in use.
root@invoice-ninja .../www/invoiceninja# reboot

Still sitting there spinning, no pdf displayed. Tried in Chromium and Firefox.

@ikidd

What happens if you try the following from the command line

./vendor/bin/snappdf convert --html "<h1>Hello world!</h1>" test.pdf
root@invoice-ninja .../www/invoiceninja# ./vendor/bin/snappdf convert --html "<h1>Hello world!</h1>" test.pdf
-bash: !: event not found
root@invoice-ninja .../www/invoiceninja# ./vendor/bin/snappdf convert --html "<h1>Hello world</h1>" test.pdf

In Snappdf.php line 260:
                                                                                                                                                     
  The command "'/var/www/invoiceninja/vendor/beganovich/snappdf/versions/1084837-Linux_x64/chrome-linux/chrome' '--headless' '--disable-gpu' '--dis  
  able-translate' '--disable-extensions' '--disable-sync' '--disable-background-networking' '--disable-software-rasterizer' '--disable-default-apps  
  ' '--disable-dev-shm-usage' '--safebrowsing-disable-auto-update' '--run-all-compositor-stages-before-draw' '--no-first-run' '--no-margins' '--no-  
  sandbox' '--print-to-pdf-no-header' '--hide-scrollbars' '--ignore-certificate-errors' '--print-to-pdf=/tmp/pdf_3tvP1x.pdf' '/tmp/html_vDBGOy.html  
  '" failed.                                                                                                                                         
                                                                                                                                                     
  Exit Code: 127(Command not found)                                                                                                                  
                                                                                                                                                     
  Working directory: /var/www/invoiceninja                                                                                                           
                                                                                                                                                     
  Output:                                                                                                                                            
  ================                                                                                                                                   
                                                                                                                                                     
                                                                                                                                                     
  Error Output:                                                                                                                                      
  ================                                                                                                                                   
  /var/www/invoiceninja/vendor/beganovich/snappdf/versions/1084837-Linux_x64/chrome-linux/chrome: error while loading shared libraries: libnss3.so:  
   cannot open shared object file: No such file or directory                                                                                         
                                                                                                                                                     

convert [--url URL] [--html HTML] [--binary BINARY] [--] <path>

So missing libnss.so. Installed libnss3 and that’s led me down a rabbithole that probably stems from not having a DE installed on a server distro. So I’m putting in packages as I go through retrying that command. Will come back if I run into a dead end.

Installed following until no error.

root@invoice-ninja .../www/invoiceninja# cat /var/log/apt/history.log | grep -Po '^Commandline: apt install (?!.*--reinstall)\K.*'
libnss3
libatk1.0-0
libatk-bridge2.0-0
libcups2
libdrm-common
libdrm2
libxcomposite1
libxdamage1
libxext6
libxfixes3
libxrandr2
libgbm1
libxkbcommon0
libpango-1.0-0
libcairo2
libasound2

root@invoice-ninja .../www/invoiceninja# ./vendor/bin/snappdf convert --html "<h1>Hello world</h1>" test.pdf
Success! PDF saved at test.pdf
root@invoice-ninja .../www/invoiceninja# ls -la test.pdf
-rw-r--r-- 1 root root 13270 Dec 19 16:26 test.pdf

Rebooted but not getting pdf in IN still.

Edit: on the plus side, I now get the invoice showing up in the Invoice Design pane without turning on HTML view. So I have that going for me, which is nice. Been playing with saving versions of the design and making new invoices to see if it generates at some point.

Edit^2: now I get it coming up fine in the Client Portal and can download a copy that opens correctly.

See here for dependencies:

Submitted a PR to the Turnkey project to satisfy these dependencies. It still doesn’t seem to want to VIew/Print pdfs from the Invoice page. Not sure what to do about that, but I can still pull off the invoice using FF pdf viewer from the preview screen.