Remove Patient from service queue throws error 400 and 500

Our medical missions team and I launched Open MRS 50 days ago at a 30 bed hospital in a remote part of the Philippines. We have the Drugs and Labs modules enabled.

For the most part it is working good. The biggest issue we face right now is we have 3 patient charts on the service queue when we click on “remove patient” it throws error 400 for 2 of them and error 500 for 1 of them. I deleted empty encounters but did not help.

Am not very technical and a bit slow figuring out what to do here, am hoping someone can share my first steps to get help?

Thanks!

SystemInfo

OpenMRS Version 2.7.6 Build 0

Linux OS 6.12.65-linuxkit architecture aarch64 Java Version 17.0.17 System Language en System Timezone Asia/Manila Filesystem Encoding UTF-8

Queue 2.9.0 O3

Open Concept Lab Module 2.4.0

EMR API Module 2.3.0 Metadata Mapping 1.6.0 Rest Web Services OMOD 2.50.0.a9565c Patient Flags Module 3.0.8 Generation 4.14.0

==========================================

Error removing patient from queue

Server responded with 400 () for url /openmrs/ws/rest/v1/queue-entry/6dc09755-0949-4d98-bbe2-eb5eb5a24714. Check err.responseBody or network tab in dev tools for more info

Error removing patient from queue

Server responded with 500 () for url /openmrs/ws/rest/v1/queue-entry/b29371f1-da68-4bf6-b121-1b31c9b54067. Check err.responseBody or network tab in dev tools for more info

Hey @lionadal — great work getting OpenMRS live. Can you check what version of the Queue module you have installed — and also share your OpenMRS version? Posting those here will help the community narrow this down much faster

@ibacher

Thank you for the guidance!!

The below is what I came up with. I will also edit the original with a couple of these in case others wanted to see it right away.

Cheers!

===================================

from SystemInfo

OpenMRS Version 2.7.6 Build 0

Queue 2.9.0

Open Concept Lab Module 2.4.0

Operating System Linux

Operating System Architecture aarch64

Operating System Version 6.12.65-linuxkit

Java Version 17.0.17

Java Vendor Amazon.com Inc.

JVM Version 17.0.17+10-LTS

JVM Vendor Amazon.com Inc

System Language en

System Timezone Asia/Manila

Filesystem Encoding UTF-8

Serialization Xstream 0.2.16

Authentication 2.0.0

FHIR2 2.7.0

Event Module 3.0.0

EMR API Module 2.3.0

Metadata Mapping 1.6.0

Rest Web Services OMOD 2.50.0.a9565c

Order Templates 1.0.2

Patient Flags Module 3.0.8

O3 Forms 2.3.0

ID Generation 4.14.0

So, unrelated to your error…. I asked about the concept dictionary you used. Where did you get it from, or did you make it from scratch? Would you be willing to share the export file of concepts?

I will ask our administrator and get back to you.

We do have the Open Concept Lab Module 2.4.0 and I believe we imported CIEL

When I am creating forms, there are a lot of concepts I can chose from, many of them are coded, have normal high/low values, have units, etc. All very helpful as they are supposed to be standard.

However, we are also finding out the “Normal” global ranges are not fully accurate for our population, which is indigenous Filipinos. We don’t change the values provided, but we give our doctors a separate list of domestic population “Normals”

You should check out the new reference range project which allows for overwriting and setting multiple reference ranges for a given lab test or vitals. You can also let me know where CIEL has ranges that are limiting for you.

Oh, I would definitely like to check out the new reference range project. Where do I start?

I verified myself our subscription URL points to CIEL v2026-01-25

Our admin did do CIEL imports in Feb and Oct 2025

Hey @lionadal, any chance you could paste the stack trace from the network tab in the browser console? It’s likely going to contain a lot more actionable information than the error snackbar. Great job getting things up and running!

Would be very happy to!

Am not allowed to upload files, so will paste the results after this message. This is what I did:

Opened an incognito window > connected to OpenMRS

clicked on “remove patient”, produced error 500

went to Chrome settings > developer tools > console > copy and paste the results

Did the same for another stuck patient chart that gives error 400, file attached.

Console messages from error 500

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-patient-registration-app.fieldDefinitions’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-patient-registration-app.sectionDefinitions’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-service-queues-app.priorityConfigs’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-service-queues-app.statusConfigs’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-service-queues-app.concepts’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-service-queues-app.visitQueueNumberAttributeUuid’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-service-queues-app.defaultFacilityUrl’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-service-queues-app.priorityConfigs[0].tagClassName’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-service-queues-app.priorityConfigs[0].tagType’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-patient-registration-app.fieldDefinitions[0].name’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-patient-registration-app.fieldDefinitions[1].name’ provided. Ignoring.

004e7d2b0f4efa90.js:1 Unknown config key ‘@openmrs/esm-patient-registration-app.fieldDefinitions[2].name’ provided. Ignoring.

