Initial Sync for a user shows Synced but not all the folders get synced

  • 7008012
  • 28-Feb-2011
  • 10-Dec-2013

Environment

Novell Data Synchronizer 1.0
Novell Data Synchronizer Connector for Mobility
Novell Data Synchronizer Mobility Pack

Situation

Initial Sync for a user shows Synced but not all the folders get synced
Unable to see all the folders on the Device
Removing the user from both the connectors and adding again still does not pull down all the folders
Unable to see all the folders in the Mobility Monitoring page for a user
ERROR: "EXCEPTION: IntegrityError: ('23505', '[23505] ERROR: duplicate key value violates unique constraint "objectMappings_pkey";\nError while executing the query (7) (SQLExecDirectW)') " in syncengine log file when the log level is set to Debug/Verbose/Diagnostic

Resolution

There are times when a user is removed and readded from the GroupWise connector and Mobility Connector but the "objectMappings" table does not get cleaned up properly. Please follow the steps listed below. Please be careful while following these steps as incorrectly modifying the database can destroy the mobility server.
  1. Remove the user from both the Connectors (groupwise and mobility). If the user was added using a group, remove the user from the group and restart datasync by typing "rcdatasync restart ".
  2. Type psql -U datasync_user datasync and press Enter.
  3. Enter in the database password. If the database password is not known, please check /etc/datasync/configengine/configengine.xml file as the password is stored in plaintext in the following format
    <db>datasync</db>
    <username>datasync_user</username>
    <password>novell</password>
  4. Once the password has been entered, please type select * from "objectMappings" where "objectID" like '%userid%'; and press Enter. Replace userid with the userid in eDirectory and make sure to type in the semi-colon (;) at the end of the command. Example
    select * from "objectMappings" where "objectID" like '%mperry%';
  5. If entries are seen for that user, please type
    delete from "objectMappings" where "objectID" like '%userID%'; and press Enter. Replace userid with the userid in eDirectory and make sure to type in the semi-colon (;) at the end of the command. Example
    delete from "objectMappings" where "objectID" like '%mperry%';
  6. If the user needs to be added to the group, add the user to to the group and follow step 7. If the user does not need to be added to the group directly follow step 7.
  7. Restart DataSync by typing "rcdatasync restart " and press Enter.
  8. If step 6 was not done, add the user to groupwise connector first and then to mobility connector.

Additional Information

Notes:
 
Error in the /var/log/datasync/syncengine/engine.log in Debug/Verbose/Diagnostic mode 
 
2011-02-23 15:07:41.860 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:248] [userID:] [eventID:] [objectID:] [] EXCEPTION: ********************
2011-02-23 15:07:41.860 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION: Traceback (most recent call last):
2011-02-23 15:07:41.860 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:   File "/opt/novell/datasync/common/lib/PySQLPool/PySQLQuery.py", line 141, in Query
2011-02-23 15:07:41.860 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:     cursor.execute(query)
2011-02-23 15:07:41.860 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION: IntegrityError: ('23505', '[23505] ERROR: duplicate key value violates unique constraint "objectMappings_pkey";\nError while executing the query (7) (SQLExecDirectW)')
2011-02-23 15:07:41.860 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:252] [userID:] [eventID:] [objectID:] [] EXCEPTION: ********************
2011-02-23 15:07:41.861 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:248] [userID:] [eventID:] [objectID:] [] EXCEPTION: ********************
2011-02-23 15:07:41.861 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION: Traceback (most recent call last):
2011-02-23 15:07:41.861 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:   File "syncengine/lib/syncengine/folders.py", line 144, in submitFolderListByTargetName
2011-02-23 15:07:41.861 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:   File "syncengine/lib/syncengine/folders.py", line 207, in submitFolderList
2011-02-23 15:07:41.862 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:   File "syncengine/lib/syncengine/cache.py", line 218, in mapObjectID
2011-02-23 15:07:41.862 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:   File "syncengine/lib/syncengine/engine.py", line 919, in databaseQuery
2011-02-23 15:07:41.862 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:   File "/opt/novell/datasync/common/lib/PySQLPool/PySQLQuery.py", line 196, in Query
2011-02-23 15:07:41.862 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION:     raise self.lastError
2011-02-23 15:07:41.862 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:251] [userID:] [eventID:] [objectID:] [] EXCEPTION: IntegrityError: ('23505', '[23505] ERROR: duplicate key value violates unique constraint "objectMappings_pkey";\nError while executing the query (7) (SQLExecDirectW)')
2011-02-23 15:07:41.862 DEBUG_VERBOSE [CP WSGIServer Thread-36] [util:252] [userID:] [eventID:] [objectID:] [] EXCEPTION: ********************