Down for maintenance

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
reloded
Posts: 52
Joined: Mon Aug 13, 2007 10:24 pm

Down for maintenance

Post by reloded »

Hello there.
I was adding an employee to the payroll and when I click on submit, this is what I got.
TimeTrex is currently undergoing maintenance. We're sorry for any inconvenience this may cause. Please try back later
I did some search in here and all I could find was someone saying something about mysql database having issues when IP address changes.
http://forums.timetrex.com/viewtopic.ph ... e9bba0b8d8
I set the server to have a static IP address but that DIDN"T help.

I then realized that whenever I select a pay period to add the new employee to, that is when I got the above error. I omitted the pay period and I was ABLE to add my employee.

I've tried that with a second employee and the scenario repeats itself. What could be the problem?

PS:_____________
After adding the employee, I had to add him to my pay period schedule. But when I add him to that pay period, I get the error above Again. So its clearly a pay period issue. Be it when adding a new employee, or later on when adding that employee to a pay period:
I set verbose = 11 and this is what I get:

Code: Select all

(mysqlt): SET SESSION sql_mode='ansi'   (mysqlt): SET SESSION time_zone='GMT'   (mysqlt): select session_id,user_id,ip_address,created_date,updated_date from authentication WHERE session_id = '8ce2bd24fb249e9556fba13bc70ba76b' AND ip_address = '192.168.1.100' AND updated_date >= 1196441134   (mysqlt): update authentication set updated_date = 1196455534 where session_id = '8ce2bd24fb249e9556fba13bc70ba76b'   (mysqlt): SET SESSION time_zone='Africa/Nairobi'   (mysqlt): select * from station where company_id = '1' AND station_id = 'f454aa8d339a2c69504a2e310951e11b' AND deleted = 0   (mysqlt): select * from cron WHERE deleted = 0 ORDER BY last_run_date DESC LIMIT 1   (mysqlt): select d.severity_id as severity_id, count(*) as count from exception as a LEFT JOIN user_date as b ON a.user_date_id = b.id LEFT JOIN users as c ON b.user_id = c.id LEFT JOIN exception_policy as d ON a.exception_policy_id = d.id LEFT JOIN pay_period as e ON b.pay_period_id = e.id where b.user_id = '1' AND b.date_stamp < '2007-11-30' AND e.status_id = 10 AND NOT EXISTS ( select z.id from request as z where z.user_date_id = a.user_date_id AND z.status_id = 30 ) AND ( a.deleted = 0 AND b.deleted = 0 AND e.deleted=0) GROUP BY d.severity_id ORDER BY d.severity_id desc   (mysqlt): SET AUTOCOMMIT=0   (mysqlt): BEGIN   (mysqlt): select id from pay_period_schedule where company_id = '1' AND name = 'My Monthly Pay' AND deleted=0 LIMIT 1    /payroll/proll/tmp///28/adodb_288700cf3e64d69e38418ac2de8a6323.cache reloaded, ttl=11666 [ select * from pay_period_schedule_user where id = -1 ]
(mysqlt): select a.* from pay_period_schedule_user as a, pay_period_schedule as b where b.id = a.pay_period_schedule_id AND pay_period_schedule_id = '3' order by a.user_id asc   (mysqlt): select * from users where id = '36' AND deleted = 0   (mysqlt): 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 = '36' AND b.deleted=0 LIMIT 1   (mysqlt): update pay_period_schedule_user_id_seq set id=LAST_INSERT_ID(id+1);   /payroll/proll/tmp///bf/adodb_bf8569bfd4bdc03f5a1e6507e6229e61.cache cache failure: Timeout 0 (see sql below)
(mysqlt): select pay_period_schedule_id,user_id,id from pay_period_schedule_user where id = -1   FailTrans was called

            ADOConnection.FailTrans() % line   32, file: Exception.class.php
         DBError.__construct(Object:ADODB_Exception) % line  628, file: Factory.class.php
      Factory.getEmptyRecordSet() % line  709, file: Factory.class.php
   Factory.getInsertQuery() % line  803, file: Factory.class.php
