Bahmni manage forms

Hello everyone,

Am facing with an issue for managing forms in bahmni, Now we are using form builder in bahmni to create new forms, when you create a form and publish it if you edit that published form bahmni creates a new version of that form meaning it is one form but has many versions, just like it is shown in this image

this creates an issue because when they become many there are some other forms you dont see in the form builder dashboard meaning there are hidden because bahmni currently doesnot show all the forms in the form builder interface. so inorder to see other forms you have to retire forms that are not needed while going to openmrs>manage forms>select form>check the retire check box but on my side it result in this error could any help me to understand the root cause of this error ? thanks

Hello @alain. Were you able to find a solution? I am also having this issue (Bahmni standard 1.0.0 on Docker)

cc @akhilmalhotra

Can you share the error logs ?

@alain @andy_ife can any of you please share the logs?

The logs are very sparse @hamsavarthini. I checked all running containers for logs (except odoo-connect because it spams unending unrelated logs), even watching the logs while retiring a form in OpenMRS, and they don’t show any errors. I’m only able to get a little insight using browser devtools.

Basically, the app sends a POST request to this API:

https://localhost/openmrs/admin/forms/formEdit.form?formId=19

With this request body:

{
  "name": "Follow up form",
  "description": "",
  "version": 1,
  "_published": "",
  "published": "on",
  "encounterType": 3,
  "_retired": "",
  "retired": "on",
  "retireReason": "old version",
  "action": "Save Form"
}

And it gets a 500 response back from the server, with the error page @alain shared.

I’ve tried it while logged in as superman and as admin, with the same error. Do you suggest some other place I could check for logs? Thanks for the help

@andy_ife The container logs may be sparse because the OpenMRS web app logs to its own log file inside the container, not stdout. To find the actual stack trace:

Check the OpenMRS application log inside the container

docker exec -it <openmrs_container_name> cat /var/log/openmrs.log | tail -100

Or find the log file location

docker exec -it <openmrs_container_name> find / -name “*.log” -path “*/openmrs*” 2>/dev/null

The 500 error page that alain shared (screenshot) likely contains a Java stack trace — viewing the page source in the browser will also reveal it.

In the meantime you can try these workounds:

1: Show More Forms in Form Builder

The Form Builder Control Panel shows 50 forms by default. This is controlled by the OpenMRS global property webservices.rest.maxResultsDefault.

To increase the limit:

  1. Go to OpenMRS > Administration > Advanced Settings

  2. Find webservices.rest.maxResultsDefault

  3. Increase it to an appropriate value (e.g., 200)

:warning: Warning: This also affects other areas like the number of patients shown on the registration search page and active patient lists.

This directly addresses the root cause — you won’t need to retire forms just to see hidden ones.

2: Retire Forms via REST API (Workaround for 500 Error)

The 500 error occurs on the legacy OpenMRS admin page (formEdit.form). Instead of using that UI, retire forms via the OpenMRS REST API:

# Get the form UUID first (search by name)

curl -u admin:Admin123 \

“https://localhost/openmrs/ws/rest/v1/form?q=Follow+up+form&v=custom:(uuid,name,version)”

# Retire the form via DELETE (OpenMRS “delete” = retire, not hard delete)

curl -X DELETE -u admin:Admin123 \

“https://localhost/openmrs/ws/rest/v1/form/<FORM_UUID>?purge=false”

Alternatively, use a POST with the retire payload:

curl -X POST -u admin:Admin123 \

-H “Content-Type: application/json” \

-d ‘{“retired”: true, “retireReason”: “old version”}’ \

“https://localhost/openmrs/ws/rest/v1/form/<FORM_UUID>”