SG-AppDynamics populated the metadata field with invalid JSON using single quotes (causing errors opening the $csdm_app_service.do page)DescriptionThe Service Graph Connector for Observability - AppDynamics populates the metadata field of Application Service records with bad JSON, like:{ 'levels' : '3' }; This looks a bit like JSON, but isn't JSON. The JSON standard, and the parser used in our code, expects valid JSON that uses double quotes for strings in this field.A symptom of this is that the Application Service page /$csdm_app_service.do breaks on load of one of these cmdb_ci_service_calculated records, with an error from one of the background rest requests to /api/now/csdm_app_service/get_app_service.The scripts involved are in these these RTE Entity Multiple Input Script Operation records:/sys_rte_eb_multi_in_script_operation.do?sys_id=1a484bd6eb43301035b382ea7c522848/sys_rte_eb_multi_in_script_operation.do?sys_id=4e78431aeb43301035b382ea7c522886/sys_rte_eb_multi_in_script_operation.do?sys_id=c1508599ebb2301035b382ea7c5228faSteps to Reproduce Install Service Graph Connector for Observability - AppDynamics and run an importOpen /cmdb_ci_service_calculated_list.do , adding the metadata column if necessarySee that records updated by SG-AppDynamics have bad JSON format in the metadata field Expected behaviour:This field should contain properly formatted JSON.Actual behaviour:Values such as { 'levels' : '3' }; are populated in the field, which is not JSON, due to the single quotes.A side-effect of this, which is to break the /$csdm_app_service.do page, can be reproduced by making sure the above list is in CSDM view, and then opening one of the services with the invalid json. It makes a call to the "Get Application Service" rest web service, which uses the "CSDMAppServiceHelper" script include, when running these lines which expect JSON: var metadata = JSON.parse(gr.getValue('metadata'));method.levels = metadata.levels + ''; Appnode localhost logs will show this exception from the bad value: 2023-10-27 02:08:45 (151) Default-thread-9 88D06DCBC34EB51005015065E00131E6 txid=a731a587a9d6 #126830 /api/now/csdm_app_service/get_app_service Parameters -------------------------sys_id=<record sys_id>api=api2023-10-27 02:08:45 (207) Default-thread-9 88D06DCBC34EB51005015065E00131E6 txid=a731a587a9d6 WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: Unexpected token in object literalCaused by error in sys_script_include.0ef3fd1d73c30010ee4dd3c72bf6a704.script at line 7932023-10-27 02:08:45 (209) Default-thread-9 88D06DCBC34EB51005015065E00131E6 txid=a731a587a9d6 tx_pattern_hash=749222927 SEVERE *** ERROR *** Unexpected token in object literalcom.glide.rest.domain.ServiceException: Unexpected token in object literal[...]Caused by: SyntaxError: Unexpected token in object literal (sys_script_include.d2426c9ec0a8016501958bf2ac79c775.script; line 155)at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:262)at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:137)at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:348)at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:240)at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:219)at com.glide.rest.service.custom.CustomService.runScript(CustomService.java:90)at com.glide.rest.service.custom.CustomService.execute(CustomService.java:77)[...]at org.mozilla.javascript.gen.sys_script_include_0ef3fd1d73c30010ee4dd3c72bf6a704_script_119._c_anonymous_40(sys_script_include.0ef3fd1d73c30010ee4dd3c72bf6a704.script:880)[...]at org.mozilla.javascript.gen.sys_script_include_0ef3fd1d73c30010ee4dd3c72bf6a704_script_119._c_anonymous_38(sys_script_include.0ef3fd1d73c30010ee4dd3c72bf6a704.script:793)[...]2023-10-27 02:08:45 (210) Default-thread-9 88D06DCBC34EB51005015065E00131E6 txid=a731a587a9d6 tx_pattern_hash=749222927 WARNING *** WARNING *** #126830 [REST API] RESTAPIProcessor : Handling exception Unexpected token in object literal2023-10-27 02:08:45 (210) Default-thread-9 88D06DCBC34EB51005015065E00131E6 txid=a731a587a9d6 tx_pattern_hash=749222927 *** End #126830 /api/now/csdm_app_service/get_app_service, user: j**** total time: 0:00:00.072, processing time: 0:00:00.067, CPU time: 0:00:00.054, total wait: 0:00:00.005, session wait: 0:00:00.005, SQL time: 0:00:00.001 (count: 10), ACL time: 0:00:00.001, Cache build time: 0:00:00.001, Script time: 0:00:00.055 (count: 1), source: 148.139.0.230, type: rest, origin scope: global , method:GET, api_name:now/csdm_app_service, resource:now/csdm_app_service/get_app_service, version:Default, user_id:j*****, response_status:500WorkaroundThis 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.Related Problem: PRB1713784