Roles and privileges to run reports

I am endeavouring to run the Program Patient State Report (but the problem is general) and am always redirected to this screen:

I guessed that as a user I am short of some privilege and so I have given superman all roles and for the role Reports-app have given all privileges. I hope the 2 images below confirm this.

The wiki describes a method of adding the reports app to the bahmni dashboard which has already been done in the distro for the vagrant box and I have no problems in gaining access to the reports menu, but when I run the report (now) I get sent back to the logon screen as above. Queuing the report produces a further but different error condition which I am currently researching. .

Hi @mafrica, Are you redirected after clicking on ‘Run Now’ report?

Just to the logon screen with the text about not being authenticated

Can you please check the below :

  • The bahmni-reports.log in /var/log/bahmni-reports/ folder for any exception in backend
  • Right click inspect on browser and look for any console logs.

The back-end log shows no new entries if repeat the report now request. Loading the report selection page, the client console shows:

angular.min.9324788c.js:2 GET https://192.168.8.202:8082/bahmni_config/openmrs/i18n/reports/locale_en.json 404 (Not Found) (anonymous) @ angular.min.9324788c.js:2 r @ angular.min.9324788c.js:2 g @ angular.min.9324788c.js:2 (anonymous) @ angular.min.9324788c.js:2 $eval @ angular.min.9324788c.js:3 $digest @ angular.min.9324788c.js:2 $apply @ angular.min.9324788c.js:3 (anonymous) @ angular.min.9324788c.js:1 e @ angular.min.9324788c.js:1 c @ angular.min.9324788c.js:1 zc @ angular.min.9324788c.js:1 ce @ angular.min.9324788c.js:1 (anonymous) @ angular.min.9324788c.js:5 c @ jquery.min.397754ba.js:1 fireWith @ jquery.min.397754ba.js:1 ready @ jquery.min.397754ba.js:1 H @ jquery.min.397754ba.js:1

The full link that leads to the logon screen is:

https://192.168.8.202:8082/bahmni/home/#/login?showLoginMessage&from=http%3A%2F%2F192.168.8.202%3A8082%2Fbahmnireports%2Freport%3Fname%3DProgram%20Patient%20State%20Report%26startDate%3D2017-05-01%26endDate%3D2017-05-05%26responseType%3Dtext%2Fhtml%26paperSize%3DA3%26appName%3Dreports

I am making some small progress but I would really appreciate some help here as the inability to run reports invalidates all the good work Bahmni is demonstrating in collecting data.

Progess: It seems that the distro that I have did not have a bahmni_config/i18n/reports/locale_en.json and so I “borrowed” the version from bahmniapps.

The google chrome console shows “undefined” against https://192.168.8.202:8082/bahmni/reports/reports.min.9ea83dee.js each time I click “Run Now”. The rather large js file clearly exists and so I guess there is some undefined variable being referenced from within. I have stopped openmrs, created a new openmrs.log restarted openmrs and clicked “Run Now” on 3 occasions with about 1 min separation. The log contains a number of errors, but I am unable to separate those that relate to the absence of openelis from those relating to this problem.

Here is the log file: openmrslog.txt (2.1 MB)

Hi @mafrica, Apologies for not being good help. Can you please answer the below questions?

  • Which version of Bahmni?
  • From where did you follow the deployment steps? Did you get to redeploy Bahmni just to ensure that the installation steps were not missed.
  • Can you stop openmrs service -> remove /opt/openmrs/.openmrs-lib-cache i.e “rm -rf /opt/openmrs/.openmrs-lib-cache” and “rm -rf /opt/openmrs/run/work” and -> start openmrs -> and tell us any difference you see.
  • Rebuild Search index from OpenMRS -> Administration -> Search Index under Maintenance section

Please let us know any observations.[quote=“mafrica, post:1, topic:11337”] I am endeavouring to run the Program Patient State Report (but the problem is general) and am always redirected to this screen: [/quote]

were you able to run any other report?

First and mist importantly thanks for taking the time to respond.

I am using the vagrant box installation downloaded around April 1, 2017. The actual version number is not immediately visible to me.

