When submitting a record in the Service Portal, users can be unexpectedly redirected to the record list page, without succeeding to actually submit the form.Issue When submitting a record in the Service Portal, users can be unexpectedly redirected to the record list page, without succeeding to actually submit the form. Set up a record producer to create records on the incident tableSet up catalog client on-submit script to redirect the user to a list page.Access the record producer on the Service portal, fill in the mandatory fields, and submit the formThis should create an incident record and then redirect the user to the incident list. This intermittently doesn't work as expected., Occasionally, on submission of the form, the system redirects the user to the incident list, before the record is created. Symptoms When the reported issue occurs, we see this error stack on the node logs for that affected user: =============================================================== 2017-08-17 01:23:15 (422) Default-thread-2 71E9504B37E44700483F148543990E78 #607859 /angular.do Parameters ------------------------- sysparm_ck=b1e95...a3663 (length=72) type=sc_cat_item sysparm_type=$sp 2017-08-17 01:23:15 (501) http-30 WARNING *** WARNING *** Resource does not exist: /scs/snc_node_disable.html 2017-08-17 01:23:15 (511) Default-thread-2 71E9504B37E44700483F148543990E78 SEVERE *** ERROR *** JSONObject["sys_id"] not found. org.json.JSONException: JSONObject["sys_id"] not found. at org.json.JSONObject.get(JSONObject.java:301) at org.json.JSONObject.getString(JSONObject.java:427) at com.glide.service_portal.catalog.SPCatalogRequest.create(SPCatalogRequest.java:38) at com.glide.service_portal.SPProcessor.processCatItem(SPProcessor.java:85) at com.glide.service_portal.SPProcessor.process0(SPProcessor.java:60) at com.glide.service_portal.SPProcessor.process(SPProcessor.java:45) at com.glide.ui.ng.AngularProcessor.process(AngularProcessor.java:115) at com.glide.processors.AProcessor.runProcessor(AProcessor.java:412) at com.glide.processors.AProcessor.processTransaction(AProcessor.java:187) at com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:165) at com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:49) at com.glide.sys.ServletTransaction.run(ServletTransaction.java:34) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) 2017-08-17 01:23:15 (515) Default-thread-2 71E9504B37E44700483F148543990E78 SEVERE *** ERROR *** java.lang.reflect.UndeclaredThrowableException java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy43.getCookies(Unknown Source) at com.glide.ui.CookieMan.getCookieFromRequest(CookieMan.java:119) at com.glide.ui.CookieMan.getSessionStore(CookieMan.java:335) at com.glide.sys.GlideSessionStore.store(GlideSessionStore.java:49) at com.glide.processors.AProcessor.processTransaction(AProcessor.java:189) at com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:165) at com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:49) at com.glide.sys.ServletTransaction.run(ServletTransaction.java:34) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.glide.ui.GlideServletRequest.invoke(GlideServletRequest.java:121) ... 11 more Caused by: java.lang.IllegalStateException: The request object has been recycled and is no longer associated with this facade at org.apache.catalina.connector.RequestFacade.getCookies(RequestFacade.java:647) at com.glide.size_aware.SizeAwareHttpServletRequest.getCookies(SizeAwareHttpServletRequest.java:250) ... 15 more 2017-08-17 01:23:15 (519) Default-thread-2 71E9504B37E44700483F148543990E78 #607859 /angular.do -- total transaction time: 0:00:00.101, transaction processing time: 0:00:00.101, total wait time: 0:00:00.000, session wait: 0:00:00.000, semaphore wait: 0:00:00.000, source: 77.66.90.41, chars: 2, uncompressed chars: 0, SQL time: 5 (count: 4), business rule: 0 (count: 0), phase 1 form length: 0, largest chunk written: 2, request parms size: 208, largest input read: 0 2017-08-17 01:23:15 (854) http-31 New transaction 71E9504B37E44700483F148543990E78 #607860 send /amb/meta/disconnect ========================================================================= CauseThere can be various reasons for the reported issue, we are covering one of the possible causes in this article. On-submit of the record producer seems to be there is a race condition happening with the on-submit client script and submit action of the record producer. In some situations intermittently on-submit goes ahead of the actual submit request and causes the user to be redirected before actually record is submitted. ResolutionThe following are a couple of possible workarounds for this issue: Delay the redirect for 2 seconds using something similar to this code (this is just an example, please adapt it to your needs and environment): function onSubmit() { //Make the redirection to happen after 2s. Meanwhile the request gets submitted successfully. setTimeout(function(){ top.window.location = '/sp?id=requests'; }, 2000); } De-activate the redirect client script and handle the redirect in a different way, for example with the record producer redirect or redirect with the sc_cat_item widget.