Page tree
Skip to end of metadata
Go to start of metadata

This page is a generic place to make a note of sync bugs encountered, and how the bug was cleared.  The idea now is just to get to this page started... as it becomes larger, we will have to work on better organization.

BUG: Sync record fails to import because on a parent server, a record containing an obs is generated before the record for the owning encounter. 

DIAGNOSIS: Error message in logs on child server similar to the following:

ERROR - HibernateSyncDAO.processCollection(1191) |2012-06-20 15:58:59,800| Cannot retrieve the collection's owner object.
ERROR - HibernateSyncDAO.processCollection(1192) |2012-06-20 15:58:59,801| Owner info:
ownerClassName:org.openmrs.Encounter
ownerCollectionPropertyName:obs
ownerCollectionAction:update
ownerUuid:d29a071d-4839-4cc2-8056-666bf4f8ec0dERROR - HibernateSyncDAO.processCollection(1191) |2012-06-20 15:58:59,800| Cannot retrieve the collection's owner object.

CAUSE: Unknown... underlying sync issue still needs to be researched.

SOLUTION: To clear the error, mark the offending obs record(s) to be ignored against all child servers.  Then on the parent server, go to the encounter and edit all the obs. (An easy way to do this is simply to add an edit comment like "fixing sync issue" without actually making any changes to obs itself).  This will cause a new sync record to be generated with the obs data.  Confirm that this record (or records) syncs, and then confirm through the ui that the encounter + obs are identical on both parent and child.

BUG: Maximum Retry Count Reached, Will No Longer Retry

DIAGNOSIS: The server has attempted to send the sync record too many times and is giving up.

CAUSE: The receiving server is encountering an error when importing that record.

SOLUTION:

  1. Check the server logs of the server receiving that record. Try to fix according to error message in server log.
  2. Increase the "retry limit" for the first server temporarily so that the records are attempted to send again                                                                                                                                                                                                                               

___

BUG: Sync record fails to import because somehow on the server the record was created on, the user (..creator of the record) got replaced after the sync record was created and the UUID for the user in the sync record screen doesn't seem to exist.

DIAGNOSIS: This example shows an Error message in logs on parent server when a user on the child (..who exists also on the parent) has created a patient, and Sync replaced his uuid when the sync record was created

ERROR - SyncIngestServiceImpl.processOpenmrsObject(562) |2013-02-20 10:18:23,380| Unexpected exception occurred while saving openmrsobject: org.openmrs.Patient, uuid 'c62287c2-f645-44ce-92c2-bcb6d3074d52'
ERROR - SyncIngestServiceImpl.processSyncRecord(298) |2013-02-20 10:18:23,382| Unable to ingest a sync request
org.openmrs.module.sync.ingest.SyncIngestException: Could not save item for unknown reasons - could not insert: [org.openmrs.Patient]
at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processOpenmrsObject(SyncIngestServiceImpl.java:563)
at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncItem(SyncIngestServiceImpl.java:423)
at sun.reflect.GeneratedMethodAccessor1145.invoke(Unknown Source)

...down the stack trace

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'creator' cannot be null
at sun.reflect.GeneratedConstructorAccessor304.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

CAUSE: Unknown...

SOLUTION: For this example, identify the real creator of the record first and then from the sync record screen, replace the UUID for the openmrs user with the correct uuid and try and resend the record.

____

BUG: Sync record fails to import on the a server because the record contains a relationship and one person in the relationship is missing in the current sever database.

DIAGNOSIS: Error message in logs on the receiving server similar to the following:

ERROR - SyncIngestServiceImpl.processOpenmrsObject(562) |2013-03-20 10:17:44,756| Unexpected exception occurred while saving openmrsobject: org.openmrs.Relationship, uuid '*********-********'

ERROR - SyncIngestServiceImpl.processSyncRecord(298) |2013-03-20 10:17:44,758| Unable to ingest a sync request

