Weird error message when changing "Policy Group" o

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
lstoumbos
Posts: 80
Joined: Wed Jan 10, 2007 7:41 am

Weird error message when changing "Policy Group" o

Post by lstoumbos »

I have several employees setup in the TimeTrex and when I change the policy group I get an email saying the error below and get the wonderful maintenance screen after I hit submit.

Code: Select all

DEBUG [786] Array: <b>UserFactory::isUniqueEmployeeNumber()</b>: Unique Job Item: 59
<pre>
string(2) "59"
</pre><br>
DEBUG [886]:	<b>UserFactory::setDefaultBranch()</b>: Branch ID: 0<br>
DEBUG [915]:	<b>UserFactory::setDefaultDepartment()</b>: Department ID: 0<br>
DEBUG [331]:	<b>UserFactory::setGroup()</b>: Group ID: 0<br>
DEBUG [737]:	<b>Factory::isValid()</b>: Calling Validate()<br>
DEBUG [720]:	<b>Factory::StartTransaction()</b>: StartTransaction(): Transaction Count: 0 Trans Off: 0<br>
DEBUG [766]:	<b>Factory::Save()</b>: Calling preSave()<br>
DEBUG [886]:	<b>UserFactory::setDefaultBranch()</b>: Branch ID: 0<br>
DEBUG [915]:	<b>UserFactory::setDefaultDepartment()</b>: Department ID: 0<br>
DEBUG [737]:	<b>Factory::isValid()</b>: Calling Validate()<br>
DEBUG [809]:	<b>Factory::Save()</b>:  Updating...<br>
DEBUG [634]:	<b>Factory::getUpdateQuery()</b>: Update<br>
DEBUG [256]:	<b>Validator::isDate()</b>: Raw Date: 1174999515 Converted Value: 1174999515<br>
DEBUG [665]:	<b>Factory::getUpdateQuery()</b>: Data changed, set updated date: <br>
DEBUG [106]:	<b>Validator::isNumeric()</b>: Value:59<br>
DEBUG [94]:	<b>Validator::inArrayKey()</b>: Key: 20<br>
DEBUG [144]:	<b>Validator::isLength()</b>: Value: users Length: 5 Min: 2 Max: 250<br>
DEBUG [144]:	<b>Validator::isLength()</b>: Value: User Information Length: 16 Min: 2 Max: 2000<br>
DEBUG [720]:	<b>Factory::StartTransaction()</b>: StartTransaction(): Transaction Count: 1 Trans Off: 1<br>
DEBUG [766]:	<b>Factory::Save()</b>: Calling preSave()<br>
DEBUG [256]:	<b>Validator::isDate()</b>: Raw Date: 1174999515 Converted Value: 1174999515<br>
DEBUG [796]:	<b>Factory::Save()</b>: Insert ID: 11151<br>
DEBUG [702]:	<b>Factory::getInsertQuery()</b>: Insert<br>
DEBUG [730]:	<b>Factory::CommitTransaction()</b>: CommitTransaction(): Transaction Count: 1 Trans Off: 2<br>
DEBUG [847]:	<b>Factory::Save()</b>: Calling postSave()<br>
DEBUG [77]:	<b>Factory::removeCache()</b>: Attempting to remove cache: 59<br>
DEBUG [80]:	<b>Factory::removeCache()</b>: Removing cache: 59<br>
DEBUG [1862]:	<b>UserFactory::postSave()</b>: Pay Period Schedule is set...<br>
DEBUG [1870]:	<b>UserFactory::postSave()</b>: Already assigned to this Pay Period Schedule...<br>
DEBUG [69] Array: <b>PayPeriodScheduleUserFactory::isUniqueUser()</b>: Unique User ID: 59
<pre>
string(2) "59"
</pre><br>
DEBUG [70] Array: <b>PayPeriodScheduleUserFactory::isUniqueUser()</b>: Unique User ID Query: select a.id from pay_period_schedule_user as a, pay_period_schedule as b where a.pay_period_schedule_id = b.id AND a.user_id = ? AND b.deleted=0
<pre>
string(2) "59"
</pre><br>
DEBUG [405]:	<b>Validator::Error()</b>: Validation Error: Label: user Msg: Selected Employee is already assigned to another Pay Period<br>
DEBUG [384] Array: <b>Validator::isValid()</b>: Errors
<pre>
array(1) {
  ["user"]=>
  array(1) {
    [0]=>
    string(59) "Selected Employee is already assigned to another Pay Period"
  }
}
</pre><br>
DEBUG [1902]:	<b>UserFactory::postSave()</b>: Policy Group is set...<br>
DEBUG [1912]:	<b>UserFactory::postSave()</b>: Changing Policy Group...<br>
DEBUG [1917]:	<b>UserFactory::postSave()</b>: Record Count: 1<br>
DEBUG [1920]:	<b>UserFactory::postSave()</b>: Deleteing from Policy Group: 2<br>
DEBUG [875]:	<b>Factory::Delete()</b>: Delete: 87<br>
DEBUG [72] Array: <b>PolicyGroupUserFactory::isUniqueUser()</b>: Unique User ID: 
<pre>
bool(false)
</pre><br>
DEBUG [720]:	<b>Factory::StartTransaction()</b>: StartTransaction(): Transaction Count: 1 Trans Off: 1<br>
DEBUG [796]:	<b>Factory::Save()</b>: Insert ID: 109<br>
DEBUG [702]:	<b>Factory::getInsertQuery()</b>: Insert<br>
I didn't put the entire message as there is some personal information in there.

