Can't add new user

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
rkeidel
Posts: 5
Joined: Tue Jan 30, 2007 5:37 pm

Can't add new user

Post by rkeidel »

Hello,

I have a new installed timetrex version 1.4.2 on a OpenSUSE 10.2; The installation went just fine. After I started to create my company I wanted to add a new user. I add all necessary information and after I clicked "submit" it says "Form data has been saved". But if I look in to the user list I can't find the added user. I hope you can help me. I added the debug output to this post.

Thanks for your help, Rok



Debug Buffer
============================================================================
Memory Usage: 12036888
----------------------------------------------------------------------------
DEBUG [135]: [Function](): URI: /timetrex/interface/users/EditUser.php?id=7&saved_search_id=&data_saved=1
DEBUG [137]: [Function](): Production: 1
DEBUG [92]: TTDate::setTimeZone(): Setting TimeZone: PST8PDT
DEBUG [444]: Authentication::Check(): Session Name: SessionID
DEBUG [450]: Authentication::Check(): Session ID: 6a6863d2ef69285eabcad4faca09ce22
DEBUG [301]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:6a6863d2ef69285eabcad4faca09ce22
DEBUG [78]: Authentication::getIdle(): Idle Seconds Allowed: 14400
DEBUG [301]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:6a6863d2ef69285eabcad4faca09ce22
DEBUG [62]: [Function](): User Authenticated: admin
DEBUG [1696]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [92]: TTDate::setTimeZone(): Setting TimeZone: US/Pacific
DEBUG [108]: TTDate::setDateFormat(): Setting Default Date Format: m/d/Y
DEBUG [122]: TTDate::setTimeFormat(): Setting Default Time Format: g:i a
DEBUG [136]: TTDate::setTimeUnitFormat(): Setting Default Time Unit Format: 10
DEBUG [1696]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [954]: UserPreferenceFactory::isPreferencesComplete(): User Preferences IS Complete:
DEBUG [105]: [Function](): Station ID Cookie found! c65ed7be53ac4bc17dcd8c175348dd00
DEBUG [196]: [Function](): UnRead Messages: 0
DEBUG [428]: HierarchyListFactory::getHierarchyChildrenByCompanyIdAndUserIdAndObjectTypeID(): Hierarchy Control ID: 1
DEBUG [54]: FastTree::__construct(): Contruct...
DEBUG [60]: FastTree::__construct(): Setting Table to: hierarchy_tree
DEBUG [77]: FastTree::setTree(): Setting Tree ID to: 1
DEBUG [116]: FastTree::getNode(): Object ID: 0
DEBUG [98]: FastTree::_setupTree(): NOT Initiating Tree with Root object:
DEBUG [77]: FastTree::setTree(): Setting Tree ID to: 1
DEBUG [116]: FastTree::getNode(): Object ID: 0
DEBUG [98]: FastTree::_setupTree(): NOT Initiating Tree with Root object:
DEBUG [179]: FastTree::getParentId(): Object ID: 1
DEBUG [116]: FastTree::getNode(): Object ID: 1
DEBUG [327]: FastTree::getAllChildren(): Object ID: Recurse:
DEBUG [336]: FastTree::getAllChildren(): Getting Root ID: 0
DEBUG [116]: FastTree::getNode(): Object ID: 0
DEBUG [345]: FastTree::getAllChildren(): Left ID: 0 Level: 0
DEBUG [59] Array: HierarchyListFactory::getChildLevelIdArrayByHierarchyControlIdAndUserId(): Nodes at the same level

bool(false)


DEBUG [352]: [Function](): ID IS set
DEBUG [48]: BreadCrumb::setCrumb(): Dropping Bread Crumb: Edit Employee URL: /timetrex/interface/users/EditUser.php?id=7&saved_search_id=&data_saved=1
DEBUG [376]: [Function](): Title:
DEBUG [54]: FastTree::__construct(): Contruct...
DEBUG [60]: FastTree::__construct(): Setting Table to: user_group_tree
DEBUG [77]: FastTree::setTree(): Setting Tree ID to: 1
DEBUG [116]: FastTree::getNode(): Object ID: 0
DEBUG [98]: FastTree::_setupTree(): NOT Initiating Tree with Root object:
DEBUG [327]: FastTree::getAllChildren(): Object ID: Recurse: RECURSE
DEBUG [336]: FastTree::getAllChildren(): Getting Root ID: 0
DEBUG [116]: FastTree::getNode(): Object ID: 0
DEBUG [345]: FastTree::getAllChildren(): Left ID: 1 Level: 0
============================================================================