7

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

4

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2

POST http://sdh-server1/openmrs/ws/rest/v1/queue-entry/b29371f1-da68-4bf6-b121-1b31c9b54067 500 (Internal Server Error)

p @ 8d0cae71fa1d80b5.js:2

o @ 1151.js:1

submitAction @ 1151.js:1

onClick @ 1151.js:1

Ie @ 0c2f3b44672b59a6.js:2

We @ 0c2f3b44672b59a6.js:2

(anonymous) @ 0c2f3b44672b59a6.js:2

Vr @ 0c2f3b44672b59a6.js:2

Ar @ 0c2f3b44672b59a6.js:2

(anonymous) @ 0c2f3b44672b59a6.js:2

fs @ 0c2f3b44672b59a6.js:2

Fe @ 0c2f3b44672b59a6.js:2

$r @ 0c2f3b44672b59a6.js:2

Xn @ 0c2f3b44672b59a6.js:2

qn @ 0c2f3b44672b59a6.js:2

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text

2

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

s @ 8d0cae71fa1d80b5.js:2

m @ 8d0cae71fa1d80b5.js:2

vu @ 0c2f3b44672b59a6.js:2

No @ 0c2f3b44672b59a6.js:2

Ci @ 0c2f3b44672b59a6.js:2

ws @ 0c2f3b44672b59a6.js:2

bs @ 0c2f3b44672b59a6.js:2

ys @ 0c2f3b44672b59a6.js:2

cs @ 0c2f3b44672b59a6.js:2

Ql @ 0c2f3b44672b59a6.js:2

(anonymous) @ 0c2f3b44672b59a6.js:2

setTimeout

t @ 8d0cae71fa1d80b5.js:2

Promise.then

n @ 8d0cae71fa1d80b5.js:2

setTimeout

t @ 8d0cae71fa1d80b5.js:2

Promise.then

n @ 8d0cae71fa1d80b5.js:2

2

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

network console from error 400

Failed to load resource: the server responded with a status of 500 ()Understand this error

258d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

s @ 8d0cae71fa1d80b5.js:2

m @ 8d0cae71fa1d80b5.js:2

vu @ 0c2f3b44672b59a6.js:2

No @ 0c2f3b44672b59a6.js:2

Ci @ 0c2f3b44672b59a6.js:2

ws @ 0c2f3b44672b59a6.js:2

bs @ 0c2f3b44672b59a6.js:2

ys @ 0c2f3b44672b59a6.js:2

cs @ 0c2f3b44672b59a6.js:2

Ql @ 0c2f3b44672b59a6.js:2

(anonymous) @ 0c2f3b44672b59a6.js:2Understand this error

8d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

s @ 8d0cae71fa1d80b5.js:2Understand this error

/openmrs/ws/rest/v1/queue-entry/6dc09755-0949-4d98-bbe2-eb5eb5a24714:1 Failed to load resource: the server responded with a status of 400 ()Understand this error

58d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text. s @ 8d0cae71fa1d80b5.js:2Understand this error

48d0cae71fa1d80b5.js:2 O3 Core Translations does not provide key ‘SDH’. The key itself is being rendered as text.

@wedson @dennis

Was what I did OK?

Or anything else I can do to give insight?

Thanks!!!

So these are the results from the console tab, we’d need to see the results from the network tab. You’d have to click on the relevant network call, here’s a screenshot detailing how to do that.

I’ve highlighted the preview tab, but sharing the details from the payload tab can be helpful too

Correction - Step 4 should be *Copy and paste the text from here

Aha!

Thanks for the detailed instructions. Sorry for lots of lines below. Hope I got this right for error 500?

