Ninja 5.x on Litespeed, installed, but get 500 error on some actions

You can try using the API command to update it, in newer versions there’s an option in the UI

curl -X POST 'https://domain.com/api/v1/self-update' \
-H "X-API-TOKEN:TOKEN" \
-H "X-Requested-With: XMLHttpRequest" \
-H "X-API-SECRET:SECRET" \
-H "X-API-PASSWORD:PASSWORD"

Have you seen the guides linked to here: https://invoiceninja.github.io/selfhost.html#installing-invoice-ninja

You can download v5 here:

Thanks. They look more current (that what I found on the docs.invoiceninja.com pages).

Where do I find the API key and password, etc.?

The docs link is for v4, we’re working on new docs for v5.

Not sure if your version supports it but you may be able to create a token on Settings > Account Management, otherwise you’ll need to find it in the database. The password is your login password and the secret can be optionally set in the .env file.

Unfortunately I can’t generate an API due to the same error reported above. Seems something’s rather broken with this installation. Not sure what.

I’ll start from scratch.

I’ve attempted repeating the GIT process, and same issue occurring. Does this error message tell you anything? It would seem there’s some kind of server connection failure, but I have no idea what. Rather new to all this.

$ composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 0 updates, 0 removals
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 0 updates, 0 removals
Package asgrim/ofxparser is abandoned, you should avoid using it. No replacement was suggested.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Connection.php line 32:

  Argument 1 passed to Symfony\Component\VarDumper\Server\Connection::__construct() must be of the type string, null given, called in /home/mydomain/public_ht
  ml/vendor/beyondcode/laravel-dump-server/src/DumpServerServiceProvider.php on line 49


Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

The specific error being,

In Connection.php line 32:

  Argument 1 passed to Symfony\Component\VarDumper\Server\Connection::__construct() must be of the type string, null given, called in /home/mydomain/public_ht
  ml/vendor/beyondcode/laravel-dump-server/src/DumpServerServiceProvider.php on line 49

One option is to use the prebuilt zip which doesn’t require composer

I found this issue which suggest some possible fixes: https://github.com/beyondcode/laravel-dump-server/issues/48

Note: you want to run composer install, unless you’re developing the app you shouldn’t run composer update

Thanks. I had previously found that thread, whilst trying to figure this issue out. But I didn’t see anything I felt applied to the situation.

However, this time I picked up one suggestion late in the thread, saying to run, composer upgrade --no-dev if I’d previously run composer upgrade (and screwed things up as a result of that).

Which brings me to question why the Composer instructions here say to use composer update?

https://invoiceninja.github.io/selfhost.html#installing-invoice-ninja

So I now seem to be a step further in the installation of the newer version.

I was able to get right through the Composer instructions on that page. But I still get this error when trying to save ANYTHING in the Admin.

image

I see this mentioned at the end of those instructions mentioned above:

Node / NPM version
As we are using the latest version of Puppeteer (v5), NPM version must be >= 6 and Node >=12

My Ubuntu 18.04 installation (after I forced it to upgrade to a much higher version, using instructions here) is running Nodejs v10.23.0. NPM v6.14.8

Is that likely to be an issue?

It’s a mistake in the docs, we’ll make sure it’s corrected.

Are you running the latest version now?

Hi. Yes, running latest version now. But still get the same error on in the Admin, and I notice I am now getting 403 error on front end. Which seems to have started happening after applying the suggested file permissions. E.g, from here.

$ sudo chown -R www-data:www-data /usr/share/nginx/invoiceninja
  $ sudo chmod -R g+s /usr/share/nginx/invoiceninja
  $ sudo chmod -R 775 /usr/share/nginx/invoiceninja/storage

Although it’s the same permissions spelt out in the various other guides.

.htaccess file

I’m wondering if perhaps the default Apache based .htaccess settings are not correct for OpenLiteSpeed?
The one page that explained how to install Ninja on OLS (I vaguely recall it was you who posted a link to it somewhere in these forums) was very outdated, and didn’t seem anything like the current .htaccess file, which is:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Do you know of any update-to-date info on this? (namely, correct .htaccess settings for Ninja v5 on OLS?)

Sorry, I’ve never heard of OpenLiteSpeed

Researching it now, looks interesting…

LiteSpeed server?
https://www.litespeedtech.com/

OpenLiteSpeed is the open source version of that. You’re mention of a link to some info on it was here: https://github.com/invoiceninja/invoiceninja/issues/93#issuecomment-643765687 (which is no longer linking to anything) … and also here, which does link to something.

You’re right, I don’t remember it. I often search for terms and copy/paste links

I understand.
Well, thanks for your help.
It looks like I’m not able to get InvoiceNinja running on this server, which throws a bit of a spanner into the works. I’ll have to come up with some other solution or way forward.
Regards… J

1 Like

Can you not serve the website with NGINX instead? I know my template for nginx configuration works with invoiceninja.

Thanks. :+1:
That’s exactly what I’m doing. The server I wanted it one happened to be running Cyberpanel (which is built on top of OpenLiteSpeed, which in theory should behave fairly similarly as Apache). But as I couldn’t figure out why it wasn’t working :roll_eyes:, I’m now in the process of setting it up on a different server, which happens to be running Nginx.

