OpenMRS data not syncing with Odoo

Hello

I have successfully installed emr, odoo and openelis. However, bahmni data is not been synced to odoo (patients, drugs). All services are running as expected.

There is no log file under /var/logs/bahmni-erp-connect. Only placeholder file. I even tried creating the log file manually but nothing gets written to the file.

The markers table has these records

There are 1344 records in the failed_events table. I tried resetting the retries for all events to 1 but that did not have any effect on the problem.

image

One of the error messages in the failed_events table is shown below

Failed processing event in feed [http://localhost:8050/openmrs/ws/atomfeed/drug/1]
                    +
 java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integerjava.lang.RuntimeException: java.lang.ClassCastException: java.lang.String cannot be cast
to java.lang.Integer+
         at org.bahmni.feed.openerp.worker.OpenERPDrugServiceEventWorker.process(OpenERPDrugServiceEventWorker.java:42)
                    +
         at org.ict4h.atomfeed.client.service.AtomFeedClient$EventProcessor.doInTransaction(AtomFeedClient.java:169)
                    +
         at org.ict4h.atomfeed.transaction.AFTransactionWorkWithoutResult.execute(AFTransactionWorkWithoutResult.java:6)
                    +
         at org.ict4h.atomfeed.server.transaction.AtomFeedSpringTransactionSupport$1.doInTransaction(AtomFeedSpringTransactionSupport.java:39)
                    +
         at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
                    +
         at org.ict4h.atomfeed.server.transaction.AtomFeedSpringTransactionSupport.executeWithTransaction(AtomFeedSpringTransactionSupport.java:36)
                    +
         at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:69)
                    +
         at org.bahmni.feed.openerp.job.SimpleFeedJob.processFeed(SimpleFeedJob.java:26)
                    +
         at org.bahmni.feed.openerp.job.OpenERPDrugFeedJob.processFeed(OpenERPDrugFeedJob.java:17)
                    +
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    +
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    +
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    +
         at java.lang.reflect.Method.invoke(Unknown Source)
                    +
         at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:265)
                    +
         at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:257)
                    +
         at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
                    +
         at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
                    +
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
                    +
 Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
                    +
         at org.apache.xmlrpc.parser.XmlRpcResponseParser.addResult(XmlRpcResponseParser.java:61)
                    +
         at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.endValueTag(RecursiveTypeParserImpl.java:78)
                    +
         at org.apache.xmlrpc.parser.XmlRpcResponseParser.endElement(XmlRpcResponseParser.java:186)
                    +
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
                    +
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
                    +
         at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
                    +
         at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
                    +
         at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
                    +
         at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
                    +
         at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
                    +
         at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
                    +
         at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
                    +
         at org.apache.xmlrpc.client

The atomfeed console log can be accessed here

Hi @tapologo

Can you give more info on how you setup bahmni? Which bahmni are you using bahmni-lite or bahmni-standard?

Also refer this doc for odoo configuration if you are using docker setup ( Link )

Hello @soorya

I installed the RPM version of bahmni 0.93 on a Centos server because I need to upgrade our prod to 0.93 urgently. I am not using docker for this upgrade, but eventually I will.

I am also seeing this in the atomfeed console log

java.sql.SQLException: Access denied for user 'atomfeed-console'@'localhost' (using password: YES)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) ~[mysql-connector-java-5.1.8.jar!/:na]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) ~[mysql-connector-java-5.1.8.jar!/:na]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536) ~[mysql-connector-java-5.1.8.jar!/:na]

I have checked the password and it’s correct. I can log in successfully with mysql -u atomfeed-console -p

Please check which event type is failing. Can you send the failed_event URI ?

These are some of the feed URIs in the failed events table

  646 | http://localhost:8050/openmrs/ws/atomfeed/lab/recent       |       1
 1326 | http://localhost:8050/openmrs/ws/atomfeed/drug/recent      |       1
 1328 | http://localhost:8050/openmrs/ws/atomfeed/drug/recent      |       1
 1329 | http://localhost:8050/openmrs/ws/atomfeed/drug/recent      |       1
 1331 | http://localhost:8050/openmrs/ws/atomfeed/encounter/recent |       1
 1332 | http://localhost:8050/openmrs/ws/atomfeed/patient/recent   |       1
 1330 | http://localhost:8050/openmrs/ws/atomfeed/patient/recent   |       1
 1333 | http://localhost:8050/openmrs/ws/atomfeed/encounter/recent |       1

Have you restored some database backup? Or is it just Bahmni 0.93 installation ?

It’s a new installation of 0.93 with no database restoration.

@mohant any ideas on this? I still haven’t been able t resolve the issue. Nothing is being synced to Odoo