Skip to content

Instantly share code, notes, and snippets.

@mks-d
Last active December 17, 2018 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mks-d/ef2de4832967e9d175e490e0c1fe7967 to your computer and use it in GitHub Desktop.
Save mks-d/ef2de4832967e9d175e490e0c1fe7967 to your computer and use it in GitHub Desktop.
Unlocking a hanging Bahmni report marked as 'Processing'

One of our Bahmni instances was not able to trigger any Bahmni Reports because - somehow - a report that could never be completed was stuck as 'Processing'. That piece of information could be seen in the 'Reports Queue' under 'My Reports':

Imgur

It was clear that this report was not really processing and that the information was lingering, yet blocking the scheduling of any new report with an error 500:

The server encountered an internal error that prevented it from fulfilling this request.

Restarting Bahmni Reports didn't do anything to it:

sudo service bahmni-reports restart

The first question was then to figure out where this information is stored. Looking at the repository gave some clues by looking at this Liquibase changeset file. The first table that this file refers to is the scheduled_report table. Let's look into it.

Bahmni Reports maintains its own database 'bahmni_reports', see here.

Looking into that table indeed showed what looked like the one 'Processing'-marked line:

mysql -u root -p bahmni_reports

mysql> SELECT status, name FROM scheduled_report;
+------------+------------------------+
| status     | name                   |
+------------+------------------------+
| Processing | Total Chief Complaints |
+------------+------------------------+
1 row in set (0.00 sec)

(Note that 'password' is the default Bahmni's MySQL password if you haven't changed it yet.)
It was removed manually:

mysql> DELETE FROM scheduled_report WHERE status='Processing';

That was it, there was no more lingering reports and new reports could be run again.

@mks-d
Copy link
Author

mks-d commented Dec 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment