Internal server error (500) when activating the monthly quota plugin

Discussion forum about Anuko Time Tracker
Post Reply
volker
Posts: 4
Joined: Thu Mar 07, 2019 7:20 pm

Internal server error (500) when activating the monthly quota plugin

Post by volker » Thu Mar 07, 2019 7:31 pm

Hello,

just a short notice, if anyone else has this issue: when activating the monthly quota plugin the timetracker stopped working.
Login attempts led to a HTTP 500 error. Logins to other groups that didn't have the plugin activated still worked.

A quick remedy is to remove the plugin from the list of enabled plugins directly in the tt_groups table in the database:

Code: Select all

update tt_groups set plugins="ch,mq" where id=1;
For the id please enter the correct one from your tt_groups table.

My Timetracker version is 1.18.37.4748.

Cheers,
Volker

wrc
Posts: 271
Joined: Tue May 25, 2010 8:30 pm

Re: Internal server error (500) when activating the monthly quota plugin

Post by wrc » Thu Mar 07, 2019 8:11 pm

What exactly does your web server error log show when error 500 occurs? Copy and paste the error log fragment here to see if we can help to identify the issue.

volker
Posts: 4
Joined: Thu Mar 07, 2019 7:20 pm

Re: Internal server error (500) when activating the monthly quota plugin

Post by volker » Thu Mar 07, 2019 8:56 pm

It's a docker installation with logs linked to stdout/stderr. php.ini is set to production settings so there was not very much information. I'll try to reproduce the problem with usefull logging in action. PHP is a 7.3.0.

wrc
Posts: 271
Joined: Tue May 25, 2010 8:30 pm

Re: Internal server error (500) when activating the monthly quota plugin

Post by wrc » Thu Mar 07, 2019 9:08 pm

Error 500 is not printed in Docker console output? Am I missing something?

volker
Posts: 4
Joined: Thu Mar 07, 2019 7:20 pm

Re: Internal server error (500) when activating the monthly quota plugin

Post by volker » Thu Mar 07, 2019 9:45 pm

Just created a second image/container with error logging enabled. The interesting part of the error_log is:

Code: Select all

[Thu Mar 07 21:39:09.311026 2019] [php7:error] [pid 17] [client 172.18.0.5:53426] PHP Fatal error:  Uncaught Error: Call to undefined function cal_days_in_month() in /var/www/html/plugins/MonthlyQuota.class.php:136
Stack trace:
#0 /var/www/html/plugins/MonthlyQuota.class.php(82): MonthlyQuota->getNumWorkdays(3, 2019)
#1 /var/www/html/plugins/MonthlyQuota.class.php(92): MonthlyQuota->getSingle(2019, 3)
#2 /var/www/html/time.php(88): MonthlyQuota->getUserQuota(2019, 3)
#3 {main}\n  thrown in /var/www/html/plugins/MonthlyQuota.class.php on line 136, referer: https://timetracker.projectbox.io/login.php
Indeed the function cal_days_in_month() isn't defined anywhere in the code.
Update: And the calendar extension is not installed. This seems to be the problem.

volker
Posts: 4
Joined: Thu Mar 07, 2019 7:20 pm

Re: Internal server error (500) when activating the monthly quota plugin

Post by volker » Thu Mar 07, 2019 9:58 pm

wrc wrote:
Thu Mar 07, 2019 9:08 pm
Error 500 is not printed in Docker console output? Am I missing something?
Nope. The standard PHP image has no active php.ini in /usr/local/etc/php. So "docker logs -f" also stays quiet.
I just built a custom Dockerimage with error logging enabled.

The missing calendar extension was the problem btw.

Post Reply