500 Internal Server Error from Service Broker when rendering custom form, NonUniqueResultException in form service logs.
search cancel

500 Internal Server Error from Service Broker when rendering custom form, NonUniqueResultException in form service logs.

book

Article ID: 314730

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
  • 500 Internal Server Error in Service Broker when rendering custom form.
  • The forms service logs /var/log/service-logs/prelude/form-service-app/file-logs/form-service-app.log throw a NonUniqueResultException similar to:

2024-03-21T10:24:04.969Z ERROR form-service [host='form-service-app-xx-x' thread='parallel-1' user='<Username>' org='<OrgID>' trace='<TraceID>' parent='' span='<SpanID>'] o.s.b.a.w.r.e.AbstractErrorWebExceptionHandler - [f6cd735d-14213]  500 Server Error for HTTP POST "/form-service/api/forms/renderer/model?formType=requestForm&isUpdateAction=false&formId=&projectId=&resourceId=&deploymentId=&sourceType=com.vmw.blueprint.version&sourceId=<ID>%2F<Version>"
        org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2
                at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:385)
                Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:


Environment

VMware Aria Automation 8.16.x

Cause

The issue can occur when there are duplicate rows in the form_execution table of the form-db database.

Resolution

A resolution for the issue is planned for the Aria Automation 8.18 release.

Workaround:

To workaround the issue disable and re-enable the affected custom form.

1. Open the affected custom form in the designer.
2. Click Disable
3. Click Save
4. Click Enable
5. Click Save

This will clear the duplicate rows in the database and recreate the single expected unique row.


Additional Information

Impact/Risks:
The affected form cannot be rendered in the UI and fails with a 500 internal server error.