Target Record Not Found IssueIssue Navigating to sys_connection table shows a list of records. However, any attempts to open up the records fail with the error 'Target Record Not Found'. ReleaseAll ReleasesCauseThese records are orphan records. They can be created for multiple reasons such as cloning an instance or a scheduled job. ResolutionRemoving the orphan records from the instance fixes the issue. ** Please note that if the orphan records exist in prod environment, we need to create a change and ask for customer's permission before any deletion. ** You can export the table to an XML before deleting the records just in case you need to revert back the changes. Do the following steps to remove the orphan records: 1. From scripts - background, run the following code to see how many orphan records exists on the instance: findOrphans('table name', 'sys_class_name=class_name', false);// ============== WARNING ================ //// Do not modify anything below this line! //// ======================================= //function findOrphans(table, query, remove) {if (gs.getCurrentScopeName() != 'rhino.global') {gs.info("This script must be run in the global scope. Please switch your scope and try again.");return;}var orphanCount = 0, removedCount = 0;var gr = new GlideRecord(table);if (query !== null) {gs.info("Querying " + table + " with encoded query: " + query);gr.addEncodedQuery(query);} else gs.info("Querying all rows on " + table);gr.query();gr.setWorkflow(false);while(gr.next()) {if(isOrphan(gr)) {gs.info("Found orphan on " + table + " (Class: " + gr.sys_class_name + " - Sys ID: " + gr.sys_id + ")");orphanCount++;if (remove === true) {gs.info("Removing orphan");gr.sys_class_name = table;gr.update();gr.deleteRecord();removedCount++;}}}gs.info("Total orphans found: " + orphanCount);gs.info("Total orphans removed: " + removedCount);}function isOrphan(gr) {if(gr.sys_class_name == null || gr.sys_class_name == '') return false;var childClass = new GlideRecord(gr.sys_class_name);if(!childClass.isValid()) return true;childClass.get(gr.sys_id);return !childClass.isValidRecord();} 2. After confirming the total number of orphan records, navigate to the sys_connection table and export the data into an XML file just in case the record removal is not successful. 3. Navigate to scripts - background again and run the script again. But this time change the following line of the code. (Calling findOrphans() method with 'true' parameter) findOrphans('sys_connection', 'sys_class_name=http_connection', false); To: findOrphans('sys_connection', 'sys_class_name=http_connection', true); 4. Go back to sys_connection table and verify the records deletion.