I am running TT 1.5.1
MySQL 5.0.24a
Linux 2.6
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Have you recently changed pay period schedules by chance? Try deleting your cache and see if that fixes the issue.
lstoumbos
Posts: 80
Joined: Wed Jan 10, 2007 7:41 am

Post by lstoumbos »

Thank you again. I didn't change the pay period because we only have 1 and it has never been changed. So from the start its been right. Now for the cache being deleted that worked. As soon as I removed it, it would allow me to change the Policy Group for the employee.
lstoumbos
Posts: 80
Joined: Wed Jan 10, 2007 7:41 am

Post by lstoumbos »

I still continue to get this. When I delete the tmp files it works fine for awhile then starts up again. Any insight? Should I set another cron job to remove the file automatically?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Since it continues to happen, we need to figure out why, deleting the cache files each time is of course not a fix, and chances are still likely you will run into the issue again.

We haven't seen this issue before, so I'm not sure what is causing it. It doesn't seem to be related to the policy group at all, because the error has to do with the pay period schedule, not the policy group.
Selected Employee is already assigned to another Pay Period
After you delete the cache, how long does it take before the error starts occurring again? Is there an exact set of steps you can give us to reproduce the issue consistently?
lstoumbos
Posts: 80
Joined: Wed Jan 10, 2007 7:41 am

Post by lstoumbos »

Seems like it takes a day or 2. Is it possible it could be a permission issue?

Code: Select all

drwxrwx--x   2 apache apache 4096 Apr  2 12:15 02
drwxrwx--x   2 apache apache 4096 Apr  2 13:22 03
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 09
drwxrwx--x   2 apache apache 4096 Apr  2 12:18 13
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 20
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 21
drwxrwx--x   2 apache apache 4096 Apr  2 12:49 22
drwxrwx--x   2 apache apache 4096 Apr  2 12:44 36
drwxrwx--x   2 apache apache 4096 Apr  2 12:46 41
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 4c
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 51
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 5a
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 5b
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 61
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 64
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 7e
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 8a
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 8f
drwxrwx--x   2 apache apache 4096 Apr  2 12:15 9d
drwxr-x--x   4 apache apache 4096 Apr  2 12:48 branch
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 c2
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 cd
drwxr-x--x   3 apache apache 4096 Apr  2 12:15 company
drwxrwx--x   2 root   root   4096 Apr  2 12:20 d5
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 dd
drwxr-x--x   3 apache apache 4096 Apr  2 12:16 department
drwxrwx--x   2 apache apache 4096 Apr  2 12:18 ea
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 f1
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 f4
drwxrwx--x   2 apache apache 4096 Apr  2 13:12 f5
drwxrwx--x   2 apache apache 4096 Apr  2 12:16 fa
drwxr-x--x   9 apache apache 4096 Apr  2 14:00 hierarchy
drwxr-x--x   3 apache apache 4096 Apr  2 12:16 hierarchy_object_type
drwxr-x--x   8 apache apache 4096 Apr  2 13:56 message
drwxr-x--x  11 apache apache 4096 Apr  2 13:56 pay_period
drwxr-x--x   8 apache apache 4096 Apr  2 13:56 permission
drwxr-x--x   8 apache apache 4096 Apr  2 13:57 station
drwxr-x--x   3 apache apache 4096 Apr  2 12:16 system_setting
drwxr-x--x   8 apache apache 4096 Apr  2 13:56 user_preference
drwxr-x--x  96 apache apache 4096 Apr  2 12:50 users
Also I forgot to mention but when this happens sometimes a supervisor is not allowed to change some of the employees schedule. I will come up with the maintenance screen.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Yes, it could definitely be caused by a permission issue. It appears your cron jobs are being run as root, and not as the apache user.

Make sure they run as the apache user and that should fix the problem.
lstoumbos
Posts: 80
Joined: Wed Jan 10, 2007 7:41 am

Post by lstoumbos »

Thank you for all your help. I will do that.
Locked