Lab test order is failed, need help

I have done following sequence of operation

  1. Registered Patient
  2. Admitted as OPD
  3. Visited Clinical Module
  4. Clicked consultation
  5. Ordered lab sample
  6. Visited Lab module

But not able to see any order for sample. I am able to find following error message.

Logs

{ “categories”: [ { “scheme”: null, “label”: null, “schemeResolved”: null, “term”: “lab” } ], “id”: “tag:atomfeed.ict4h.org:a6be29ad-5a68-4404-9f20-e9ec43452cd4”, “content”: “/openmrs/ws/rest/v1/reference-data/panel/12f404d7-7615-412d-abb8-9273608c12e5”, “feedUri”: null, “updatedDate”: null, “title”: “panel”, “dateCreated”: null }

Error Message:

Failed processing event in feed [http://localhost:8050/openmrs/ws/atomfeed/lab/69] org.bahmni.webclients.WebClientsException: Bad response code of 500java.lang.RuntimeException: org.bahmni.webclients.WebClientsException: Bad response code of 500 at org.bahmni.feed.openelis.feed.transaction.support.AtomFeedHibernateTransactionManager.executeWithTransaction(AtomFeedHibernateTransactionManager.java:51) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:68) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.bahmni.webclients.WebClientsException: Bad response code of 500 at org.bahmni.webclients.HttpClient.checkSanityOfResponse(HttpClient.java:76) at org.bahmni.webclients.HttpClient.get(HttpClient.java:57) at org.bahmni.webclients.HttpClient.get(HttpClient.java:69) at org.bahmni.feed.openelis.feed.event.LabFeedEventWorker.process(LabFeedEventWorker.java:66) at org.ict4h.atomfeed.client.service.AtomFeedClient$EventProcessor.doInTransaction(AtomFeedClient.java:168) at org.ict4h.atomfeed.transaction.AFTransactionWorkWithoutResult.execute(AFTransactionWorkWithoutResult.java:6) at org.bahmni.feed.openelis.feed.transaction.support.AtomFeedHibernateTransactionManager.executeWithTransaction(AtomFeedHibernateTransactionManager.java:42) … 5 more

Feed URI http://localhost:8050/openmrs/ws/atomfeed/lab/recent

@vijayakls Which version of Bahmni are you running?

There might be some errors authenticating with OpenMRS. Can you open /var/log/bahmni-lab/bahmni-lab.log and confirm if you are seeing error messages like this.

I am using 0.88

log is as follow.

2017-03-18 14:25:00,307 ERROR [ELIS][OpenMRSEncounterFeedReaderJob] org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:83) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.FeedEnumerator.setInitialEntries(FeedEnumerator.java:61) at org.ict4h.atomfeed.client.service.FeedEnumerator.initializeEnumeration(FeedEnumerator.java:39) at org.ict4h.atomfeed.client.service.FeedEnumerator.(FeedEnumerator.java:27) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:57) … 4 more

@vijayakls this looks like a different error! …this one says Last Read entry not found in feed… and the first one said Bad response code of 500…

Can you paste the full content of the log file here?

All logs same as above and it just repeats. Not able to attach the logs.

2017-03-18 14:24:45,217 ERROR [ELIS][OpenMRSEncounterFeedReaderJob] org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:83) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.FeedEnumerator.setInitialEntries(FeedEnumerator.java:61) at org.ict4h.atomfeed.client.service.FeedEnumerator.initializeEnumeration(FeedEnumerator.java:39) at org.ict4h.atomfeed.client.service.FeedEnumerator.(FeedEnumerator.java:27) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:57) … 4 more 2017-03-18 14:25:00,307 ERROR [ELIS][OpenMRSEncounterFeedReaderJob] org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:83) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.FeedEnumerator.setInitialEntries(FeedEnumerator.java:61) at org.ict4h.atomfeed.client.service.FeedEnumerator.initializeEnumeration(FeedEnumerator.java:39) at org.ict4h.atomfeed.client.service.FeedEnumerator.(FeedEnumerator.java:27) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:57) … 4 more 2017-03-18 14:25:00,328 ERROR [ELIS][OpenMRSPatientFeedReaderJob] org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:83) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.FeedEnumerator.setInitialEntries(FeedEnumerator.java:61) at org.ict4h.atomfeed.client.service.FeedEnumerator.initializeEnumeration(FeedEnumerator.java:39) at org.ict4h.atomfeed.client.service.FeedEnumerator.(FeedEnumerator.java:27) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:57) … 4 more 2017-03-18 14:25:15,217 ERROR [ELIS][OpenMRSEncounterFeedReaderJob] org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:83) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.FeedEnumerator.setInitialEntries(FeedEnumerator.java:61) at org.ict4h.atomfeed.client.service.FeedEnumerator.initializeEnumeration(FeedEnumerator.java:39) at org.ict4h.atomfeed.client.service.FeedEnumerator.(FeedEnumerator.java:27) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:57) … 4 more 2017-03-18 14:25:15,217 ERROR [ELIS][OpenMRSPatientFeedReaderJob] org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:83) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.FeedEnumerator.setInitialEntries(FeedEnumerator.java:61) at org.ict4h.atomfeed.client.service.FeedEnumerator.initializeEnumeration(FeedEnumerator.java:39) at org.ict4h.atomfeed.client.service.FeedEnumerator.(FeedEnumerator.java:27) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:57) … 4 more

I am running 0.88 and having the same problem. This is the second time it happened, so looks like there is some serious issue with atom feed. The log is similar to the problem reported above:

2017-03-20 23:51:00,199 ERROR [ELIS][OpenMRSPatientFeedReaderJob] org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:83) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: org.ict4h.atomfeed.client.exceptions.AtomFeedClientException: Last Read entry not found in feed. at org.ict4h.atomfeed.client.service.FeedEnumerator.setInitialEntries(FeedEnumerator.java:61) at org.ict4h.atomfeed.client.service.FeedEnumerator.initializeEnumeration(FeedEnumerator.java:39) at org.ict4h.atomfeed.client.service.FeedEnumerator.(FeedEnumerator.java:27) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:57) … 4 more

Is there some kind of workaround, like lab admin forcing a pull from openmrs?

Probably not a good solution if you are dealing with a production server, but you can try clearing markers in OpenELIS DB. (…login to postgresql using psql -Uclinlims and run delete from markers;.)

But as you suggest, a better solution would be to dig deeper and find what is causing the issue in the first place. The error suggests that there is value from the markers table that is being used to read event entries in the OpenMRS DB and that value is pointing to an non-existent entry. …maybe start by checking the markers in the OpenELIS DB ( select last_read_entry_id from markers;) and see if they all point to existing event records on the OpenMRS side. (…something like: select * from event_records where uuid like "%fa12a3bd-a1f6-4999-9495-d908e16ec9bf%";). -The uuid parts in the last_read_entry_id column of the markers table on the OpenELIS side should be found in the uuid column of the event_records table on the OpenMRS side.

I guess this is an issue with the data dump provided by default with the Bahmni Installation. If you are using clean and fresh database then this wouldn’t have happened. We will confirm and fix our data dump soon. @gsluthra @binduak

I have requested @binduak to investigate and check if demo data has some problems because of which the atom feed sync misbehaves.

Hello am facing the same issue… is it solved?