Problem upgrading from 2.2.8 to 2.2.15

Ask your questions regarding TimeTrex installation here.
Locked
vcatalyst
Posts: 15
Joined: Tue Dec 11, 2007 6:42 am
Location: Florida
Contact:

Problem upgrading from 2.2.8 to 2.2.15

Post by vcatalyst »

CENTOS 4.7
PHP 5.2.5 (cli) (built: Oct 31 2008 08:02:23)
MySQL 4.1.22

We had no problems running 2.2.8 til we noticed some supervisors missing Nov 8th from their timesheets. In reading the forums, we saw this was fixed with a upgrade due to DST.

The upgrade installation to 2.2.15 went without issue, but when you now enter My Timesheet and try to punch someone in, all you get is a white page after submitting the punch. If you then close the edit punch page and refresh the main timesheet, the punch shows, but it fails to calculate Total Time.

We turned on error checking and are showing a PHP error, but not sure how to resolve it. You can find the error from /interface/punch/EditPunch.php at the very end below.

Lastly, to see if it was a db vs script issue, we rolled back the 2.2.8 code leaving the db as is and the punches worked without issue. There is just a red warning stating the code is out of date in comparison to the db.

We have checked md5checksums and re-installed the code a number of times, but keep having the issue.

Thanks in advance for any help you can give.

Code: Select all