org.openmrs.module.sync.ingest.SyncIngestException: Could not save item for unknown reasons - not-null property references a null or transient value: org.openmrs.Relationship.personA

at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processOpenmrsObject(SyncIngestServiceImpl.java:563)

at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncItem(SyncIngestServiceImpl.java:423)

at sun.reflect.GeneratedMethodAccessor510.invoke(Unknown Source)

......down the stack trace

Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.openmrs.Relationship.personA

at org.hibernate.engine.Nullability.checkNullability(Nullability.java:100)

at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:312)

......down the stack trace

ERROR - SyncUtilTransmission.processSyncTransmission(499) |2013-03-20 10:17:44,795| Sync error while ingesting records for server: [Server Name]

org.openmrs.module.sync.ingest.SyncIngestException: Could not save item for unknown reasons - not-null property references a null or transient value: org.openmrs.Relationship.personA

at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processOpenmrsObject(SyncIngestServiceImpl.java:563)

at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncItem(SyncIngestServiceImpl.java:423)

at sun.reflect.GeneratedMethodAccessor510.invoke(Unknown Source)

...

CAUSE: Unknown...

SOLUTION: 

-Check to confirm that the person is missing on the receiving server

-Go on the server that sent the record and mark the failing record to be ignored ( use the “Remove as NOT SUPPOSED TO SYNC” link)

-On that server again , go to Manage Persons, search for the person and try to save the person again. This will cause a new sync record to be generated with the person data

-Confirm that this record syncs and go on the receiving server to see if the person has been created

-Go back to the sending server and set the failing record as a new sync record (by clicking the “Reset as NEW Sync Record” link)

-Confirm that the new record syncs, and Go to the receiving server to see if the record has been created

_____

BUG: Sync record fails to import because there is a missing PersonAttribute on a the current server.

DIAGNOSIS: Error message in logs on the server similar to the following:

ERROR - HibernateSyncDAO.processCollection(1273) |2013-03-25 09:27:29,935| Was not able to retrieve reference to the collection entry object by uuid.

ERROR - HibernateSyncDAO.processCollection(1274) |2013-03-25 09:27:29,936| Entry info: 

entryClassName: org.openmrs.PersonAttribute

entryUuid: 1813db65-a474-4af0-8132-b388ff13a9c0

entryAction: update

ERROR - HibernateSyncDAO.processCollection(1276) |2013-03-25 09:27:29,937| Sync record original uuid: 70358145-774b-4b91-b0c0-41615071552e|18792d72-7338-11e0-96bf-001e68a9fdcf

ERROR - SyncIngestServiceImpl.processSyncRecord(298) |2013-03-25 09:27:29,940| Unable to ingest a sync request

org.openmrs.module.sync.ingest.SyncIngestException: Could not find an object of type: org.openmrs.Patient missing org.openmrs.PersonAttribute with a uuid 1813db65-a474-4af0-8132-b388ff13a9c0

at org.openmrs.module.sync.api.db.hibernate.HibernateSyncDAO.processCollection(HibernateSyncDAO.java:1277)

at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncItem(SyncIngestServiceImpl.java:420)

....

CAUSE: The receiving server doesn't have the PersonAttribute specified in the sync record.

SOLUTION: I couldn't find a way to get a sync record with all the elements as the original one created, so I had to use manual sql to get the missing PersonAttribute created.

-Go first to the server that sent the record and check column values for the offending PersonAttribute. In my case, on the sending server I ran:

 SELECT * FROM person_attribute where uuid="1813db65-a474-4af0-8132-b388ff13a9c0"; 

-Then use the values you get to run the insert statement on the server that is missing the record:

