Client Portal "Credits" Page 500 Error

Invoice Ninja v5.3.34

The site.com/client/credits page returns a 500 - Server Error. All other pages work. If I create a credit, I can see the credit pdf (site.com/client/credits/url). Any idea what could be happening? Anything on the log I should keep an eye out for?

Any error messages in storage/logs/laravel.log or the http daemon logs?

Yes, this is the error that comes up consistently in laravel.log with a site.com/client/credits page refresh: (I took out the stacktraces, let me know if I should include them)

production.ERROR: SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: '' (SQL: select count(*) as aggregate from `credits` where `client_id` = 6 and `company_id` = 1 and `status_id` <> 1 and `is_deleted` = 0 and (date(`due_date`) >= 2021-12-10 or `due_date` is null or `due_date` = )) (View: /home/user/billing.site.com/resources/views/portal/ninja2020/credits/index.blade.php) {"userId":6,"exception":"[object] (Illuminate\\View\\ViewException(code: 0): SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: '' (SQL: select count(*) as aggregate from `credits` where `client_id` = 6 and `company_id` = 1 and `status_id` <> 1 and `is_deleted` = 0 and (date(`due_date`) >= 2021-12-10 or `due_date` is null or `due_date` = )) (View: /home/user/billing.site.com/resources/views/portal/ninja2020/credits/index.blade.php) at /home/user/billing.site.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:703)
[stacktrace]
#0 /home/user/billing.site.com/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(72): Illuminate\\View\\Engines\\CompilerEngine->handleViewException(Object(Illuminate\\Database\\QueryException), 0)
...
[previous exception] [object] (Illuminate\\Database\\QueryException(code: HY000): SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: '' (SQL: select count(*) as aggregate from `credits` where `client_id` = 6 and `company_id` = 1 and `status_id` <> 1 and `is_deleted` = 0 and (date(`due_date`) >= 2021-12-10 or `due_date` is null or `due_date` = )) at /home/user/billing.site.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:703)
[stacktrace]
....
[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: '' at /home/user/billing.site.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:364)
[stacktrace]
...

I don’t have access to the /var/log/daemon.log. This is in a shared hosting space.

Thanks for taking a look at this

@david @ben any thoughts?

@Stevan

Are you using MySQL 8.0 ?

Yes, I’m using MySQL 8

@Stevan

We’ll tag a new release for a fix for users running MySQL 8.0

1 Like