Troubleshooting Installation Issues

R

This page attempts to document common installation related issues encountered by Bahmni community users, and how to troubleshoot / debug issues.

OpenERP Sync Issue

If there is an issue with syncing data from OpenMRS to OpenERP. 

Step 1: Check service status

After installation, If you see openmrs to openerp sync not working. Firstly, you need to check if bahmni-erp-connect is running. 

sudo service bahmni-erp-connect status // Check the status
sudo service bahmni-erp-connect start // To start the service , if it is not running

Step 2: Check markers table

If you still see the sync issue, try to check the markers table in openerp if there is an entry for reading the corresponding feed from openmrs.

Example: This entry in openerp database is for reading patient feed from openmrs to openerp
 Entry in Markers table for patient feed from openmrs to openerp

Make sure the markers are in sync

Step 3: Check failed_events table

Check the failed_events table for any entries recorded. 

Please refer Atom Feed Based Synchronization in Bahmni for more details about atom feed sync.


Services stopped after system reboot

Make sure you have at least 8GB RAM to have all the services start automatically during system reboot


If you see that some services are always stopped after system reboot, then you can choose to automatically start the services at the time of system start. Please use the below command to enable the service start.

Command to start the service at system reboot
chkconfig {service_name} on

Example:

Using the above command, lets say you would like to start openerp service, use the following command.

Example command to start openerp service
chkconfig openerp on //openerp is the service name 

Services in Bahmni

Similarly, one can choose to start any service. Refer Install Bahmni on CentOS#BahmniServices to see the available services in Bahmni

Installation failing at "Download postgres yum repo rpm if not present"

Since the older rpm is deprecated, the below fix has to be manually applied to get the installation running. 

Override postgres_repo_rpm_name
vi /etc/bahmni-installer/setup.yml
postgres_repo_rpm_name: pgdg-centos92-9.2-7.noarch.rpm (add this line)


bahmni -i {inventory_file_name} install (rerun the install command)

This issue is fixed in 0.85v. All the versions before 0.85 should follow the above steps.


Openmrs startup issue after installation

If you have issue with openmrs not starting up even though the installation went well, then look at openmrs logs located at /var/log/openmrs/openmrs/log. If the issue is something below, then follow the instructions mentioned below.

 failed to run command /usr/java/jre1.7.0_79/bin/java': No such file or directory
Steps to solve the issue
yum remove jre
yum install /opt/jre-7u79-linux-x64.rpm
sudo service openmrs restart

Problem accessing OpenERP from Landing Page

If you have any issues accessing OpenERP through the landing page or if you find the url incorrectly configured on the landing page, Please refer and find the solution from here 


Bahmni Installation Failure at  task "Remove crontab jobs for upload directories"

If bahmni installation fails with the below  error message, then follow the below mentioned steps to fix it.

Error Message during installation

"An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'strip'"

This is an issue with ansible core modules. Waiting for the fix to be merged https://github.com/ansible/ansible-modules-core/pull/5151


Steps to fix the issue 

Run all the steps as root user

sudo su
Goto the modules directory
cd /usr/lib/python2.6/site-packages/ansible/modules/core/system


Download and replace the existing cron.py 
wget https://goo.gl/tzybHu -O /usr/lib/python2.6/site-packages/ansible/modules/core/system/cron.py
Compile the file locally
python
import py_compile
py_compile.compile('cron.py')
exit()
Rerun the installation command for installing Bahmni
bahmni -i {inventory_file} install 

Example

 bahmni -i local install // local is the inventory file

Installation failing at task "Start httpd"

If the installation fails at the task "Start httpd" with the message "Could not open configuration file.." as shown in the screenshot below, then follow the below steps to fix the issue.

Solution

Remove httpd
yum remove httpd
Rerun the installation command for installing Bahmni
bahmni -i {inventory_file} install 

Example

 bahmni -i local install // local is the inventory file

Bahmni 0.92 Release - Installation Issues :

Problem 1: Bahmni installation fails because of non-availability of ansible-2.4.2.0 - This happens with the 

While trying to install bahmni-installer.noarch 0:0.92-142 and the following issue is encountered.
"No package ansible-2.4.2.0 available."
[Errno 14] HTTP Error 404 - Not Found

Analysis: The rpm is no longer available in the specified ulr’s

Solution Proposed:

Kindly use the RPM found in the link mentioned below.
https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.4.6.0-1.el7.ans.noarch.rpm

Steps

Please execute this step before bahmni installation

yum install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.4.6.0-1.el7.ans.noarch.rpm 


Problem 2: Installing Bahmni 0.92 on my new CentOS 7 server. It fails on the TASK [postgres : Download postgres yum repo rpm if not present]