INSERT INTO person_attribute (person_id, value, person_attribute_type_id, creator,
date_created, changed_by, date_changed, voided, voided_by, date_voided, void_reason, uuid )
SELECT (select person_id from person where uuid = "5cd067a6-5845-11df-b810-001e68a9fdcf"), 67, 7, 9324, '2012-10-15 11:05:46',10647, '2013-03-21 10:33:08',1, 9324,
'2013-03-21 10:39:58', 'New value: 75', '1813db65-a474-4af0-8132-b388ff13a9c0' FROM person_attribute
WHERE NOT EXISTS (SELECT * FROM person_attribute where
uuid = "1813db65-a474-4af0-8132-b388ff13a9c0")
LIMIT 1;

 

---------

BUGA sync record fails to import on a child server because when the parent server received the sync record (...from the original server where the record was created), it created the record but gave it a null payload.

DIAGNOSIS: Error message in logs on the server similar to the following:

ERROR - SyncIngestServiceImpl.processSyncRecord(306) |2013-05-16 10:27:18,546| Unexpected exception occurred when processing sync records
java.lang.NullPointerException
at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncRecord(SyncIngestServiceImpl.java:198)
at sun.reflect.GeneratedMethodAccessor530.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)

...

ERROR - SyncUtilTransmission.processSyncTransmission(499) |2013-05-16 10:27:19,929| Sync error while ingesting records for server: Rwinkwavu
org.openmrs.module.sync.ingest.SyncIngestException: Unable to process sync record, processing terminated unexpectedly.
at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncRecord(SyncIngestServiceImpl.java:310)
at sun.reflect.GeneratedMethodAccessor530.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

...

Caused by: java.lang.NullPointerException
at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncRecord(SyncIngestServiceImpl.java:198)
... 42 more

CAUSE:  Unknown...

SOLUTION: On the parent, identify the id of the failing record and update its payload using its value from the original server.

update sync_record set payload ='<items><SyncItem containedType="org.openmrs.DrugOrder" key="59365770-7a5d-4757-91c7-724f50b87303" state="UPDATED"><content><![CDATA[<org.openmrs.DrugOrder><startDate type="timestamp">2008-10-07T00:00:00.000+0200</startDate><complex type="boolean">false</complex><concept type="org.openmrs.Concept">3cd51772-26fe-102b-80cb-0017a47871b2</concept><instructions type="string"></instructions><orderType type="org.openmrs.OrderType">bcf7fb8e-2700-102b-80cb-0017a47871b2</orderType><discontinuedReason type="org.openmrs.Concept">3cdd5176-26fe-102b-80cb-0017a47871b2</discontinuedReason><frequency type="string">1/day x 7 days/week</frequency><units type="string">tab(s)</units><dose type="double">1.0</dose><creator type="org.openmrs.User">0d10b690-ce88-404d-9cd4-e82818b7351a</creator><patient type="org.openmrs.Patient">53d78221-1fc5-4972-9b3c-7b1e34f50dc5</patient><voided type="boolean">false</voided><prn type="boolean">false</prn><dateCreated type="timestamp">2011-07-07T18:34:43.000+0200</dateCreated><uuid type="string">59365770-7a5d-4757-91c7-724f50b87303</uuid><discontinued type="boolean">true</discontinued><discontinuedBy type="org.openmrs.User">0d10b690-ce88-404d-9cd4-e82818b7351a</discontinuedBy><drug type="org.openmrs.Drug">42f04f8c-26fe-102b-80cb-0017a47871b2</drug><discontinuedDate type="timestamp">2008-10-07T23:59:00.000+0200</discontinuedDate></org.openmrs.DrugOrder>]]></content></SyncItem></items>' where record_id="240689";

 

---------

BUG: Null pointer exception when importing a record containing an “ExtendedDrugOrder” object. (...from Order Extension Module).

DIAGNOSIS: Error message in logs on the server similar to the following:

ERROR - SyncUtilTransmission.processSyncTransmission(499) |2013-10-23 09:35:55,690| Sync error while ingesting records for server: Rwinkwavu
org.openmrs.module.sync.ingest.SyncIngestException: Unable to process sync record, processing terminated unexpectedly.
at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncRecord(SyncIngestServiceImpl.java:310)
at sun.reflect.GeneratedMethodAccessor565.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)