Where do I access your Nginx configuration template? Sounds like that might come in very handy.
:handshake:

Looks like I found it. These instructions?

This server doesn’t run Ubuntu, but some other Debian based build. Will the steps be much the same?

Linux version 4.9.0-11-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11)

Followed the Nginx instructions.
Something odd happened during web “Setup”.
PDF test was a success (first time I’ve managed that!).
All other tests were success (DB, Email, etc.).
Submitted the settings, and the page refreshed.
After that, PDF test failed.
I looked in the .env file and it was very incomplete. Missing much of what’s in the .env.example file, and what I’ve seen in the .env on my previous attempted installation.
My guess is that some error or bug occurred when I submitted the settings, and it wrote some settings in the .env (just the DB credentials, Mail credentials, URL, and perhaps a couple of other lines).

So I’ve put in many of the missing lines, manually.

The frustrating part is that I still can’t CUSTOMIZE AND PREVIEW invoices, etc. I get the non-descript 500 error.

The errors that show up in laravel.log when I try to activate the CUSTOMIZE AND PREVIEW are:

[2020-11-23 00:11:30] production.ERROR: The command "PATH=$PATH:/usr/local/bin NODE_PATH=`npm root -g` node '/home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"file:\/\/\/tmp\/694622329-0275510001606090288\/index.html","action":"pdf","options":{"args":["--no-sandbox"],"viewport":{"width":800,"height":600,"deviceScaleFactor":1},"displayHeaderFooter":false,"waitUntil":"networkidle0","printBackground":true}}'" failed.

Exit Code: 1(General error)

Working directory: /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/public

Output:
================


Error Output:
================
/home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/spatie/browsershot/bin/browser.js:20
const getOutput = async (page, request) => {
                        ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
 {"userId":1,"exception":"[object] (Symfony\\Component\\Process\\Exception\\ProcessFailedException(code: 0): The command \"PATH=$PATH:/usr/local/bin NODE_PATH=`npm root -g` node '/home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/spatie/browsershot/src/../bin/browser.js' '{\"url\":\"file:\\/\\/\\/tmp\\/694622329-0275510001606090288\\/index.html\",\"action\":\"pdf\",\"options\":{\"args\":[\"--no-sandbox\"],\"viewport\":{\"width\":800,\"height\":600,\"deviceScaleFactor\":1},\"displayHeaderFooter\":false,\"waitUntil\":\"networkidle0\",\"printBackground\":true}}'\" failed.

Exit Code: 1(General error)

Working directory: /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/public

Output:
================


Error Output:
================
/home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/spatie/browsershot/bin/browser.js:20
const getOutput = async (page, request) => {
                        ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
 at /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/spatie/browsershot/src/Browsershot.php:752)
[stacktrace]
#0 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/spatie/browsershot/src/Browsershot.php(539): Spatie\\Browsershot\\Browsershot->callBrowser(Array)
#1 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Utils/Traits/Pdf/PdfMaker.php(44): Spatie\\Browsershot\\Browsershot->pdf()
#2 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Jobs/Util/PreviewPdf.php(61): App\\Jobs\\Util\\PreviewPdf->makePdf(NULL, NULL, '<!DOCTYPE html ...')
#3 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\Util\\PreviewPdf->handle()
#4 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#5 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#6 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#7 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(596): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#8 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call(Array)
#9 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(App\\Jobs\\Util\\PreviewPdf))
#10 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(App\\Jobs\\Util\\PreviewPdf))
#11 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#12 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(65): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(App\\Jobs\\Util\\PreviewPdf))
#13 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Controllers/PreviewController.php(198): App\\Jobs\\Util\\PreviewPdf::dispatchNow('<!DOCTYPE html ...', Object(App\\Models\\Company))
#14 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Controllers/PreviewController.php(132): App\\Http\\Controllers\\PreviewController->blankEntity()
#15 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\PreviewController->show()
#16 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('show', Array)
#17 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(255): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\PreviewController), 'show')
#18 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#19 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(691): Illuminate\\Routing\\Route->run()
#20 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#21 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Middleware/Locale.php(35): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Locale->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#23 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Middleware/TokenAuth.php(83): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#24 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\TokenAuth->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Middleware/SetDb.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\SetDb->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Middleware/Cors.php(34): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Cors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Middleware/QueryLogging.php(42): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\QueryLogging->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest(Object(Illuminate\\Http\\Request), Object(Closure), Array)
#35 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle(Object(Illuminate\\Http\\Request), Object(Closure), '300', '1')
#36 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#38 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(668): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#39 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(634): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#40 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(623): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#41 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#42 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#43 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/app/Http/Middleware/Cors.php(34): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#44 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Cors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#45 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#47 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#53 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(87): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#55 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#56 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Tracing\\Middleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#57 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#58 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#59 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#60 /home/436413.cloudwaysapps.com/ywqcfgpmty/public_html/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#61 {main}
"}

When I look in the browser console I see one error, that https://billing.mydomain.nz/api/v1/preview? generated a 500 error. If I try to directly access that URL I get a 404 (which might be irrelevant).

Further to the above, I’ve tried to View PDF on an invoice. It generates a PDF, but what the PDF contains is a screenshot of the login page!