Proposed Workaround: - modify the local file in the path mentioned below, and change the postgres rpm to the working version.

Step1 - cd /opt/bahmni-installer/bahmni-playbooks/group_vars 

Step 2 - vi local

Step 3 - Update the available and working rpm against the configs.

  1. postgres_repo_rpm_name: pgdg-redhat-repo-latest.noarch.rpm
  2. postgres_repo_download_url: https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/{{postgres_repo_rpm_name}}

Re-install bahmni

Logging issues in 0.93 Release:

Issue1:
 

In Bahmni 0.93 environment logging is not working for Bahmni-erp-connect service.When the service is run there is no log file generated (in /opt/bahmni-erp-connect/log)

To address a this logging issue in the openerp-atomfeed-service reported in the below
Talk Thread(https://talk.openmrs.org/t/logging-not-working-in-bahmni-erp-connect-0-93/42872) on Bahmni 0.93 instance, we need to update the log4j2.xml file and remove the Log4jConfigListener configuration from the web.xml file 

1)Update log4j2.xml:
   First, update the log4j2.xml file in the below path
   /opt/bahmni-erp-connect/bahmni-erp-connect/WEB-INF/classes/log4j2.xml

with the following configuration:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration xmlns="http://logging.apache.org/log4j/2.0/config">
    <Appenders>
        <RollingFile name="fileAppender"
                     fileName="/var/log/bahmni-erp-connect/bahmni-erp-connect.log"
                     filePattern="/var/log/bahmni-erp-connect/bahmni-erp-connect-%i.log.gz">
            <PatternLayout pattern="%d %-5p [openerp-atomfeed-service] [%c] %m%n"/>
            <Policies>
                <SizeBasedTriggeringPolicy size="10MB"/>
            </Policies>
            <DefaultRolloverStrategy max="10"/>
        </RollingFile>
    </Appenders>

    <Loggers>
        <Logger name="org.springframework" level="WARN"/>
        <Root level="WARN">
            <AppenderRef ref="fileAppender"/>
        </Root>
    </Loggers>
</Configuration>

2) Remove Log4jConfigListener:
      Remove the Log4jConfigListener from web.xml  file located at /opt/bahmni-erp-connect/bahmni-erp-connect/WEB-INF/web.xml and remove the following configuration:

  <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

With these changes you should be able to see the logs being written to bahmni-erp-connect.log file properly.
This commit has been merged to master and cherry picked on to 0.93 branch.

Issue 2:

 The pacs-integration service isn’t generating logs correctly. After the pacs-integration service starts, the /var/log/pacs-integration/pacs-integration.log file has the following lines:


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.


To address the logging issue reported in the below talk thread:

https://talk.openmrs.org/t/bahmni-release-0-93-pacs-integration-logging/42864 in the PACS integration service for Bahmni 0.93 on CentOS 7 ,
it is necessary to add the log4j-slf4j-impl dependency to the pacs-integration-webapp/pom.xml file. This dependency acts as a bridge between SLF4J and Log4j2, which is crucial because our repository uses SLF4J for logging while the log configuration is defined in a log4j2.xml file. Without this bridge, the SLF4J library defaults to a no-operation logger, as indicated by the above error messages

Add the log4j-slf4j-impl Dependency:

Modify the pacs-integration-webapp/pom.xml file by adding the following dependency:

<dependency>

    <groupId>org.apache.logging.log4j</groupId>

    <artifactId>log4j-slf4j-impl</artifactId>

    <version>${log4j.version}</version>

</dependency>

Build the pacs-integration from 0.93 release branch:

Before you can build the repository using the mvn clean install command, ensure that the following prerequisites are met:

  1. Java Development Kit (JDK) 1.8
    Ensure that Java 1.8 is installed on your system. You can set the JAVA_HOME environment variable to point to JDK 1.8 by executing the following command:

Git checkout release-0.93
mvn clean install

      2. Generate a jar :

           A jar file would be generated in below path:

          pacs-integration/pacs-integration-webapp/target/pacs-integration/WEB-INF/lib/log4j-slf4j-impl-2.17.1.jar

      Copy the JAR to the below location on the server:

            /opt/pacs-integration/pacs-integration/WEB-INF/lib/


sudo systemctl stop pacs-integration
sudo systemctl start pacs-integration


Verify the Changes:

  • Check log files in /var/log/bahmni-pacs-integration.
  • Ensure there are no error messages related to logging.


This ensures that SLF4J logging calls are correctly routed to Log4j2, enabling proper logging functionality in the PACS integration service. This resolved the issue of log messages not appearing in the log file and restored the ability to monitor and diagnose the system effectively.

This commit has been merged to master and cherry picked on to 0.93 branch.



The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)