DataTables Error

I’m a paid self-hosted user and the installation is on a WHM/cPanel server. After upgrading from 3.9.2 to 4.0.1 using the Softaculous upgrader I’m no longer able to see any Payments. Clients, Products, Invoices, Quotes, etc all work fine. When I try to change the option in the Status field I get the error:

DataTables warning: table id=DataTables_Table_0 - Ajax error. For more information about this error, please see http://datatables.net/tn/7

In Chrome’s dev console I see:

jquery.js:9664 GET https://mydomain.com/inv/public/api/payments?sEcho=6&iColumns=10&sColumns=%2C%2C%2C%2C%2C%2C%2C%2C%2C&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&sSearch_0=&bRegex_0=false&bSearchable_0=true&bSortable_0=false&mDataProp_1=1&sSearch_1=&bRegex_1=false&bSearchable_1=true&bSortable_1=true&mDataProp_2=2&sSearch_2=&bRegex_2=false&bSearchable_2=true&bSortable_2=true&mDataProp_3=3&sSearch_3=&bRegex_3=false&bSearchable_3=true&bSortable_3=true&mDataProp_4=4&sSearch_4=&bRegex_4=false&bSearchable_4=true&bSortable_4=true&mDataProp_5=5&sSearch_5=&bRegex_5=false&bSearchable_5=true&bSortable_5=true&mDataProp_6=6&sSearch_6=&bRegex_6=false&bSearchable_6=true&bSortable_6=true&mDataProp_7=7&sSearch_7=&bRegex_7=false&bSearchable_7=true&bSortable_7=true&mDataProp_8=8&sSearch_8=&bRegex_8=false&bSearchable_8=true&bSortable_8=true&mDataProp_9=9&sSearch_9=&bRegex_9=false&bSearchable_9=true&bSortable_9=false&sSearch=&bRegex=false&iSortCol_0=7&sSortDir_0=desc&iSortingCols=1&_=1515610092307 500 (Internal Server Error) send @ jquery.js:9664 ajax @ jquery.js:9215 H @ jquery.dataTables.js:2483 j @ jquery.dataTables.js:2515 I @ jquery.dataTables.js:1982 P @ jquery.dataTables.js:2101 Ne @ jquery.dataTables.js:7347 (anonymous) @ jquery.dataTables.js:7421 iterator @ jquery.dataTables.js:6827 (anonymous) @ jquery.dataTables.js:7420 (anonymous) @ jquery.dataTables.js:6990 refreshDatatable_payments @ payments:895 (anonymous) @ payments:1168 u @ jquery.js:3148 fireWith @ jquery.js:3260 n @ jquery.js:9314 e @ jquery.js:9718 XMLHttpRequest.send (async) send @ jquery.js:9664 ajax @ jquery.js:9215 ot.(anonymous function) @ jquery.js:9361 (anonymous) @ payments:1167 dispatch @ jquery.js:4670 m.handle @ jquery.js:4338 trigger @ jquery.js:4579 (anonymous) @ jquery.js:5289 each @ jquery.js:384 each @ jquery.js:136 trigger @ jquery.js:5288 i.select @ select2.js:3060 (anonymous) @ select2.js:3131 i.invoke @ select2.js:637 i.trigger @ select2.js:627 r.trigger @ select2.js:5472 (anonymous) @ select2.js:5298 i.invoke @ select2.js:637 i.trigger @ select2.js:631 (anonymous) @ select2.js:1210 dispatch @ jquery.js:4670 m.handle @ jquery.js:4338 jquery.js:9664 GET https://mydomain.com/set_entity_filter/payment 404 (Not Found)

Note that my installation is at https://mydomain.com/inv but the last jquery error seems to be trying to call https://mydomain.com/set_entity_filter with no /inv/. Not sure if that’s the cause here.

And in laravel-error.log I see:

[2018-01-10 18:52:14] production.ERROR: ***Illuminate\Database\QueryException*** [42S22] : /home/mydomain/public_html/inv/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 770] => SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payments.exchange_rate' in 'field list' (SQL: select payments.public_id, COALESCE(clients.currency_id, accounts.currency_id) currency_id, COALESCE(clients.country_id, accounts.country_id) country_id, payments.transaction_reference, COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name, clients.public_id as client_public_id, clients.user_id as client_user_id, payments.amount, CONCAT(payments.payment_date, payments.created_at) as date, payments.payment_date, payments.payment_status_id, payments.payment_type_id, payments.payment_type_id as source, invoices.public_id as invoice_public_id, invoices.user_id as invoice_user_id, invoices.invoice_number, invoices.invoice_number as invoice_name, contacts.first_name, contacts.last_name, contacts.email, payment_types.name as method, payment_types.name as payment_type, payments.account_gateway_id, payments.deleted_at, payments.is_deleted, payments.user_id, payments.refunded, payments.expiration, payments.last4, payments.email, payments.routing_number, payments.bank_name, payments.private_notes, payments.exchange_rate, payments.exchange_currency_id, invoices.is_deleted as invoice_is_deleted, gateways.name as gateway_name, gateways.id as gateway_id, payment_statuses.name as status from payments inner join accounts on accounts.id = payments.account_id inner join clients on clients.id = payments.client_id inner join invoices on invoices.id = payments.invoice_id inner join contacts on contacts.client_id = clients.id inner join payment_statuses on payment_statuses.id = payments.payment_status_id left join payment_types on payment_types.id = payments.payment_type_id left join account_gateways on account_gateways.id = payments.account_gateway_id left join gateways on gateways.id = account_gateways.gateway_id where payments.account_id = 1 and contacts.is_primary = 1 and contacts.deleted_at is null and invoices.is_deleted = 0 and (payments.id is null or (payments.deleted_at is not null and payments.is_deleted = 0)) and clients.deleted_at is null order by date desc limit 10) {"context":"PHP","user_id":1,"account_id":1,"user_name":"My Name","method":"GET","url":"https://mydomain.com/inv/public/api/payments","previous":"https://mydomain.com/inv/public/payments","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36","ip":"MY IP ADDR","count":28,"is_console":"no","is_api":"no","db_server":"mysql"} []

Any help is appreciated.

Try loading https://mydomain.com/inv/public/update

Thanks for the quick response. I should have mentioned, I ran /inv/public/update once and got a blank screen after. If I try to run it now I get a 500 error.

Can you check storage/logs/laravel-error.log for details

Nothing is written to laravel-error.log when I go to /inv/public/update

Can you check your webserver error log

Good catch.

PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 36864 bytes) in /home/mydomain/public_html/inv/vendor/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php on line 21: /usr/local/cpanel/cgi-sys/ea-php70

Increased memory_limit and the reran /inv/public/update. This time it completed and redirected me to the login page for Invoice Ninja and Payments is working now.

Thanks again for your help and quick replies.

Great to hear!