Getting 500 error for status call in Admin module, Programs csv import in bahmni-docker

Hi everyone,

We have recently moved to bahmni-docker, Where we integrated a Admin module. In csv export. When we upload a file for program, There are 2 calls going, one is program call and another one is status call. Status call getting 500 error and showing message in ui(There was an issue in the server. Please try again.) even if the program call is success or failure. but when we click on the refresh button, the status is getting success, we can able to see all the status on ui. Adding screenshots.

Programs module is not enabled/tested for Bahmni LITE. Can you reproduce this issue on Bahmni STANDARD?

sure @gsluthra. We will try to reproduce the issue and let you know. Thanks!

Hi @gsluthra, We tried to reproduce the issue with bahmni-standard in our lower environments. Even in bahmni-standard also, issue is there but inconsistent. Call is failing for 2-3times for 10hits. But in our environments with bahmni-lite, Its failing continuously.

I have created a JIRA ticket to track this, and for someone to pair with you to debug this issue: [BAH-3525] - Bahmni - JIRA

In a fresh Bahmni instance, when a CSV file is uploaded for the first time in the CSV Upload section of the Admin module, an exception is triggered, resulting in an error message being displayed. Two calls are made: one for the upload and another for the status check. However, the status call returns a 500 error, showing a message in the UI (“There was an issue in the server. Please try again.”), regardless of whether the program call succeeds or fails. Interestingly, clicking the refresh button resolves the status, displaying all statuses on the UI (Refer bug card).

It was identified that trying to update certain records within a MySQL DB using the JDBC connector leading to “Zero Date value Prohibited” exception. This occurs because the MySQL Java Connector, by default, throws this exception when processing empty or null values for datetime fields. To address this, the zeroDateTimeBehavior configuration property can be adjusted. Allowable values include:

  • “exception” (the default), which throws an SQLException with an SQLState of S1009.
  • “convertToNull”, which returns NULL instead of the date.
  • “round”, which rounds the date to the nearest closest value, which is 0001-01-01.

The recommended approach is to set OMRS_DB_EXTRA_ARGS to include &zeroDateTimeBehavior=convertToNull. During openmrs runtime, OMRS_DB_EXTRA_ARGS appends zeroDateTimeBehavior=convertToNull to the JdbcUrl. Upon boot up, openmrs utilizes its own startup script to define the jdbc url, where OMRS_DB_EXTRA_ARGS appends any provided parameters to the end of the url.

1 Like