I will also produce one for error 400…

  1. {error: {message: “[queue.entry.duplicate.patient]”,…}}

    1. error: {message: “[queue.entry.duplicate.patient]”,…}

      1. code: “org.openmrs.module.queue.api.impl.QueueEntryServiceImpl:106”

      2. detail: “org.openmrs.module.queue.exception.DuplicateQueueEntryException: queue.entry.duplicate.patient\n\tat org.openmrs.module.queue.api.impl.QueueEntryServiceImpl.saveQueueEntry(QueueEntryServiceImpl.java:106)\n\tat jdk.internal.reflect.GeneratedMethodAccessor1052.invoke(Unknown Source)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:569)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)\n\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)\n\tat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)\n\tat jdk.proxy6/jdk.proxy6.$Proxy330.saveQueueEntry(Unknown Source)\n\tat jdk.internal.reflect.GeneratedMethodAccessor1052.invoke(Unknown Source)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:569)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.cache.interceptor.CacheInterceptor.lambda$invoke$0(CacheInterceptor.java:54)\n\tat org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:351)\n\tat org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:64)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:123)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:58)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:58)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)\n\tat jdk.proxy6/jdk.proxy6.$Proxy331.saveQueueEntry(Unknown Source)\n\tat org.openmrs.module.queue.web.resources.QueueEntryResource.save(QueueEntryResource.java:94)\n\tat org.openmrs.module.queue.web.resources.QueueEntryResource.save(QueueEntryResource.java:54)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.update(DelegatingCrudResource.java:145)\n\tat org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceController.update(MainResourceController.java:133)\n\tat jdk.internal.reflect.GeneratedMethodAccessor1402.invoke(Unknown Source)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:569)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)\n\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)\n\tat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:555)\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:623)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:61)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:73)\n\tat org.openmrs.web.xss.XSSFilter.doFilter(XSSFilter.java:39)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:66)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:121)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.webservices.rest.web.filter.ContentTypeFilter.doFilter(ContentTypeFilter.java:64)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:106)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.authentication.web.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:68)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.authentication.web.AuthenticationFilter.doFilter(AuthenticationFilter.java:165)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:57)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.owasp.csrfguard.CsrfGuardFilter.handleSession(CsrfGuardFilter.java:107)\n\tat org.owasp.csrfguard.CsrfGuardFilter.doFilter(CsrfGuardFilter.java:97)\n\tat org.owasp.csrfguard.CsrfGuardFilter.doFilter(CsrfGuardFilter.java:68)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:114)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.openmrs.web.filter.CookieClearingFilter.doFilterInternal(CookieClearingFilter.java:77)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:156)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:125)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:166)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:88)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:83)\n\tat org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:643)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:72)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:398)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:935)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1831)\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)\n\tat org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:973)\n\tat org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:491)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)\n\tat java.base/java.lang.Thread.run(Thread.java:840)\n”

      3. message: “[queue.entry.duplicate.patient]”

These are the messages after “remove patient” and get error 400

  1. {,…}

    1. error: {message: “Invalid Submission”, code: “webservices.rest.error.invalid.submission”, globalErrors: [],…}

      1. code: “webservices.rest.error.invalid.submission”

      2. fieldErrors: {endedAt: [{code: “queue.entry.error.cannotEndAfterVisitStopDate”,…}]}

        1. endedAt: [{code: “queue.entry.error.cannotEndAfterVisitStopDate”,…}]

          1. 0: {code: “queue.entry.error.cannotEndAfterVisitStopDate”,…}

            1. code: “queue.entry.error.cannotEndAfterVisitStopDate”

            2. message: “Queue entry cannot end after the visit stop date”

      3. globalErrors: []

      4. message: “Invalid Submission”

@nethmi hopefully I did the above properly?

Thanks for sharing the detailed logs — this really helps clarify the issue.

From what I understand, the 400 and 500 errors seem to be coming from two different scenarios:

  • The 500 error (DuplicateQueueEntryException) appears to happen when a patient is already present in the queue and a duplicate entry is being created or updated.
  • The 400 error is a validation issue, specifically when the endedAt timestamp exceeds the visit stop date.

It might be helpful to separate these two cases during debugging, since they are triggered by different layers (validation vs service logic).

For the duplicate entry case, would it make sense to handle this more gracefully at the service layer (e.g., checking for existing active entries before saving)?

And for the validation error, is there any client-side validation in place to prevent invalid endedAt values before the request is sent?

Also curious if these issues occur under specific workflows (e.g., concurrent updates or repeated actions), or if they are consistently reproducible with certain inputs.

@varshithreddy thank you for the insights!

Am not able to reproduce the problem. Not sure how these are happening.

What should I be doing to remove these patients from the service queue?

Should I look at their “All encounters” and try to delete empty ones?

Or should I try deleting the patient permanently and re-create their charts?

Thanks for the update!

I’d avoid deleting patients or recreating charts — that might hide the issue rather than help us understand the root cause, and could lead to data inconsistencies.

From the screenshot, it looks like there may be duplicate or inconsistent queue entries for the same patient. Instead of deleting data directly, it might be better to:

  • Check if there are multiple active queue entries for the same patient in the same queue

  • Inspect the corresponding visit and ensure the visit stop date aligns with the queue entry (endedAt)

  • Look at the sequence of actions (e.g., add → move → remove) to see if something is creating overlapping entries

If possible, it might also help to:

  • Try reproducing this with a fresh patient while logging requests

  • Check whether multiple requests are being triggered (e.g., double clicks or retries)

If you’re able to share one example patient or queue entry where this happens, we might be able to narrow it down further.

This could help us identify whether it’s a data inconsistency issue or something happening at the service/UI level.

Hi Shavva!!!

I looked at your 5 bullets and wasn’t able to figure things out.

I think your idea of sharing one example patient is a good idea.

I also think I am mixing 2 or more issues at the same time and is making troubleshooting harder.

Am going to create a new talk dealing with one issue until that is resolved.

Thanks for the suggestions!