Self-hosted, "Something went wrong" when inputting a new Credit Card

Hi! I have been receiving the “Something went wrong” screen when attempting to submit new credit card details from the customer portal on my instance of Invoice Ninja. I get no errors anywhere else on my instance. I had the issues before I updated from 4.5.3, and the issue remains after updating to 4.5.9.

I’m running PHP-7.3, nginx version 1.14.2, and MariaDB server version: 10.1.37-MariaDB-3

Here’s the latest relevant output from storage/logs/laravel-error.log:

[2019-01-30 21:50:15] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"client/statement"} []
[2019-01-30 21:51:25] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":3,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 21:51:31] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":4,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 21:51:37] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":5,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 21:51:39] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":6,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 21:53:06] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":7,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 21:55:15] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":2,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 22:06:09] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":2,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 22:07:05] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (Linux; Android 9; Pixel 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36","locale":"en","ip":"64.46.167.174","count":6,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 22:22:47] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":9,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/mbko9yxux1fltsymrhgbxaddjlv8yczl"} []
[2019-01-30 22:24:01] production.ERROR: ***ErrorException*** [0] : /var/www/pay.clak.io/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator  {"context":"PHP","user_id":1,"account_id":1,"user_name":"Clark Merrick","method":"GET","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36","locale":"en","ip":"47.188.41.144","count":11,"is_console":"no","is_api":"no","db_server":"mysql","url":"view/sgydorrbrqk9mzytkyavsmt6gumakbgu"} []

Thank you!

It could be from using PHP 7.3, I’d suggest checking if using 7.2 fixes it.

I’ll take a shot at it. Thanks!

Hi Hillel,

I have the same problem since I upgraded to php 7.3.

[2019-03-07 03:29:01] production.ERROR: ErrorException [0] : /home/xx/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php [Line 1229] => compact(): Undefined variable: operator {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“xx xx”,“method”:“GET”,“user_agent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36”,“locale”:“fr”,“ip”:“xx”,“count”:9,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“view/hns2tfuhpeaokzjk1kvah5nmjeem4gys”} []

There’s a customer who’s unable to see is invoice, but others are working fine.

There has to be another way that downgrading PHP.

Best regards,

As far as I know, the only current way is to stick with PHP 7.2 or older. In 7.3, they changed the behavior of compact() from ignoring undefined variables, to explicitly calling them out.

It seems the Laravel team is aware of this issue, but until they update the framework to account for this change, there’s not much Hillel or the rest of the Invoice Ninja team can do.

I found a thread on github that said to run composer update, but that threw off an error before the process was finished, so the function is still borked at the moment.

Thanks @Titanfail!

OK. Well. It’s fixed. Invoice Ninja has now its own instance of php on my server :slight_smile:

Thanks