...

at org.openmrs.api.context.Daemon$2.run(Daemon.java:116)
Caused by: java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at org.openmrs.module.sync.api.impl.SyncIngestServiceImpl.processSyncRecord(SyncIngestServiceImpl.java:210)
... 42 more

CAUSE: For some reason, when the sync record was created, the "containedType" was not indicated in the sync record payload.

An example record looks like this:

<items><SyncItem key="e171e54d-c5fa-4dba-81c5-8e41bbcf4502" state="NEW"><content><![CDATA[<org.openmrs.module.orderextension.ExtendedDrugOrder><startDate type="timestamp">2013-09-24T00:00:00.000+0200</startDate><concept type="org.openmrs.Concept">3cd906e8-26fe-102b-80cb-0017a47871b2</concept><complex type="boolean">false</complex><orderType type="org.openmrs.OrderType">bcf7fb8e-2700-102b-80cb-0017a47871b2</orderType><frequency type="string">1/day</frequency><dose type="double">2.0</dose><creator type="org.openmrs.User">07cc02ad-119d-4f1d-bd4f-6eee80f99eea</creator><patient type="org.openmrs.Patient">eeea8f66-db60-4709-ab64-14c5fc954f01</patient><voided type="boolean">false</voided><dateCreated type="timestamp">2013-10-22T10:47:50.593+0200</dateCreated><prn type="boolean">true</prn><uuid type="string">e171e54d-c5fa-4dba-81c5-8e41bbcf4502</uuid><discontinued type="boolean">false</discontinued><drug type="org.openmrs.Drug">0baed678-15f5-102d-96e4-000c29c2a5d7</drug></org.openmrs.module.orderextension.ExtendedDrugOrder>]]></content></SyncItem></items>

SOLUTION: Add the missing "containedType" to the sync record payload and the record should now look like this:

<items><SyncItem containedType="org.openmrs.module.orderextension.ExtendedDrugOrder" key="e171e54d-c5fa-4dba-81c5-8e41bbcf4502" state="NEW"><content><![CDATA[<org.openmrs.module.orderextension.ExtendedDrugOrder><startDate type="timestamp">2013-09-24T00:00:00.000+0200</startDate><concept type="org.openmrs.Concept">3cd906e8-26fe-102b-80cb-0017a47871b2</concept><complex type="boolean">false</complex><orderType type="org.openmrs.OrderType">bcf7fb8e-2700-102b-80cb-0017a47871b2</orderType><frequency type="string">1/day</frequency><dose type="double">2.0</dose><creator type="org.openmrs.User">07cc02ad-119d-4f1d-bd4f-6eee80f99eea</creator><patient type="org.openmrs.Patient">eeea8f66-db60-4709-ab64-14c5fc954f01</patient><voided type="boolean">false</voided><dateCreated type="timestamp">2013-10-22T10:47:50.593+0200</dateCreated><prn type="boolean">true</prn><uuid type="string">e171e54d-c5fa-4dba-81c5-8e41bbcf4502</uuid><discontinued type="boolean">false</discontinued><drug type="org.openmrs.Drug">0baed678-15f5-102d-96e4-000c29c2a5d7</drug></org.openmrs.module.orderextension.ExtendedDrugOrder>]]></content></SyncItem></items>

Update then the payload of the record with sql command:

