Unable to delete recurring schedules

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Unable to delete recurring schedules

Post by mistermudd »

I set a few employees to follow some recurring schedule templates I created.

However, when I attempt to delete any of the recurring schedules (not templates) it refreshes the page but nothing changes.

I also tried to change which template each employee follows, however, I was still unable to delete any records.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Please follow the instructions in this post to enable debugging mode:

http://forums.timetrex.com/viewtopic.php?t=89

Then copy and paste the debug output here for further analysis.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

(postgres7): select session_id,user_id,ip_address,created_date,updated_date from authentication WHERE session_id = ? AND ip_address = ? AND updated_date >= ? [ (session_id=>'9ef38455912e81ddbc88805e7f0cb9a2') (ip_address=>'127.0.0.1') (updated_date=>'1190045554') ]
________________________________________
________________________________________
(postgres7): update authentication set updated_date = ? where session_id = ? [ (updated_date=>'1190059954') (session_id=>'9ef38455912e81ddbc88805e7f0cb9a2') ]
________________________________________
________________________________________
(postgres7): select * from station where company_id = ? AND station_id = ? AND deleted = 0 [ (company_id=>'1') (station_id=>'a9c494f8beb1e9c1a04c3c68e647cbdd') ]
________________________________________
________________________________________
(postgres7): select * from cron WHERE deleted = 0 ORDER BY last_run_date DESC LIMIT 1
________________________________________
________________________________________
(postgres7): 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 = ? AND b.date_stamp < ? AND e.status_id = ? 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 [ (user_id=>'5') (date_stamp=>'2007-09-17') (status_id=>'10') ]
________________________________________
________________________________________
(postgres7): select name FROM bread_crumb WHERE user_id = ? AND name = ? LIMIT 1 [ (user_id=>'5') (name=>'Recurring Schedule List') ]
________________________________________
________________________________________
(postgres7): UPDATE bread_crumb SET url = ?, created_date = ? WHERE user_id = ? AND name = ? [ (url=>'/interface/schedule/RecurringScheduleControlList.php?select_all=...') (created_date=>'1190059954') (user_id=>'5') (name=>'Recurring Schedule List') ]
________________________________________
________________________________________
(postgres7): select * from recurring_schedule_control as a where company_id = ? AND id = ? AND deleted = 0 [ (company_id=>'1') (id=>'1') ]
________________________________________
________________________________________
(postgres7): select a.* from recurring_schedule_user as a where a.recurring_schedule_control_id = ? [ (id=>'1') ]
________________________________________
________________________________________
(postgres7): select a.* from recurring_schedule_user as a where a.recurring_schedule_control_id = ? [ (id=>'1') ]
________________________________________
________________________________________
(postgres7): select * from recurring_schedule_control where id = ? AND deleted = 0 [ (id=>'1') ]
________________________________________

Fatal error: Call to a member function getCurrent() on a non-object in C:\Program Files\TimeTrex\timetrex\classes\modules\schedule\RecurringScheduleControlFactory.class.php on line 227
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

This is very strange, is it possible for you to email support@timetrex.com a SQL dump of your database so we can try to replicate the issue here?
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

I know I sound naive, but if you could give me the command string I need to type in, in order to get a dump, I would appreciate it.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

What I mean is:

I type in:

"pg_dumpall -h localhost -p 5433 -U timetrex -W > output.txt"

When it prompts for the password, I enter the password as found in the timetrex.ini.php file. It then returns the following:
C:\Program Files\TimeTrex\postgresql\bin>pg_dumpall -h localhost -p 5433 -U timetrex -W > output.txt
Password:

pg_dumpall: query failed: ERROR: permission denied for relation g_authid
pg_dumpall: query was: SELECT rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcatupdate, rolcanlogin, rolconnlimit, rolpassword, rolvaliduntil, pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment FROM pg_authid ORDERBY 1
So I assume I am using the wrong user/pass. I guess I need the superuser password, but I cannot recall setting one up.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

How did you install TimeTrex? If you used the installer, there should be a backup_timetrex.bat file in the TimeTrex directory that you can just run.

Failing that, try this command instead:
pg_dump -h localhost -p 5433 -U timetrex -W timetrex > output.sql
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

Ahhh... ok.

I have never messed with databases before (other than Acce$$). This is new to me.

I will send the email shortly.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

shaunw wrote:How did you install TimeTrex? If you used the installer, there should be a backup_timetrex.bat file in the TimeTrex directory that you can just run.

Failing that, try this command instead:
pg_dump -h localhost -p 5433 -U timetrex -W timetrex > output.sql
I did use the windows installer, however I did not have the *.bat file you mentioned.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

We loaded up your SQL dump and were able to delete all your recurring schedules without any problem whatsoever.

We would need access to your TimeTrex server to troubleshoot this issue further.

One thing you could try as a last ditch effort is deleting everything from your timetrex/cache directory.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

I went ahead and tried a clean install, and changed some things around on my system and will check to see if it works.

One question though, how do I restore that *.sql file?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

You will need to use a command like this:

Code: Select all

psql -h localhost -p 5433 -U timetrex -W timetrex < output.sql
You will want to drop the current "timetrex" database first though, or create a new database to load it into, otherwise you will get conflicts.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

Sorry to be such a pain in the neck here, but here is what happened...

I ran
dropdb -h localhost -p 5433 -U timetrex -W timetrex
, no errors...

I ran
psql -h localhost -p 5433 -U timetrex -W timetrex < output.sql
and it stated "database timetrex does not exist"

I went to run
createdb -h localhost -p 5433 -U timetrex -W timetrex
and it returned the error "permission denied to create database".

I then attempted to run
createdb -h localhost -p 5433 timetrex
with the same permission denied error.

what account do I need to use to create the database?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Try creating the database with the "postgres" user:

Code: Select all

createdb -h localhost -p 5433 -U postgres -W timetrex
Same password as the timetrex user.

Just so you know, doing a clean install with the exact same database while possible, is unlikely to make any difference.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

Oh well... I thought it might make a difference since you were able to load it just fine. If by some miracle I get this figured out, I will let you know.
Locked