I used the instructions at https://bahmni.atlassian.net/wiki/display/BAH/Bahmni+Virtual+Box plus later instructions from this forum on how to flush test data.

The file remove instructions caused at permanent bout of You are not authenticated or your session expired. Please login ie I in response to all login attempts with all user ids and passwords.

Vagrant Reload put things back to normal.

I am afraid the index rebuild made no difference to behaviour.

Hi @mafrica Please use the below command to find the version of Bahmni installed.

Can you also check the below give a screenshot?

  1. Goto openmrs administration
  2. Goto Users and search for reports-user including retired.
  3. Give screenshot of it.

As ever thanks for helping. Here is the output:

atomfeed-console.noarch 1.0-18 @bahmni bahmni-emr.noarch 0.88-241 @bahmni bahmni-erp.noarch 0.88-32 @bahmni bahmni-erp-connect.noarch 0.88-32 @bahmni bahmni-installer.noarch 0.88-101 @bintray–bahmni-rpm bahmni-lab.noarch 0.88-32 @bahmni bahmni-lab-connect.noarch 0.88-241 @bahmni bahmni-openmrs.noarch 0.88-60 @bahmni bahmni-reports.noarch 0.88-10 @bahmni bahmni-web.noarch 0.88-241 @bahmni epel-release.noarch 6-8 @bintray–bahmni-rpm python-gdata.noarch 2.0.11-1.el6 @bahmni

Can you also check the below give a screenshot?

  1. Goto openmrs administration
  2. Goto Users and search for reports-user including retired.
  3. Give screenshot of it.

Thanks for getting back again. Here is the detail in 2 screen shots

Everything seems okay to me. Were you able to find anything in bahmni-reports logs? Can you share the same.

Here is the log…I am sorry I did not know there was a special log for reports. Anyway I have just repeated the report request (dated 3/6/17) and there is no indication of a problem in the log. However, scrolling back there are a number of warnings which I am afraid I do understand. reportslog.txt (268.5 KB)

Linking to Database has got some issues. That needs to fixed. Found below stackoverflow links to fix them.

I am afraid that as a poor implementer this is well beyond my competence.

However, my reading is that these problems are cased by some sort of network transient between system (Vagrant?) startup and the report request. However, it seems curious that all the other database accesses seem to work fine.

Anyway as a small test I deleted bahmni-reports.log and reloaded vagrant and immediately tried the reporting function with failed in the same way.

Here is the much reduced log file. Note the reports was requested at c. 09.40 with no specific error message. newreportslog.txt (4.3 KB)

The new log doesn’t even have logs of request. One last thing i would request you to do it is to remove bahmni-reports rpm and re-install it and try.

I apologise for taking so much of your time on these things, but I am afraid you may need to lead me by the hand on doing this.

No issues @mafrica. Please follow the below steps.

  1. yum remove bahmni-reports
  2. sudo yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-reports-0.88-10.noarch.rpm
  3. check if bahmni-reports service is up. service bahmni-reports status
  4. Try running reports and observe log for any issues.

When I fired up Vagrant I was told that an upgrade to 0.89 was available and so I have applied the upgrade which I guess would include a reload of bahmni-reports? I check bahmni-reports status and get Service bahmni-reports is running with pid: 1534.

Running the reports then produced the same failure. The log seems to show more of these 2017-06-05 06:20:08,564 WARN [bahmnireports][com.mchange.v2.c3p0.impl.NewPooledConnection] [c3p0] A PooledConnection that has already signalled a Connection error is still in use! 2017-06-05 06:20:08,570 WARN [bahmnireports][com.mchange.v2.c3p0.impl.NewPooledConnection] [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ] which will not be reported to listeners! com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920) at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1304) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1296) at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5028) at com.mchange.v2.c3p0.impl.NewProxyConnection.rollback(NewProxyConnection.java:855) 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.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:73) at com.sun.proxy.$Proxy32.rollback(Unknown Source) at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:3666) at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3825) at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2756) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:272) Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

I am afraid I am way out of my depth in analyzing this, but is it possible that the Vagrant Box does not like the port that bahmni-reports is trying to use?

Here is the full log.reportslog0506.txt (83.7 KB)