update sync_record set payload ='<items><SyncItem containedType="org.openmrs.module.orderextension.ExtendedDrugOrder" key="e171e54d-c5fa-4dba-81c5-8e41bbcf4502" state="NEW"><content><![CDATA[<org.openmrs.module.orderextension.ExtendedDrugOrder><startDate type="timestamp">2013-09-24T00:00:00.000+0200</startDate><concept type="org.openmrs.Concept">3cd906e8-26fe-102b-80cb-0017a47871b2</concept><complex type="boolean">false</complex><orderType type="org.openmrs.OrderType">bcf7fb8e-2700-102b-80cb-0017a47871b2</orderType><frequency type="string">1/day</frequency><dose type="double">2.0</dose><creator type="org.openmrs.User">07cc02ad-119d-4f1d-bd4f-6eee80f99eea</creator><patient type="org.openmrs.Patient">eeea8f66-db60-4709-ab64-14c5fc954f01</patient><voided type="boolean">false</voided><dateCreated type="timestamp">2013-10-22T10:47:50.593+0200</dateCreated><prn type="boolean">true</prn><uuid type="string">e171e54d-c5fa-4dba-81c5-8e41bbcf4502</uuid><discontinued type="boolean">false</discontinued><drug type="org.openmrs.Drug">0baed678-15f5-102d-96e4-000c29c2a5d7</drug></org.openmrs.module.orderextension.ExtendedDrugOrder>]]></content></SyncItem></items>' where record_id="333191";

 

-------

 

BUGA sync record fails to import because the xml of the record got corrupted during the creation of the record

DIAGNOSIS: Error message in logs on the server similar to the following:


ERROR - SyncUtilTransmission.processSyncTransmission(499) |2014-05-06 06:41:33,605| Sync error while ingesting records for server: Kirehe
org.openmrs.module.sync.ingest.SyncIngestException: Transmission data was corrupted. Unable to process item.
at org.openmrs.module.sync.api.db.hibernate.HibernateSyncDAO.processCollection(HibernateSyncDAO.java:1195)

...

CAUSE: Unknown

