Unable to Fetch Locations Error -- on installing Bahmni

Please keep us posted here when you find the solution, @kha123 & @aj_jaswanth. Thanks! :slightly_smiling: :bug:

@gsluthra @michael. The vagrant box was running on Windows. OpenMRS was accessible without any glitch. But, when Bahmni is accessed, it was properly downloading all the static resources directly served by the apache server. But, all the proxied openmrs calls to OpenMRS were failing.

It was because, SELinux was enabled in the vagrant CentOS box. It denied permission to apache to connect to ‘127.0.0.1:8080’ (OpenMRS).

The solution was to allow apache to connect to network. It was done by running the command ‘setsebool -P httpd_can_network_connect true

NOTE: If you are still not able to access Bahmni properly, you can try removing OpenMRS cache folder.

  1. Stop OpenMRS service using ‘service openmrs stop’.

  2. Run ‘*rm -rf /tmp/openmrs-lib-cache’ and ‘rm -rf /opt/openmrs/run/work/tomcat’ to remove cache folders.

  3. Start OpenMRS service using ‘service openmrs start

  4. Open Bahmni in a new browser tab.

2 Likes

Thanks for posting the soluiton @aj.jaswanth

Thanks for the solution @aj.jaswanth. It worked perfectly.

I wanted to post back here that I have found a related issue when using the empty starter database as found here: https://raw.githubusercontent.com/Bahmni/bahmni-package/master/openmrs/resources/openmrs_clean_dump.sql

In my case, I found that this is a permission error: “…Privileges required: Get Locations…” shows in the stack trace.

I found that indeed, the “Anonymous” role has the “View Locations” privilege, but lacks the “Get Locations” privilege, which seems to be what it needs. This is likely related to tickets like this one TRUNK-3373 in which an effort was made to change from “View Xyz” to “Get Xyz” privileges. @darius can probably recall the history here better.

Can you please confirm that you see this as an active bug?

1 Like

Hi Friends,

I am coming across a similar issue post a fresh install using a vmbox. The error says “Unable to fetch locations. Please reload the page”. I have tried all the possible resolutions provided on various threads.

I was wondering if somebody was able to fix this and could help me with the resolution ?

Really appreciate any help you could provide.

Chreer!

Nikhil V

Hey @aj.jaswanth

Thanks for the solution, I have tried this with no luck. Anything else you could think of ?

Thank you :slight_smile:

Can you SSH into the vagrant machine using vagrant ssh command and run sudo service openmrs status and check if openmrs is running or not.

Hi Jaswanth,

I confirmed the openmrs service is started, and the vagrant ssh command give the message from the screenshot.

Attached for your reference.

Did you try refreshing Bahmni homepage after starting up OpenMRS service?

Check whether SELinux is enabled or not using sestatus command.

Yes confirmed that I have disabled the SELinux. Tried refreshing the homepage restarting the OpenMRS service. No Luck.

Please confirm if I am doing this right. I am following instructions from here and doing that will allow me to access LIS and ERP system, but not the Bahmni EMR Clinical UI page.

Any other ideas ?

Can you check the logs of openmrs? Logs are at /var/log/openmrs/openmrs.log.

https://talk.openmrs.org/t/beans-error-unable-to-fetch-locations-please-reload-the-page/ talks about an openmrs issue.

Hi @aj.jaswanth

Even after performing these steps, i am having the same problem on CentOS 6.7. Also, SELinux is disabled.

Any rules that we need to add to ip4tables & and ip6tables

Hi all,

Just wanted to bring to the attention of community members that when you ran into the situation below; the same steps outlined above comes in handy as well.

I am not too sure whether this contribution should appear as a new topic though hence my placing it here.

CHALLENGE:

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Apache/2.2.15 (CentOS) Server at localhost Port 443

SOLUTION:

Run the command ‘setsebool -P httpd_can_network_connect true’ and restart the apache server.

1 Like

In essence the issue of “Unable to Fetch Locations” error arises because of the inability of Bahmni EMR UI to connect to OpenMRS service. The reasons for not being able to connect can be many, including the fact that the access to OpenMRS service port is blocked by some firewall, or the OpenMRS service itself isn’t running.

To solve this problem, many possible solutions have already been mentioned on this post. In the next release of Bahmni, this error message has been improved, so that if connection to OpenMRS isn’t available, the message says so – instead of saying “unable to fetch locations”.

I am closing this thread, so that people either try out the solutions above first before posting another response, or they can start a new thread if they feel the above solutions don’t work for them.