============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 14.7831 ms (6.50 %) Authentication::Check()
1 10.1659 ms (4.47 %) Interface.inc - Check for Exceptions
1 6.7642 ms (2.97 %) Interface.inc - Check for UNREAD messages...
3 2.9907 ms (1.31 %) getEmptyRecordSet()
1 10.0110 ms (4.40 %) getPermissionHierarchyChildrenByCompanyIdAndUserId
1 103.1988 ms (45.37 %) unprofiled

79.5643 ms (34.98 %) Missed
============================================================================
227.4780 ms (100.00 %) OVERALL TIME
============================================================================
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Can you check the "users" table in the database directly to see if the user data is truly being saved?
rkeidel
Posts: 5
Joined: Tue Jan 30, 2007 5:37 pm

Post by rkeidel »

Hi Shaun,

I can add a user directly through the backend, and for example the admin user is in the table. I hope that is the answer you are looking for. If not let me know. I'm happy to give you any information you need to help me.

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

Post by shaunw »

So the employees you are trying to create through the interface aren't actually getting into the database... Try to add another new employee, but this time just before you press the submit button, change the debug verbosity in your timetrex.ini.php to 11. Then paste the output here.

Before you do that though, delete all directories/files from your cache directory, usually /tmp/timetrex.
rkeidel
Posts: 5
Joined: Tue Jan 30, 2007 5:37 pm

Post by rkeidel »

Hi,

thanks again for your help.
Ok, I delete everything in /tmp/timetrex

I also changed verbosity to 11. Here is the output.

(mysqlt): SET SESSION sql_mode='ansi' (mysqlt): select session_id,user_id,ip_address,created_date,updated_date from authentication WHERE session_id = '8d4fbb6680bcdb359dcee75e7b0e4c29' AND ip_address = '192.168.1.71' AND updated_date >= 1170273322 (mysqlt): update authentication set updated_date = 1170287722 where session_id = '8d4fbb6680bcdb359dcee75e7b0e4c29' (mysqlt): SET SESSION time_zone='US/Pacific' (mysqlt): select * from station where company_id = '1' AND station_id = '87c59f58268d57adae689edb8eead39a' 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 = '11' AND b.date_stamp < '2007-01-31 00:00:00' 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): SELECT a.object_id, a.parent_id, a.left_id, a.right_id, count(b.object_id)-1 as level FROM hierarchy_tree a LEFT JOIN hierarchy_tree b ON a.tree_id = b.tree_id AND a.left_id BETWEEN b.left_id AND b.right_id WHERE a.tree_id = '1' AND a.object_id = 0 GROUP BY a.object_id, a.left_id, a.object_id, a.parent_id, a.right_id (mysqlt): SELECT a.object_id, a.parent_id, a.left_id, a.right_id, count(b.object_id)-1 as level FROM hierarchy_tree a LEFT JOIN hierarchy_tree b ON a.tree_id = b.tree_id AND a.left_id BETWEEN b.left_id AND b.right_id WHERE a.tree_id = '1' AND a.object_id = 0 GROUP BY a.object_id, a.left_id, a.object_id, a.parent_id, a.right_id (mysqlt): SELECT a.object_id, a.parent_id, a.left_id, a.right_id, count(b.object_id)-1 as level FROM hierarchy_tree a LEFT JOIN hierarchy_tree b ON a.tree_id = b.tree_id AND a.left_id BETWEEN b.left_id AND b.right_id WHERE a.tree_id = '1' AND a.object_id = '11' GROUP BY a.object_id, a.left_id, a.object_id, a.parent_id, a.right_id (mysqlt): SELECT object_id FROM hierarchy_tree WHERE tree_id = '1' AND parent_id = -1 LIMIT 1 (mysqlt): SELECT a.object_id, a.parent_id, a.left_id, a.right_id, count(b.object_id)-1 as level FROM hierarchy_tree a LEFT JOIN hierarchy_tree b ON a.tree_id = b.tree_id AND a.left_id BETWEEN b.left_id AND b.right_id WHERE a.tree_id = '1' AND a.object_id = '0' GROUP BY a.object_id, a.left_id, a.object_id, a.parent_id, a.right_id (mysqlt): SELECT a.object_id, a.parent_id, count(b.object_id)-1 as level FROM hierarchy_tree a LEFT JOIN hierarchy_tree b ON a.tree_id = b.tree_id AND a.left_id BETWEEN b.left_id AND b.right_id WHERE a.tree_id = '1' AND a.parent_id = '0' GROUP BY a.object_id, a.parent_id, a.left_id ORDER BY a.left_id (mysqlt): select id from users where user_name = 'testuser01' AND deleted=0 LIMIT 1 (mysqlt): select * from pay_period_schedule where id = '1' AND deleted=0 (mysqlt): select * from policy_group where id = '1' AND deleted = 0 (mysqlt): select id from users where employee_number = '1001' AND company_id = '1' AND deleted=0 LIMIT 1 (mysqlt): select * from department where id = '2' AND deleted = 0 (mysqlt): select * from user_group where id = '2' (mysqlt): SET AUTOCOMMIT=0 (mysqlt): BEGIN (mysqlt): update users_id_seq set id=LAST_INSERT_ID(id+1); /tmp/timetrex//54/adodb_54895d42e64e255a88b3e3f2f5206316.cache reloaded, ttl=86133 [ select company_id,status_id,user_name,phone_id,password,first_name,title_id,middle_name,last_name,sex_id,address1,address2,city,country,province,postal_code,work_phone,work_phone_ext,home_phone,mobile_phone,fax_phone,home_email,work_email,sin,birth_date,hire_date,termination_date,employee_number,default_branch_id,default_department_id,group_id,ibutton_id,note,created_date,created_by,updated_date,updated_by,id from users where id = -1 ]
(mysqlt): INSERT INTO users ( COMPANY_ID, STATUS_ID, USER_NAME, PHONE_ID, PASSWORD, FIRST_NAME, TITLE_ID, MIDDLE_NAME, LAST_NAME, SEX_ID, ADDRESS1, ADDRESS2, CITY, COUNTRY, PROVINCE, POSTAL_CODE, WORK_PHONE, WORK_PHONE_EXT, HOME_PHONE, MOBILE_PHONE, FAX_PHONE, HOME_EMAIL, WORK_EMAIL, SIN, BIRTH_DATE, HIRE_DATE, TERMINATION_DATE, EMPLOYEE_NUMBER, DEFAULT_BRANCH_ID, DEFAULT_DEPARTMENT_ID, GROUP_ID, IBUTTON_ID, NOTE, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY, ID ) VALUES ( 1, 10, 'testuser01', '', '0e4023ae37a250d099406b80d54f076cc73784e3', 'Test', 0, '', 'User', 10, '', '', 'Compton', 'US', 'CA', '', '310-637-1137', '', '', '', '', '', '', '', 1170230400, 1170230400, null, '1001', 1, 2, 2, '', '', 1170287722, 11, 1170287722, 11, 10 ) 1062: Duplicate entry '10' for key 1