(mysqlt): SET SESSION sql_mode='ansi'   (mysqlt): SET TRANSACTION ISOLATION LEVEL READ COMMITTED   (mysqlt): SET SESSION time_zone='America/New_York'   (mysqlt): select session_id,user_id,ip_address,created_date,updated_date from authentication WHERE session_id = '9521858e77cdfbd4d3bf6a922f3c87b3' AND ip_address = '72.188.242.144' AND updated_date >= 1226352501   (mysqlt): update authentication set updated_date = 1226366901 where session_id = '9521858e77cdfbd4d3bf6a922f3c87b3'   (mysqlt): SET SESSION time_zone='US/Eastern'   (mysqlt): select * from station where company_id = '1' AND station_id = 'fe1711408480b0c97f2b355202f0b6f5' AND deleted = 0   (mysqlt): select * from cron WHERE deleted = 0 ORDER BY last_run_date DESC LIMIT 1   (mysqlt): SET AUTOCOMMIT=0   (mysqlt): BEGIN   (mysqlt): select a.* from pay_period_schedule as a, pay_period_schedule_user as b where a.id = b.pay_period_schedule_id AND b.user_id = '60' AND a.deleted=0   (mysqlt): select a.* from punch as a, punch_control as b, user_date as c where a.punch_control_id = b.id AND b.user_date_id = c.id AND c.user_id = '60' AND a.time_stamp >= '2008-11-04 07:59:59' AND a.time_stamp <= '2008-11-04 11:59:59' AND a.id != 0 AND ( a.deleted = 0 AND b.deleted=0 AND c.deleted=0) ORDER BY a.time_stamp desc, a.status_id asc LIMIT 1   (mysqlt): select * from user_date where user_id = '60' AND date_stamp = '2008-11-04' AND deleted = 0 ORDER BY id ASC   (mysqlt): update punch_control_id_seq set id=LAST_INSERT_ID(id+1);    /home/jemjell/tmp/timetrex//9e/adodb_9e11ae78a7ad1940220bfa8c58290456.cache reloaded, ttl=78397 [ select user_date_id,id,branch_id,department_id,note,job_id,job_item_id,quantity,bad_quantity,created_date,created_by,updated_date,updated_by from punch_control where id = -1 ]
(mysqlt): INSERT INTO punch_control ( USER_DATE_ID, ID, BRANCH_ID, DEPARTMENT_ID, NOTE, JOB_ID, JOB_ITEM_ID, QUANTITY, BAD_QUANTITY, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY ) VALUES ( 81661, 31206, 5, 3, '', 0, 0, 0, 0, 1226366901, 1, 1226366901, 1 )   (mysqlt): select * from punch_control where id = '31206' AND deleted = 0   /home/jemjell/tmp/timetrex//68/adodb_685d759b955c1e558d5ddd5c89fcf2aa.cache reloaded, ttl=78397 [ select * from round_interval_policy where id = -1 ]
(mysqlt): select c.* from policy_group_user as a, policy_group as ab, policy_group_round_interval_policy as b, round_interval_policy as c, round_interval_policy as d where a.policy_group_id = ab.id AND a.policy_group_id = b.policy_group_id AND b.round_interval_policy_id = c.id AND b.round_interval_policy_id = d.id AND a.user_id = '60' AND c.punch_type_id in ( 10,20,40) AND ( ab.deleted = 0 AND c.deleted = 0 AND d.deleted = 0 ) order by c.punch_type_id desc LIMIT 1   /home/jemjell/tmp/timetrex//f0/adodb_f0cbcfea62cc169a955a3fa8a6974667.cache reloaded, ttl=78397 [ select * from punch where id = -1 ]
(mysqlt): select * from punch as a where punch_control_id = '31206' AND deleted = 0 order by time_stamp desc   (mysqlt): select a.* from punch as a, punch_control as b where a.punch_control_id = b.id AND b.user_date_id = '81661' AND ( a.deleted = 0 AND b.deleted=0 ) ORDER BY a.time_stamp asc, a.status_id desc, a.punch_control_id asc   /home/jemjell/tmp/timetrex//f0/adodb_f0cbcfea62cc169a955a3fa8a6974667.cache reloaded, ttl=78397 [ select * from punch where id = -1 ]
(mysqlt): select * from punch as a where punch_control_id = '31206' AND deleted = 0 order by time_stamp desc   (mysqlt): select a.* from punch as a, punch_control as b where a.punch_control_id = b.id AND b.user_date_id = '81661' AND ( a.deleted = 0 AND b.deleted=0 ) ORDER BY a.time_stamp asc, a.status_id desc, a.punch_control_id asc   (mysqlt): update punch_id_seq set id=LAST_INSERT_ID(id+1);   /home/jemjell/tmp/timetrex//63/adodb_6361dee3dd53bdd9445d4c5673654500.cache reloaded, ttl=78397 [ select id,punch_control_id,type_id,status_id,time_stamp,actual_time_stamp,original_time_stamp,created_date,created_by,updated_date,updated_by from punch where id = -1 ]
(mysqlt): INSERT INTO punch ( ID, PUNCH_CONTROL_ID, TYPE_ID, STATUS_ID, TIME_STAMP, ACTUAL_TIME_STAMP, ORIGINAL_TIME_STAMP, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY ) VALUES ( 61821, 31206, 10, 10, '2008-11-04 12:00:00', '2008-11-04 12:00:00', '2008-11-04 12:00:00', 1226366901, 1, 1226366901, 1 )   (mysqlt): update system_log_id_seq set id=LAST_INSERT_ID(id+1);   /home/jemjell/tmp/timetrex//1d/adodb_1d47fb2a234f2e813a80e127d14e8b2e.cache reloaded, ttl=78347 [ select object_id,action_id,table_name,user_id,description,date,id from system_log where id = -1 ]
(mysqlt): INSERT INTO system_log ( OBJECT_ID, ACTION_ID, TABLE_NAME, USER_ID, DESCRIPTION, DATE, ID ) VALUES ( 61821, 10, 'punch', 1, 'Punch - Employee: Adam Barry Timestamp: 11-04-2008 12:00 PM', 1226366901, 266520 )   /home/jemjell/tmp/timetrex//f0/adodb_f0cbcfea62cc169a955a3fa8a6974667.cache reloaded, ttl=78397 [ select * from punch where id = -1 ]
(mysqlt): select * from punch as a where punch_control_id = '31206' AND deleted = 0 order by time_stamp desc   (mysqlt): select id,user_date_id,branch_id,department_id,job_id,job_item_id,quantity,bad_quantity,total_time,actual_total_time,meal_policy_id,overlap,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,deleted,other_id1,other_id2,other_id3,other_id4,other_id5,note from punch_control where id = 31206   (mysqlt): select * from user_date_total where user_date_id = '81661' AND punch_control_id = '31206' AND deleted = 0   (mysqlt): select * from punch_control where id = '31206' AND deleted = 0   (mysqlt): select a.* from user_date_total as a where a.user_date_id = '81661' AND a.status_id = '20' AND a.type_id = '10' AND a.punch_control_id = 31206 AND a.override = 1 AND a.deleted = 0   (mysqlt): select a.* from user_date_total as a where a.user_date_id = '81661' AND a.status_id = '20' AND a.type_id = '10' AND a.punch_control_id = 31206 AND a.override = 1 AND a.deleted = 0   (mysqlt): update user_date_total_id_seq set id=LAST_INSERT_ID(id+1);   /home/jemjell/tmp/timetrex//0a/adodb_0a74bd9a0a90e46d58f11c0b64dcf0f4.cache reloaded, ttl=78397 [ select user_date_id,punch_control_id,status_id,type_id,branch_id,department_id,job_id,job_item_id,quantity,bad_quantity,total_time,actual_total_time,over_time_policy_id,absence_policy_id,premium_policy_id,meal_policy_id,created_date,created_by,updated_date,updated_by,id from user_date_total where id = -1 ]
(mysqlt): INSERT INTO user_date_total ( USER_DATE_ID, PUNCH_CONTROL_ID, STATUS_ID, TYPE_ID, BRANCH_ID, DEPARTMENT_ID, JOB_ID, JOB_ITEM_ID, QUANTITY, BAD_QUANTITY, TOTAL_TIME, ACTUAL_TOTAL_TIME, OVER_TIME_POLICY_ID, ABSENCE_POLICY_ID, PREMIUM_POLICY_ID, MEAL_POLICY_ID, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY, ID ) VALUES ( 81661, 31206, 20, 10, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1226366901, 1, 1226366901, 1, 485673 )   (mysqlt): DELETE FROM user_date_total WHERE id in ( select id from ( select a.id from user_date_total as a LEFT JOIN punch_control as b ON a.punch_control_id = b.id where a.user_date_id = '81661' AND ( ( a.override = 0 AND a.status_id in (10,30) ) OR ( b.id IS NOT NULL AND a.user_date_id != b.user_date_id ) ) AND ( a.deleted = 0 ) ) as tmp )   1093: You can't specify target table 'user_date_total' for update in FROM clause

                        ADOConnection._Execute(DELETE FROM user_date_total
						WHERE id in (
							select id from (

												select 	a.id
												from	user_date_tot...) % line  842, file: adodb.inc.php
                     ADOConnection.Execute(DELETE FROM user_date_total
						WHERE id in (
							select id from (

												select 	a.id
												from	user_date_tot..., Array[4]) % line  849, file: UserDateTotalFactory.class.php
                  UserDateTotalFactory.deleteSystemTotalTime() % line 2826, file: UserDateTotalFactory.class.php
               UserDateTotalFactory.calcSystemTotalTime() % line 3341, file: UserDateTotalFactory.class.php
            UserDateTotalFactory.postSave() % line  854, file: Factory.class.php


Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysqlt error: [1093: You can't specify target table 'user_date_total' for update in FROM clause] in adodb_throw(DELETE FROM user_date_total WHERE id in ( select id from ( select a.id from user_date_total as a LEFT JOIN punch_control as b ON a.punch_control_id = b.id where a.user_date_id = '81661' AND ( ( a.override = 0 AND a.status_id in (10,30) ) OR ( b.id IS NOT NULL AND a.user_date_id != b.user_date_id ) ) AND ( a.deleted = 0 ) ) as tmp ), ) ' in /home/jemjell/public_html/timesheets/classes/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /home/jemjell/public_html/timesheets/classes/adodb/adodb.inc.php(221): adodb_throw('mysqlt', 'adodb_throw', 1093, 'You can't speci...', 'DELETE FROM use...', false, Object(ADODB_mysqlt)) #1 /home/jemjell/public_html/timesheets/classes/adodb/adodb.i in /home/jemjell/public_html/timesheets/classes/adodb/adodb-exceptions.inc.php on line 78
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Your MySQL version is WAY to old for running TimeTrex on, in fact its not even supported by MySQL any more.

To be honest I'm surprised it is even working at all since TimeTrex has never been tested on anything older then MySQL v5.0.X.
vcatalyst
Posts: 15
Joined: Tue Dec 11, 2007 6:42 am
Location: Florida
Contact:

Post by vcatalyst »

Are you positive that is the only solution to this? A DB upgrade is a big deal for us since we have a number of apps currently running on that one server

Also, when I roll back to the earlier code [2.2.8] but keep the upgraded db [2.2.15] the DST problem is fixed for the the people on EST. Unfortunately, our CST supervisors still don't see Nov 8th. Is this problem really a DB issue only?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Just so you know, you can't roll-back to previous TimeTrex releases without restoring your database as well. Doing so will surely corrupt data or cause further problems, because older versions won't know how to handle tables that have changed when you upgraded to the latest version.

v2.2.16 which will be released today may get you going again, but I wouldn't count on it. As I mentioned before TimeTrex has only ever been tested with MySQL v5.0+, so even if it does work now, there is a 110% chance that a version in the near future will break it again.

If you don't want to upgrade your MySQL server due to other applications, you can always install a 2nd MySQL server just for TimeTrex.
vcatalyst
Posts: 15
Joined: Tue Dec 11, 2007 6:42 am
Location: Florida
Contact:

Post by vcatalyst »

Upgraded to MySQL Server version: 5.0.67-community and 2.2.16 and looks to be fine now.

Thanks shaunw!
Locked