Bahmni not syncing with OpenELIS again

I recently added new lab tests into the system (there are about 2000 lab test and all belong to one Sample concept). When I tried to place order for patients, the orders are showing just fine in OpenERP, however its not shown in OpenELIS

What I have tried

  1. bahmni -i local stop

  2. execute below statements on all databases (openmrs,openerp,clinlims)

delete from failed_events; delete from event_records; delete from markers; delete from event_records_offset_marker; delete from event_records_queue;

  1. bahmni -i local start

below is the error from the log (after performing the above)

2017-08-07 02:09:15,076 ERROR [ELIS][AtomFeedClient] Error occurred while processing feed entry:En
y.mediaEntry=false
Entry.summary=null
Entry.created=null
Entry.foreignMarkup=[]
Entry.published=Mon Aug 07 02:09:10 WIB 2017
Entry.source=null
Entry.title=Encounter
Entry.modules=[]
Entry.contents[0].mode=null
Entry.contents[0].src=null
Entry.contents[0].type=application/vnd.atomfeed+xml
Entry.contents[0].value=<![CDATA[/openmrs/ws/rest/v1/bahmnicore/bahmniencounter/0ae21013-8840-4bbf
d01-88fca0e3b198?includeAll=true]]>
Entry.xmlBase=null
Entry.rights=null
Entry.modified=Mon Aug 07 02:09:10 WIB 2017
Entry.alternateLinks=[]
Entry.otherLinks=[]
Entry.contributors=[]
Entry.categories[0].schemeResolved=null
Entry.categories[0].scheme=null
Entry.categories[0].term=Encounter
Entry.categories[0].label=null
Entry.id=tag:atomfeed.ict4h.org:1f596545-fbbd-47cc-af12-c21865602c39
Entry.issued=Mon Aug 07 02:09:10 WIB 2017
Entry.updated=Mon Aug 07 02:09:10 WIB 2017
Entry.titleEx.mode=null
Entry.titleEx.src=null
Entry.titleEx.type=null
Entry.titleEx.value=Encounter
Entry.authors=[]

java.lang.RuntimeException: java.lang.NullPointerException
        at org.bahmni.feed.openelis.feed.transaction.support.AtomFeedHibernateTransactionManager.e
cuteWithTransaction(AtomFeedHibernateTransactionManager.java:51)
        at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:68)
        at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReade
ob.java:73)
        at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.j
a:57)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560)
Caused by: java.lang.NullPointerException
        at org.bahmni.feed.openelis.feed.event.EncounterFeedWorker$SampleItemTestCache.findOrCreat
ampleItemFromCache(EncounterFeedWorker.java:562)
        at org.bahmni.feed.openelis.feed.event.EncounterFeedWorker$SampleItemTestCache.add(Encount
FeedWorker.java:543)
        at org.bahmni.feed.openelis.feed.event.EncounterFeedWorker.getSampleTestCollections(Encoun
rFeedWorker.java:393)
        at org.bahmni.feed.openelis.feed.event.EncounterFeedWorker.createSample(EncounterFeedWorke
java:238)
        at org.bahmni.feed.openelis.feed.event.EncounterFeedWorker.process(EncounterFeedWorker.jav
181)
        at org.bahmni.feed.openelis.feed.event.EncounterFeedWorker.process(EncounterFeedWorker.jav
163)
        at org.ict4h.atomfeed.client.service.AtomFeedClient$EventProcessor.doInTransaction(AtomFee
lient.java:168)
        at org.ict4h.atomfeed.transaction.AFTransactionWorkWithoutResult.execute(AFTransactionWork
thoutResult.java:6)
        at org.bahmni.feed.openelis.feed.transaction.support.AtomFeedHibernateTransactionManager.e
cuteWithTransaction(AtomFeedHibernateTransactionManager.java:42)
        ... 5 more
2017-08-07 02:09:30,080 ERROR [ELIS][AtomFeedClient] Failed to process failed event. FailedEvent{f
ledAt=1502046555076, event=Event{id='tag:atomfeed.ict4h.org:1f596545-fbbd-47cc-af12-c21865602c39',
ontent='/openmrs/ws/rest/v1/bahmnicore/bahmniencounter/0ae21013-8840-4bbf-ad01-88fca0e3b198?includ
ll=true'}, errorMessage='Failed processing event in feed [http://localhost:8050/openmrs/ws/atomfee
encounter/1]

What else could possibly wrong here?

Got it working by resetting the markers on both side.