Factory.Save() % line  569, file: PayPeriodScheduleFactory.class.php
PayPeriodScheduleFactory.setUser(Array[10]) % line  115, file: EditPayPeriodSchedule.php
I hope you can make sense of it.

Thanks
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

update pay_period_schedule_user_id_seq set id=LAST_INSERT_ID(id+1); /payroll/proll/tmp///bf/adodb_bf8569bfd4bdc03f5a1e6507e6229e61.cache cache failure: Timeout 0 (see sql below)
(mysqlt): select pay_period_schedule_id,user_id,id from pay_period_schedule_user where id = -1 FailTrans was called
For some reason it appears as though this SQL query is timing out. There is a good chance there are major issues with your database, possibly corrupt data? Another possibility is TimeTrex can't write/read:

/payroll/proll/tmp///bf/adodb_bf8569bfd4bdc03f5a1e6507e6229e61.cache

Which can either be permissions, directory doesn't exist, or a corrupt file system.

I would start be trying to clear your TimeTrex cache directory completely and see if that helps.
reloded
Posts: 52
Joined: Mon Aug 13, 2007 10:24 pm

Post by reloded »

By the way, it was pay day when I got this error. I.e, it was the end of the pay period -4 hours to the end of the pay period. I was actually generating pay stubs for the month when I had to add a new person and thus the discovery of the error. The other employee's pay stubs generated okay. Could it be timetrex locks things up at the end of a payperiod? I don't think it should though.
Just for clarity, when you say Clear timetrex cache, you mean from the browser am using or I clear timetrex's /tmp directory?
Thanks.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

No, TimeTrex should never cause an error like this. Whenever something like this happens its usually an issue with the system itself, of course in some cases it can be a bug, but when I see cache failure: Timeout 0 (see sql below) that tells me its directly related to something outside of TimeTrex's control.

Anyways, try clearing TimeTrex's cache directory:

/payroll/proll/tmp/*
reloded
Posts: 52
Joined: Mon Aug 13, 2007 10:24 pm

Post by reloded »

Hi there.

Your suggestion worked :D I cleared the cache, attempted to add the employee to a pay period as I had mentioned above and it worked.

The cache had all this files and directories created in it. I just deleted them all.

Just for the sake of knowing, how comes that only when adding an employee to the pay period was it displaying an error? All other functions were running fine even when having the cache full of files and folders. I'd expect most of the functions to be down. Or most other functions don't make use of cache?

Thanks.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I would check your TimeTrex cron job to ensure that it is running as the same user your web server is, otherwise this issue will re-appear again shortly.

The reason you only noticed the error on certain pages is because there were probably only a few cache files it couldn't read/write, so whichever page just happened to try to hit that specific cache file again failed.
vcatalyst
Posts: 15
Joined: Tue Dec 11, 2007 6:42 am
Location: Florida
Contact:

Set your cron to run as nobody

Post by vcatalyst »

Most out-of-the-box set ups of Apache for Linux run the web server as "nobody". If you are in a shared environment or running Cpanel, you may run into issues since your cron job will be set up to run as your domain user.

Unless you have root access to the system, you will not be able to set the cron job to run as nobody. I did not have much luck with changing permissions on the directories either.

We ran into the same issue and strangely it only effected few users. I would had guess it would effect everyone. Once we switched the cron to run as "nobody" however, it fixed the issue.

When you look in the cache directory you will see that one or two folders will be owned by your domain user and the rest are owned by nobody.

What are those files that get created by the cronjob are they really needed or can something be done to avoid this?
vcatalyst
Posts: 15
Joined: Tue Dec 11, 2007 6:42 am
Location: Florida
Contact:

Still not working

Post by vcatalyst »

Well looks like nobody will not run the cron job. :(

In another product I use they let the web server run the cron instead of running it as a user in cron. For example, they use Lynx to run the php page, but since the code is being executed by the browser, it runs as nobody.

Of course for security reason, there has to be some kind of check to see who is running it. I believe it is set to only run by a certain host name or ip.

Hope this helps.
Locked