Error 500 on login

Hi,

i have the problem that i cant login to my invoice ninja.
I get “500: Server error” on login screen.

In my server logs i found: ERROR 500 POST /api/v1/login?first_load=true&include_static=true HTTP/1.0
Any ideas?

Hi,

Have you checked the app logs in storage/logs/

Ther is this:

[2021-04-07 14:31:43] production.ERROR: flock() expects parameter 1 to be resource, bool given {"exception":"[object] (ErrorException(code: 0): flock() expects parameter 1 to be resource, bool given at /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php:147)

@david do you have any ideas?

This is a file permissions error bubbling up from the root OS

You’ll need to set the web user as the owner

Okay. Do you have a command to fix the permissions? Or can you say which folder hast wrong permissions?

Today without any to do it works. Strange…

The problem is back.

Server log: ERROR 500 POST /api/v1/login?first_load=true&include_static=true HTTP/1.0
Storage/logs: is without actual errors

Any ideas?

Does somebody has any idea? It’s very frustrating. Because I don’t find any error messages except Error 500 …

Have you checked both the web server error logs and the application logs?

If neither have logs it’s most likely a permissions issue.

The problem exists after I did the update to the latest version.
This are the las errors in /storage/logs:

Summary

`[2021-04-13 16:50:34] production.INFO: https://invoice.mydomain.de/phantom/invoice/XLKdXFUXRlWfNoGREKmWEqPZ6jGSuKk7I2UuenE6DuUvJSPtBHJIA0twF5exmJGJ?phantomjs_secret=secret
[2021-04-13 16:55:32] production.ERROR: The command “’/var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/beganovich/snappdf/versions/859306-Linux_x64/chrome-linux/chrome’ ‘–headless’ ‘–disable-gpu’ ‘–disable-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’ ‘–print-to-pdf=/tmp/pdf_PQBCeC.pdf’ ‘/tmp/html_BmHqbu.html’” failed.

Exit Code: 127(Command not found)

Working directory: /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/public

Output:

Error Output:

/var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/beganovich/snappdf/versions/859306-Linux_x64/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
{“userId”:1,“exception”:"[object] (Symfony\Component\Process\Exception\ProcessFailedException(code: 0): The command “’/var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/beganovich/snappdf/versions/859306-Linux_x64/chrome-linux/chrome’ ‘–headless’ ‘–disable-gpu’ ‘–disable-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’ ‘–print-to-pdf=/tmp/pdf_PQBCeC.pdf’ ‘/tmp/html_BmHqbu.html’” failed.

Exit Code: 127(Command not found)

Working directory: /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/public

Output:

Error Output:

/var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/beganovich/snappdf/versions/859306-Linux_x64/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
at /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/beganovich/snappdf/src/Snappdf.php:157)
[stacktrace]
#0 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Utils/Traits/Pdf/PdfMaker.php(38): Beganovich\Snappdf\Snappdf->generate()
#1 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Services/Invoice/GenerateDeliveryNote.php(89): App\Services\Invoice\GenerateDeliveryNote->makePdf(NULL, NULL, 'run()
#3 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Http/Controllers/InvoiceController.php(844): App\Services\Invoice\InvoiceService->getInvoiceDeliveryNote(Object(App\Models\Invoice), Object(App\Models\ClientContact))
#4 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\InvoiceController->deliveryNote(Object(App\Http\Requests\Invoice\ShowInvoiceRequest), Object(App\Models\Invoice))
#5 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction(‘deliveryNote’, Array)
#6 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\InvoiceController), ‘deliveryNote’)
#7 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\Routing\Route->runController()
#8 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\Routing\Route->run()
#9 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#10 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Http/Middleware/Locale.php(34): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#11 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\Locale->handle(Object(Illuminate\Http\Request), Object(Closure))
#12 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Http/Middleware/TokenAuth.php(83): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#13 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\TokenAuth->handle(Object(Illuminate\Http\Request), Object(Closure))
#14 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Http/Middleware/SetDb.php(40): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SetDb->handle(Object(Illuminate\Http\Request), Object(Closure))
#16 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Http/Middleware/Cors.php(34): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#17 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\Cors->handle(Object(Illuminate\Http\Request), Object(Closure))
#18 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Http/Middleware/QueryLogging.php(38): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#19 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\Routing\Middleware\ThrottleRequests->handleRequest(Object(Illuminate\Http\Request), Object(Closure), Array)
#24 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), ‘300’, ‘1’)
#25 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#28 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#29 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#30 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#31 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#32 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/app/Http/Middleware/Cors.php(34): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\Cors->handle(Object(Illuminate\Http\Request), Object(Closure))
#34 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#35 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#37 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#38 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#40 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(46): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\Laravel\Tracing\Middleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#47 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#48 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#49 /var/www/vhosts/mydomain.de/httpdocs/invoice.mydomain.de/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#50 {main}
"} `

Maybe this will help:

https://invoiceninja.github.io/docs/self-host-troubleshooting/#libatk-so-not-loading-for-google

if the webroot directory is not owned by the web user then you should run
chown -R www-data:www-data /var/www/html/invoiceninja
replace www-data with your OS’s web user and the directory with where you installed invoice ninja

Hello,
I have a similiar problem this morning with someone in my team.

This is an extract of the logs error
[2021-04-15 13:45:02] production.INFO: latest version = 5.1.46
[2021-04-15 13:45:04] production.ERROR: Trying to get property ‘is_owner’ of non-object {“userId”:5,“exception”:"[object] (ErrorException(code: 0): Trying to get property ‘is_owner’ of non-object at /…/app/Models/User.php:282)