500 Server Error when processing payments

Can I get some help with setting up the selfhosted version?

I have it running from the docker-compose, after a lot of time trying to get it to work, it was finally up and running and everything seems fine.

Although when a friend tries to pay an invoice, it doesn’t work, he just gets a “500 server error”.
We are using Paypal as the gateway, he goes trough the payment process and everything, but after it that appears.
The payment doesn’t appear on either one of our accounts.

I’ve tried on the official invoiceninja hosted app, and he could make a payment trough it. Same paypal credentials same everything, worked on the official, didn’t work on my selfhosted one.The logs in docker aren’t really that helpful, and I don’t know where to check full on detailed logs and no clue where to start off debugging…
image

Here is the only log I could find, laravel.log:

[2021-04-05 20:45:53] production.ERROR: Call to a member function invoices() on int {"userId":8,"exception":"[object] (Error(code: 0): Call to a member function invoices() on int at /var/www/app/app/Mail/Admin/PaymentFailureObject.php:58)
[stacktrace]
#0 /var/www/app/app/Jobs/Mail/PaymentFailureMailer.php(89): App\\Mail\\Admin\\PaymentFailureObject->build()
#1 /var/www/app/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(234): App\\Jobs\\Mail\\PaymentFailureMailer->App\\Jobs\\Mail\\{closure}()
#2 /var/www/app/app/Jobs/Mail/PaymentFailureMailer.php(100): Illuminate\\Support\\Collection->each()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\Mail\\PaymentFailureMailer->handle()
#4 /var/www/app/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#5 /var/www/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#6 /var/www/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#7 /var/www/app/vendor/laravel/framework/src/Illuminate/Container/Container.php(610): Illuminate\\Container\\BoundMethod::call()
#8 /var/www/app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#9 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#10 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#11 /var/www/app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#12 /var/www/app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(118): Illuminate\\Bus\\Dispatcher->dispatchNow()
#13 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#14 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 /var/www/app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(120): Illuminate\\Pipeline\\Pipeline->then()
#16 /var/www/app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#17 /var/www/app/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call()
#18 /var/www/app/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(43): Illuminate\\Queue\\Jobs\\Job->fire()
#19 /var/www/app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(251): Illuminate\\Queue\\SyncQueue->push()
#20 /var/www/app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(227): Illuminate\\Bus\\Dispatcher->pushCommandToQueue()
#21 /var/www/app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(77): Illuminate\\Bus\\Dispatcher->dispatchToQueue()
#22 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php(202): Illuminate\\Bus\\Dispatcher->dispatch()
#23 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(17): Illuminate\\Foundation\\Bus\\PendingDispatch->__destruct()
#24 /var/www/app/app/PaymentDrivers/PayPalExpressPaymentDriver.php(153): App\\Jobs\\Mail\\PaymentFailureMailer::dispatch()
#25 /var/www/app/app/Http/Controllers/ClientPortal/PaymentController.php(307): App\\PaymentDrivers\\PayPalExpressPaymentDriver->processPaymentResponse()
#26 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\ClientPortal\\PaymentController->response()
#27 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#28 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#29 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#30 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Routing\\Route->run()
#31 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#32 /var/www/app/app/Http/Middleware/CheckClientExistence.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#33 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\CheckClientExistence->handle()
#34 /var/www/app/app/Http/Middleware/Locale.php(34): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Locale->handle()
#36 /var/www/app/app/Http/Middleware/QueryLogging.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\QueryLogging->handle()
#38 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#40 /var/www/app/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Auth\\Middleware\\Authenticate->handle()
#42 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#44 /var/www/app/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#46 /var/www/app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /var/www/app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#48 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle()
#49 /var/www/app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#51 /var/www/app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#52 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#53 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Pipeline\\Pipeline->then()
#55 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\\Routing\\Router->runRouteWithinStack()
#56 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute()
#57 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute()
#58 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch()
#59 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#60 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#61 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle()
#62 /var/www/app/app/Http/Middleware/Cors.php(34): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#63 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Cors->handle()
#64 /var/www/app/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#65 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle()
#66 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#67 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#68 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#69 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#70 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#71 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#72 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#73 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#74 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(46): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#75 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Tracing\\Middleware->handle()
#76 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#77 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then()
#78 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#79 /var/www/app/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle()
#80 {main}
"}

Hi,

Which exact version are you using?

cc @ben, @david

It is 5.1.27, seems like 5.1.34 is available althought didn’t updste yet. Should I just in case?

Yes, please let us know if you still see the problem after updating

Updated.
Can’t try a new payment now, I don’t have multiple paypal accounts and can’t pay with mine, and test mode doesn’t want to work… So I have to wait for the friend to wake up.

But I have his return URL that he got after the paypal payment process (goes to /client/payments/process/response/…), not sure if its still valid (I’d guess not) but tried it anyways.
Its still a 500 Server Error message, although now there is nothing in laravel.log about it.

This version seems to spam Docker logs with one error thought, for whatever reason:

Tried paying again.
Same error, 500 Server Error, but now no errors in laravel.log and now at least in Docker logs I see the “+0000 “GET /index.php” 500” log, which wasn’t popping up before.
Those errors from the reply above are still spamming though.

Hi Aleksa

I’ve tagged a new release which is building, it would be good to know if the issue persists on the new build v5.1.35

Updated, now its not a 500 page anymore, now it displays this:

Wanted to make a new invoice to test, but now I can’t even make invoices, I get 500 when I try to save it.

Nothing new in laravel.log, Docker log just says the operation was 500 and that thing is still spamming about shutting down and child process wasn’t spawned

This is what I see when I try to create an invoice, couldn’t embed two images in one reply

Actually, when I go back to the invoices menu, it seems like they were actually saved as drafts.
Although I can’t email them, I get a 500 Server Error

Umm, edit… It seems that the actions do get executed, but for whatever reason it still displays the 500 error.
It marked the invoice as sent, but I did not get an email that the invoice is sent, nor did the friend receive the email.

@AleksaDjordjic

There are two separate issues here:

  1. The docker error (can you please post an issue to GitHub - invoiceninja/dockerfiles: Docker files for Invoice Ninja)
  2. The payment error - I need to check another build in.

Posted on github: