Event Data saved in Event Rules can be cropped, preventing them being opened again (Oracle)DescriptionThe example Event Data saved in Event Rules, taken from an existing Event record, can be quite large. The em_match_rule.event_data string field is only 4000 characters max length. The data is JSON format, and can get cropped when the record is saved. That makes the data invalid JSON, which breaks the JSON parser when the record is re-loaded. Instances running over mysql/mariadb/raptor DB don't notice this, because those don't enforce the max_length parameter of the field, but Oracle instances do. That means most on-premise instances and a few hosted instances would have this problem. This makes it impossible to load the Event Rule in the Event Rule Designer [/$em_event_rule_designer.do], which uses REST APIs to get the data. A UI16 form will still load.Steps to Reproduce On an Oracle based instanceRefresh and event rule, so large data from an existing event gtes saved in the event rule, as perhttps://www.servicenow.com/docs/bundle/yokohama-it-operations-management/page/product/event-management/task/refresh-event-rule.htmlClose and reopen the event rule in Event Rule Designer Expected behaviour: It loads. Actual behaviour: Open the event rule as XML, and you will see the event_data field is cropped at 4000 charshttps://<instance name>.service-now.com/em_match_rule.do?sys_id=<sys_id>&XML The data will start with{"expressions":[],"rawFields":[{"regex":.....but the closing braces/brackets at the end of the data are not present, making it invalid JSON that the parser can;t load. Browsser debug console will show:https://instance name.service-now.com/api/now/event_rules/getEventData?inputType=rule&sysId=<sys_id> 500 (Internal Server Error) appnode logs/or session debug while loading in the Event Rule Designer will show: 09:44:50.642 Couldn't decipher the stack trace resulting from the following JavaScriptException: 09:44:50.645 java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@163aad6c: org.mozilla.javascript.JavaScriptException: java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@163aad6c: org.mozilla.javascript.Context.makeJavaScriptException(Context.java:2416) org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:2400) org.mozilla.javascript.MemberBox.invoke(MemberBox.java:247) org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:674) org.mozilla.javascript.FunctionObject.call(FunctionObject.java:603) org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2988) org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1928) org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1112) org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:161) com.glide.caller.gen.sys_ws_operation_cdca069193122200a346f179077ffbe2_operation_script.call(Unknown Source) com.glide.script.ScriptCaller.call(ScriptCaller.java:22) org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:160) org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:3089) org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2998) org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1928) org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1112) org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:161) com.glide.caller.gen.sys_ws_operation_cdca069193122200a346f179077ffbe2_operation_script.call(Unknown Source) com.glide.script.ScriptCaller.call(ScriptCaller.java:22) org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:160) org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:702) org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:4412) org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:174) com.glide.script.ScriptCompiler.executeAndPublishMetric(ScriptCompiler.java:77) com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:439) com.glide.script.ScriptEvaluator.evaluate(ScriptEvaluator.java:219) com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:375) com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:260) com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:237) com.glide.rest.service.custom.CustomService.runScript(CustomService.java:90) com.glide.rest.service.custom.CustomService.execute(CustomService.java:77) com.glide.rest.handler.impl.ServiceHandlerImpl.invokeService(ServiceHandlerImpl.java:37) com.glide.rest.processors.RESTAPIProcessor.invokeService(RESTAPIProcessor.java:368) com.glide.rest.processors.RESTAPIProcessor.process(RESTAPIProcessor.java:354) com.glide.processors.AProcessor.runProcessor(AProcessor.java:779) com.glide.processors.AProcessor.processTransaction(AProcessor.java:326) com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:187) com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:175) com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:58) com.glide.sys.Transaction.run(Transaction.java:2803) com.glide.ui.HTTPTransaction.run(HTTPTransaction.java:35) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) java.base/java.lang.Thread.run(Thread.java:840) 09:44:50.650 JavaScript evaluation error on: (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { var inputType = request.queryParams.inputType; var sysId = request.queryParams.sysId; var em = new SNC.EventRuleManager(); var json = em.getEventRuleData(inputType, sysId); return { "event_data": json }; })(request, response); Root cause of JavaScriptException: java.lang.IllegalArgumentException : java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@163aad6c: com.glide.util.JSONUtil.deserialize(JSONUtil.java:196) com.glide.util.JSONUtil.parse(JSONUtil.java:289) com.glide.util.JSONUtil.parse(JSONUtil.java:277) com.glideapp.itom.snac.rules.EventData.getEventDataFromJson(EventData.java:87) com.snc.sw.eventrule.handler.EventRuleHandler.getEventRuleDataByRule(EventRuleHandler.java:486) com.snc.sw.eventrule.handler.EventRuleHandler.getEventRuleData(EventRuleHandler.java:414) com.snc.sw.eventrule.EventRuleManager.getEventRuleData(EventRuleManager.java:127) com.snc.sw.eventrule.EventRuleManager.jsFunction_getEventRuleData(EventRuleManager.java:131) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:569) org.mozilla.javascript.MemberBox.invoke(MemberBox.java:236) org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:674) org.mozilla.javascript.FunctionObject.call(FunctionObject.java:603) org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2988) org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1928) org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1112) org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:161) com.glide.caller.gen.sys_ws_operation_cdca069193122200a346f179077ffbe2_operation_script.call(Unknown Source) com.glide.script.ScriptCaller.call(ScriptCaller.java:22) org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:160) org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:3089) org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2998) org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1928) org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1112) org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:161) com.glide.caller.gen.sys_ws_operation_cdca069193122200a346f179077ffbe2_operation_script.call(Unknown Source) com.glide.script.ScriptCaller.call(ScriptCaller.java:22) org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:160) org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:702) org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:4412) org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:174) com.glide.script.ScriptCompiler.executeAndPublishMetric(ScriptCompiler.java:77) com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:439) com.glide.script.ScriptEvaluator.evaluate(ScriptEvaluator.java:219) com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:375) com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:260) com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:237) com.glide.rest.service.custom.CustomService.runScript(CustomService.java:90) com.glide.rest.service.custom.CustomService.execute(CustomService.java:77) com.glide.rest.handler.impl.ServiceHandlerImpl.invokeService(ServiceHandlerImpl.java:37) com.glide.rest.processors.RESTAPIProcessor.invokeService(RESTAPIProcessor.java:368) com.glide.rest.processors.RESTAPIProcessor.process(RESTAPIProcessor.java:354) com.glide.processors.AProcessor.runProcessor(AProcessor.java:779) com.glide.processors.AProcessor.processTransaction(AProcessor.java:326) com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:187) com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:175) com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:58) com.glide.sys.Transaction.run(Transaction.java:2803) com.glide.ui.HTTPTransaction.run(HTTPTransaction.java:35) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) java.base/java.lang.Thread.run(Thread.java:840) 09:44:50.657 java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@163aad6c: com.glide.rest.domain.ServiceException: java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@163aad6c: com.glide.rest.service.custom.CustomServiceExceptionResolver.throwServiceException(CustomServiceExceptionResolver.java:82) com.glide.rest.service.custom.CustomServiceExceptionResolver.throwServiceException(CustomServiceExceptionResolver.java:77) com.glide.rest.service.custom.CustomServiceExceptionResolver.resolveForException(CustomServiceExceptionResolver.java:39) com.glide.rest.service.custom.CustomServiceResultHandler.handle(CustomServiceResultHandler.java:22) com.glide.rest.service.custom.CustomService.execute(CustomService.java:78) com.glide.rest.handler.impl.ServiceHandlerImpl.invokeService(ServiceHandlerImpl.java:37) com.glide.rest.processors.RESTAPIProcessor.invokeService(RESTAPIProcessor.java:368) com.glide.rest.processors.RESTAPIProcessor.process(RESTAPIProcessor.java:354) com.glide.processors.AProcessor.runProcessor(AProcessor.java:779) com.glide.processors.AProcessor.processTransaction(AProcessor.java:326) com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:187) com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:175) com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:58) com.glide.sys.Transaction.run(Transaction.java:2803) com.glide.ui.HTTPTransaction.run(HTTPTransaction.java:35) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) java.base/java.lang.Thread.run(Thread.java:840) 09:44:50.658 #23679 [REST API] RESTAPIProcessor : Handling exception java.lang.IllegalArgumentException: Cannot decode: java.io.StringReader@163aad6cWorkaroundThis problem is currently under review and targeted to be fixed in a future release. Subscribe to this Known Error article to receive notifications when more information will be available. The workarounds is to increase the max_length of the field in the dictionary: it Open the dictionary record in a listhttps://<instance name>.service-now.com/sys_dictionary_list.do?sysparm_query=element=event_data^name=em_match_rule&sysparm_view=Customise the list layout to add the 'Max Length' column, which will show it has the value '4,000'Edit the Max Length value to make it at least 50000 There are some out-of-box records will also be cropped. e.g. "OEM 12c Trap" is >43k. https://<instance_name>.service-now.com/em_match_rule_list.do?sysparm_query=sys_idIN84d41bad1b597094cd2bdb16cc4bcb7c%2C18ef137493b03200a346f179077ffb7f%2C6dbe982ddbcd3cd02245d8fdd39619e4%2Cc6c56ab61b22f414f642117f034bcbeb%2C3bc7a32753094110f681ddeeff7b12e0%2C671602a9eb03201030d6e9133852289d%2C6cb56d8edbf74b40b4027a131f9619dc%2Cec22343593413200c52d31f6357ffb77%2C635c9677dbce5010561b186c139619e1%2C06ce24f193413200c52d31f6357ffb17%2Cbffa6b1a93e13200c52d31f6357ffb05%2Cbafed56093613200c52d31f6357ffb18%2Cbffefe3beb03201030d6e913385228a6%2C8ccca8b193413200c52d31f6357ffb04%2C56e7c277eb03201030d6e91338522811%2Ca01e5e61eb03201030d6e913385228c7%2C98087d25eb03201030d6e9133852289f%2Cb5df283d53013200c7a7f625a11c08c3%2C%5EGROUPBYsys_package&sysparm_first_row=1&sysparm_view=advanced After increasing the Max Length, if you have them installed, then these Applications/Plugins can be repaired to replace the cropped records with the full records: Event Management Event Management Connectors Metric Intelligence Service Graph Connector for Observability - DatadogRelated Problem: PRB1882989