An example record looks like this: (...check line #29 where the owner tag is '<owner type="recreate"></owner>')

<items>
<SyncItem containedType="org.openmrs.Patient" key="7192b045-0a47-4fbe-a7dd-2ac23a78df7b" state="NEW">
<content>
<![CDATA53:50.072+0200</personDateCreated><birthdateEstimated type="boolean">true</birthdateEstimated><voided type="boolean">false</voided><birthdate type="timestamp">1948-01-01T00:00:00.000+0200</birthdate><dateCreated type="timestamp">2014-03-26T11:53:50.097+0200</dateCreated><gender type="string">F</gender><personVoided type="boolean">false</personVoided><uuid type="string">7192b045-0a47-4fbe-a7dd-2ac23a78df7b</uuid><dead type="boolean">false</dead><creator type="org.openmrs.User">f3fd6fab-3f4e-4beb-bb05-d729c05f6bd5</creator></org.openmrs.Patient>]>
</content>
</SyncItem>
<SyncItem containedType="org.openmrs.PersonAddress" key="cafda0f4-53ce-4ac6-a9ad-5dc742add329" state="NEW">
<content>
<![CDATA53:50.135+0200</dateCreated><stateProvince type="string">Eastern/Uburasirazuba</stateProvince><cityVillage type="string">Mpanga</cityVillage><address1 type="string">Rushonga</address1><address3 type="string">Rubaya</address3><uuid type="string">cafda0f4-53ce-4ac6-a9ad-5dc742add329</uuid><preferred type="boolean">true</preferred><creator type="org.openmrs.User">f3fd6fab-3f4e-4beb-bb05-d729c05f6bd5</creator><country type="string">Rwanda</country></org.openmrs.PersonAddress>]>
</content>
</SyncItem>
<SyncItem containedType="org.openmrs.PersonName" key="9fd417f1-600f-4472-86f1-d20431ac4988" state="NEW">
<content>
<![CDATA53:50.166+0200</dateCreated><givenName type="string">Collette</givenName><uuid type="string">9fd417f1-600f-4472-86f1-d20431ac4988</uuid><preferred type="boolean">true</preferred><creator type="org.openmrs.User">f3fd6fab-3f4e-4beb-bb05-d729c05f6bd5</creator></org.openmrs.PersonName>]>
</content>
</SyncItem>
<SyncItem containedType="org.openmrs.PersonAttribute" key="fd75f4da-2694-4b86-b4a3-643e0be91d16" state="NEW">
<content>
<![CDATA53:50.200+0200</dateCreated><attributeType type="org.openmrs.PersonAttributeType">8d87236c-c2cc-11de-8d13-0010c6dffd0f</attributeType><uuid type="string">fd75f4da-2694-4b86-b4a3-643e0be91d16</uuid><creator type="org.openmrs.User">f3fd6fab-3f4e-4beb-bb05-d729c05f6bd5</creator></org.openmrs.PersonAttribute>]>
</content>
</SyncItem>
<SyncItem containedType="org.openmrs.PatientIdentifier" key="d33e7fc7-3513-44d0-80b6-58ae513c29ba" state="NEW">
<content>
<![CDATA53:50.226+0200</dateCreated><uuid type="string">d33e7fc7-3513-44d0-80b6-58ae513c29ba</uuid><preferred type="boolean">true</preferred><identifierType type="org.openmrs.PatientIdentifierType">4e458867-9a68-4e55-9fe0-fb49fac4e6b0</identifierType><identifier type="string">4230341U-8</identifier><creator type="org.openmrs.User">f3fd6fab-3f4e-4beb-bb05-d729c05f6bd5</creator></org.openmrs.PatientIdentifier>]>
</content>
</SyncItem>
<SyncItem containedType="org.hibernate.collection.PersistentSortedSet" key="7192b045-0a47-4fbe-a7dd-2ac23a78df7b|addresses" state="UPDATED">
<content>
<![CDATA<org.hibernate.collection.PersistentSortedSet><owner type="recreate"></owner><entry type="update"></entry></org.hibernate.collection.PersistentSortedSet>]>
</content>
</SyncItem>
<SyncItem containedType="org.hibernate.collection.PersistentSortedSet" key="7192b045-0a47-4fbe-a7dd-2ac23a78df7b|names" state="UPDATED">
<content>
<![CDATA<org.hibernate.collection.PersistentSortedSet><owner action="recreate" properyName="names" type="org.openmrs.Patient" uuid="7192b045-0a47-4fbe-a7dd-2ac23a78df7b"/><entry action="update" type="org.openmrs.PersonName" uuid="9fd417f1-600f-4472-86f1-d20431ac4988"/></org.hibernate.collection.PersistentSortedSet>]>
</content>
</SyncItem>
<SyncItem containedType="org.hibernate.collection.PersistentSortedSet" key="7192b045-0a47-4fbe-a7dd-2ac23a78df7b|attributes" state="UPDATED">
<content>
<![CDATA<org.hibernate.collection.PersistentSortedSet><owner action="recreate" properyName="attributes" type="org.openmrs.Patient" uuid="7192b045-0a47-4fbe-a7dd-2ac23a78df7b"/><entry action="update" type="org.openmrs.PersonAttribute" uuid="fd75f4da-2694-4b86-b4a3-643e0be91d16"/></org.hibernate.collection.PersistentSortedSet>]>
</content>
</SyncItem>
<SyncItem containedType="org.hibernate.collection.PersistentSet" key="7192b045-0a47-4fbe-a7dd-2ac23a78df7b|identifiers" state="UPDATED">
<content>
<![CDATA<org.hibernate.collection.PersistentSet><owner action="recreate" properyName="identifiers" type="org.openmrs.Patient" uuid="7192b045-0a47-4fbe-a7dd-2ac23a78df7b"/><entry action="update" type="org.openmrs.PatientIdentifier" uuid="d33e7fc7-3513-44d0-80b6-58ae513c29ba"/></org.hibernate.collection.PersistentSet>]>
</content>
</SyncItem>
</items>

 

SOLUTION: Fix the xml by adding the missing attributes and run an sql update to use this new payload.





  • No labels