[SOLVED] OpenERP fails to sync data from OpenMRS in Bahmni

Hi all,

I am running Bahmni on a stand-alone CentOS box.Updates take place between OpenMRS and OpenElis but OpenERP is not getting updated.

Service openmrs is running with pid: 2633 and Service bahmni-erp-connect is running with pid: 2226. All I see for openERP is " openerp-server is running… " there is no pid assigned to it.

From the openerp database, customerFeedJobTrigger ‘enabled value = true’ and saleOrderFeedJobTrigger ‘enabled value = true’ .

The “markers” table of OpenERP is totally blank. It has no data at all.

When I do ‘select from markers’ this is what I get:

id | create_uid | create_date | write_date | write_uid | last_read_entry_id | f eed_uri_for_last_read_entry | feed_uri ----±-----------±------------±-----------±----------±-------------------±- ----------------------------±--------- (0 rows)

This is what i see on my machine when I run “ps -ef | grep erp” command:

openerp 7780 1 0 05:38 ? 00:00:26 /usr/bin/python /usr/bin/openerp-server -c /etc/openerp/openerp-server.conf --update all --database openerp --without-demo all --pidfile=/var/run/openerp/openerp-server.pid --logfile=/var/log/openerp/openerp-server.log postgres 7810 2687 0 05:38 ? 00:00:23 postgres: openerp openerp [local] idle
postgres 8047 2687 0 05:40 ? 00:00:00 postgres: openerp openerp [local] idle
postgres 8270 2687 0 05:42 ? 00:00:00 postgres: openerp openerp 127.0.0.1(39617) idle
postgres 8271 2687 0 05:42 ? 00:00:00 postgres: openerp openerp 127.0.0.1(39618) idle
postgres 10417 2687 0 06:04 ? 00:00:00 postgres: openerp openerp [local] idle
bahmni 11458 1 0 06:13 ? 00:00:12 java -jar -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m /opt/bahmni-erp-connect/lib/bahmni-erp-connect.jar

Pls can I get some help on how to resolve it?

Thanks in advance.

Hello @ekowkoomson1, can you also please attach the pastebin link of your OpenERP logs. Logs are located here on the machine:

/var/log/openerp/openerp-server.log

Thanks Gluthra for your reply.

Below is a link to my cat /var/log/openerp/openerp-server.log

Can you please run following query in openerp database -

select * from quartz_cron_scheduler;

See if jobs are enabled.

Thanks,

Hi Vinkesh,

The results from select * from quartz_cron_scheduler;

id | name | cron_statement | start_delay | ena bled ----±--------------------------------------±---------------±------------±—

1 | customerFeedJobTrigger | 0/15 * * * * ? | 60000 | t 2 | customerFeedfailedJobTrigger | 0 0/1 * * * ? | 60000 | t 3 | eventRecordsNumberOffsetMarkerTrigger | 0 0 0/1 * * ? | 60000 | t 4 | referenceDataFeedJobTrigger | 0 0/5 * * * ? | 60000 | t 8 | openelisSaleOrderFeedJobTrigger | 0 0/1 * * * ? | 60000 | f 9 | openelisSaleOrderFeedFailedJobTrigger | 0 0/5 * * * ? | 60000 | f 5 | referenceDataFeedFailedJobTrigger | 0/20 * * * * ? | 60000 | t 6 | saleOrderFeedJobTrigger | 0 0/1 * * * ? | 60000 | t 7 | saleOrderFeedFailedJobTrigger | 0 0/5 * * * ? | 60000 | t (9 rows)

serverlog.txt (554.2 KB)

bahmni-erp-connect.txt (45.9 KB)

Hi Ekow:

I could see the initialization error while starting openerp-atomfeed-service. Can you restart the erp connect service? You can do it by using “sudo service bahmni-erp-connect restart”

Hi Shanmugam,

Thanks.

I have done that but the markers table is still empty. I have removed & re-installed both bahmni-erp-connect and bahmni-erp (openerp server) but the situation is still the same.

What puzzles me a bit though is when I do service -status-all, I see two (2) instances of openerp-server running concurrently, and both have no pid assigned to them.

Could that be a pointer to where the challenge is coming from?

Hi:

The bahmni-erp-connect log shows that

==================================================== 2016-02-05 13:31:30,536 WARN [openerp-atomfeed-service] [org.springframework.web.context.support.XmlWebApplicationContext] Exception thrown from ApplicationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call ‘refresh’ before multicasting events via the context: Root WebApplicationContext: startup

After analyse the log, It is spring framework throwing the exception. This is because of java 1.8 version. Once we changed to java version 1.7 and restarted the machine, it works fine.

Confirmed.

Interestingly, all old transactions updated straight up without any hitches whatsoever.

Thanks again Shan!

Hello,

Can you please mention the exact step you took to “change” the Java version? Did you uninstall Java 8, or changed the PATH variable? And where?

Regards Gurpreet

Hello:

There were multiple java version installed in that machine. The following command will help to choose the required Java version.

sudo update-alternatives --config java

The command will list all the installed java versions in that machine and ask for choose the alternate version. After the version has been selected, we can verify the java version again (using java -version) to make sure that it is indeed selected properly.

Regards, Shanmugam.

Thanks @shanmugam. This helps.

Although I feel this is a workaround. In future, Bahmni should use the JAVA it needs, and not change the default system Java, because this can break other applications. Or, if some other application changed the system default JAVA, it will break Bahmni.

@bharatak suggested that a better approach will be that the “bahmni” user on the machine, should set its own JAVA_HOME, and maybe PATH variable, so that Bahmni service uses the right JAVA, and other components on the machine remain unaffected. We may need to put this in Mingle so that someone picks this up in future.

I see some work on this seems to have been committed recently by @bharatak. Yay!