"HTML Form Entry: 'Value Exceeds Maximum Length' Error on OpenMRS 2.6.9"

Issue Description

I am developing an HTML Form using the HTML Form Entry Module in OpenMRS 2.6.9 Build db3cef, but I am encountering the following error when trying to save it:

"This value exceeds the maximum length of {0} permitted for this field."

The same form works on another OpenMRS instance, which makes this issue even more confusing.


Debugging Steps Taken

  1. Tested the form on multiple instances → Works on another OpenMRS instance but fails on 2.6.9.
  2. Checked system configurations:
  • Java Version: OpenJDK 1.8.0_402 (Temurin)
  • Database: MySQL (UTF-8, InnoDB)
  • Memory: 8GB
  • HTML Form Entry Module Version: 3.13.1
  1. Tried different input values → Issue persists with minimal input.
  2. No excessively long field values in the form.

Simplified HTML Form

xml

CopyEdit

<htmlform>
    <style>
      .regular-input { width: 250px; }
      .small-input { width: 120px; }
    </style>

    <div class="form-group">
        <label>Folha / Linha:</label>
        <obs conceptId="859b9522-bf66-4369-8b44-469744ba2b19" class="small-input"/>
        <span> / </span>
        <obs conceptId="d4431707-cd3e-46f2-b018-4aa047462a3d" class="small-input"/>
    </div>

    <div class="form-group">
        <label>Tipo de CI:</label>
        <obs conceptId="01183c6d-456a-4265-be18-bc498454a2d1" class="regular-input"/>
    </div>

    <div class="form-group">
        <label>Nº de Ordem:</label>
        <input type="number" name="num-ordem" class="small-input"/>
    </div>

    <div class="form-group">
        <label>Data do Aconselhamento:</label>
        <encounterDate class="small-input"/>
    </div>

    <div class="form-group">
        <label>Nome do Caso Índice:</label>
        <lookup expression="patient.personName" class="regular-input"/>
    </div>

    <div class="form-group">
        <label>Idade:</label>
        <lookup expression="patient.age" class="small-input"/> anos
    </div>

    <div class="form-group">
        <label>Sexo:</label>
        <lookup expression="patient.gender" class="small-input"/>
    </div>

</htmlform>

System Configuration

  • OpenMRS Version: 2.6.9 Build db3cef
  • HTML Form Entry Module Version: 3.13.1
  • Database: MySQL (UTF-8, InnoDB)
  • Memory: 8GB

Request for Help

  • Has anyone faced this issue before?
  • Could this be related to a configuration setting?
  • Any suggestions for further debugging?

Any help from the community would be highly appreciated!


Notes

  • The form is simplified to highlight key elements.
  • The full form contains more fields but follows a similar structure.
  • This issue occurs only in OpenMRS 2.6.9 but not on another instance.

Can you share the full server side log via pastebin.com?