500 error when selecting invoice "Mark sent"

I have a client that prefers when I download my invoices and send them as attachments in an email direct to him from me. The automated email always goes to his spam and he doesn’t understand how to move it to his inbox or add that email address to his contacts.

Today, when I went to download the invoices for him for April, selecting the “Mark sent” gave me a popup with a 500 error. However, after refreshing the page, it was marked as sent.

I check both nginx and invoiceninja error logs and both log files are blank for today.

Hi,

I’m not sure, if you see a 500 error in the app the details will be logged in either storage/logs or the web server error logs.

Thanks again for another quick reply. Interestingly, there are no web server error logs. There are the access logs, but as you’d shared previously are of no use in this case.

The only error that I found in the laravel.log is as follows:

2024-01-29 18:14:27] production.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ninjadb.users' doesn't exist (Connection: mysql, SQL: select * from `users` where `users`.`id` in (1) and `users`.`deleted_at` is null) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found : 1146 Table 'ninjadb.users' doesn't exist (Connection: mysql, SQL: select * from `users` where `users`.`id` in (1) and `users`.`deleted_at` is null) at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:822) 

Ok, technically I had one other error related to a time/date error, but I know what that is and why it’s there.

Is the time from around when you triggered the error?

Also, are you able to reproduce the error?

Hahaha, good catch on that time! I completely missed that.

No, my error is from today (2024-05-01) and I am unable to reproduce the error above.

The only error from today is the date/time one.

[2024-05-01 17:45:52] production.ERROR: DateTimeZone::__construct(): Unknown or bad timezone (US/Eastern) {"userId":1,"exception":"[object] (DateInvalidTimeZoneException(code: 0):  DateTimeZone::__construct(): Unknown or bad timezone (US/Eastern) at /var/www/invoiceninja/app/Models/Company.php:934)

@david any thoughts on the error?

@northhill

Which version of PHP are you using?

@hillel there are compatibility issues with our current list of timezones:

https://www.php.net/manual/en/timezones.others.php

Timezones such as US/Eastern may throw errors on some systems.

We’ll need to revise any of the US/* timezones with their America/ equivalents.

1 Like

I just updated to 8.3 yesterday. Everything is generally working fine with the exception of this error.

That was the error that I was expecting based on the changes I’d read about in PHP.

@david Is there anything I need to do on my installation related to this? Or is it okay until you get it updated?

@northhill

In the next release, i have updated the timezones used by the application so you should not have this particular issue.

If you want to make the change yourself, in your database => timezones table

change

'US/Eastern' => 'America/New_York',

Then update the statics cache

1 Like