ADOConnection._Execute(INSERT INTO users ( COMPANY_ID, STATUS_ID, USER_NAME, PHONE_ID, PASSWORD, FIRST_NAME, TITLE_ID, MIDDLE_NAME, LAST_NAME, SEX_ID, ..., false) % line 861, file: adodb.inc.php
ADOConnection.Execute(INSERT INTO users ( COMPANY_ID, STATUS_ID, USER_NAME, PHONE_ID, PASSWORD, FIRST_NAME, TITLE_ID, MIDDLE_NAME, LAST_NAME, SEX_ID, ...) % line 832, file: Factory.class.php
Factory.Save(false) % line 342, file: EditUser.php

(mysqlt): update system_log_id_seq set id=LAST_INSERT_ID(id+1); /tmp/timetrex//ab/adodb_ab351cbfe58e0c708f497c6b2de1ba0b.cache reloaded, ttl=86133 [ 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 ( 10, 10, 'users', 11, 'User Information', 1170287722, 715 ) (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 = 10 AND a.deleted=0 (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 = '2' AND user_id = 10 (mysqlt): DELETE FROM pay_period_schedule_user WHERE id = '8' (mysqlt): select * from users where id = '10' 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 = '10' AND b.deleted=0 LIMIT 1 (mysqlt): update pay_period_schedule_user_id_seq set id=LAST_INSERT_ID(id+1); /tmp/timetrex//8c/adodb_8c293fd73b5b1cb45ef8e520c6b058e4.cache reloaded, ttl=86133 [ select pay_period_schedule_id,user_id,id from pay_period_schedule_user where id = -1 ]
(mysqlt): INSERT INTO pay_period_schedule_user ( PAY_PERIOD_SCHEDULE_ID, USER_ID, ID ) VALUES ( 1, 10, 23 ) (mysqlt): select a.*, b.user_id as user_id from policy_group as a, policy_group_user as b where a.id = b.policy_group_id AND b.user_id in (10) AND a.deleted = 0 (mysqlt): select a.* from policy_group_user as a, policy_group as b where b.id = a.policy_group_id AND a.policy_group_id = '2' AND a.user_id = 10 (mysqlt): DELETE FROM policy_group_user WHERE id = '8' (mysqlt): select * from policy_group where id = '1' AND deleted = 0 (mysqlt): select a.id from policy_group_user as a, policy_group as b where a.policy_group_id = b.id AND a.user_id = '10' AND b.deleted=0 LIMIT 1 (mysqlt): update policy_group_user_id_seq set id=LAST_INSERT_ID(id+1); /tmp/timetrex//b2/adodb_b27fee3a210c683e77e447b83ef9ae91.cache reloaded, ttl=86133 [ select policy_group_id,user_id,id from policy_group_user where id = -1 ]
(mysqlt): INSERT INTO policy_group_user ( POLICY_GROUP_ID, USER_ID, ID ) VALUES ( 1, 10, 22 ) (mysqlt): select * from user_default where company_id = '1' AND deleted = 0 (mysqlt): select a.* from user_default_company_deduction as a where a.user_default_id = '1' (mysqlt): update user_preference_id_seq set id=LAST_INSERT_ID(id+1); /tmp/timetrex//46/adodb_4686735287f653a541823202ba758452.cache reloaded, ttl=86133 [ select user_id,date_format,time_format,time_unit_format,time_zone,items_per_page,start_week_day,created_date,created_by,updated_date,updated_by,id from user_preference where id = -1 ]
(mysqlt): INSERT INTO user_preference ( USER_ID, DATE_FORMAT, TIME_FORMAT, TIME_UNIT_FORMAT, TIME_ZONE, ITEMS_PER_PAGE, START_WEEK_DAY, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY, ID ) VALUES ( 10, 'm-d-Y', 'g:i a', '20', 'US/Pacific', 20, 1, 1170287722, 11, 1170287722, 11, 28 ) (mysqlt): update system_log_id_seq set id=LAST_INSERT_ID(id+1); /tmp/timetrex//ab/adodb_ab351cbfe58e0c708f497c6b2de1ba0b.cache reloaded, ttl=86133 [ 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 ( 28, 10, 'user_preference', 11, 'User Preferences', 1170287722, 716 ) (mysqlt): ROLLBACK (mysqlt): SET AUTOCOMMIT=1 Smart Rollback occurred

(mysqlt): select a.*, b.name as group_name from help as a, help_group_control as b, help_group as c where b.id = c.help_group_control_id AND c.help_id = a.id AND b.script_name = 'EditUser.php' AND a.type_id = 10 AND a.deleted=0 AND b.deleted=0 ORDER BY c.order_value asc

(mysqlt): SELECT name,url FROM bread_crumb WHERE user_id = '11' ORDER BY created_date DESC LIMIT 5 Home > Edit Employee Permissions > Employee List
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Code: Select all

(mysqlt): INSERT INTO users ( COMPANY_ID, STATUS_ID, USER_NAME, PHONE_ID, PASSWORD, FIRST_NAME, TITLE_ID, MIDDLE_NAME, LAST_NAME, SEX_ID, ADDRESS1, ADDRESS2, CITY, COUNTRY, PROVINCE, POSTAL_CODE, WORK_PHONE, WORK_PHONE_EXT, HOME_PHONE, MOBILE_PHONE, FAX_PHONE, HOME_EMAIL, WORK_EMAIL, SIN, BIRTH_DATE, HIRE_DATE, TERMINATION_DATE, EMPLOYEE_NUMBER, DEFAULT_BRANCH_ID, DEFAULT_DEPARTMENT_ID, GROUP_ID, IBUTTON_ID, NOTE, CREATED_DATE, CREATED_BY, UPDATED_DATE, UPDATED_BY, ID ) VALUES ( 1, 10, 'testuser01', '', '0e4023ae37a250d099406b80d54f076cc73784e3', 'Test', 0, '', 'User', 10, '', '', 'Compton', 'US', 'CA', '', '310-637-1137', '', '', '', '', '', '', '', 1170230400, 1170230400, null, '1001', 1, 2, 2, '', '', 1170287722, 11, 1170287722, 11, 10 ) 1062: Duplicate entry '10' for key 1 
It looks like by manually entering data into the users table you have caused a primary key conflict.

Run this SQL query:

update users_id_seq set id = 100;

Then try adding the user again.
rkeidel
Posts: 5
Joined: Tue Jan 30, 2007 5:37 pm

Post by rkeidel »

Thank you.

that solved my problem.

ROK
Locked