- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 10-04-2018 08:30 AM
I recently had the misfortune to install an update set where the update failed. I followed up with a Back Out operation which also failed. One of the issues stemming from this was a record which could not be viewed or deleted. I investigated and found:
1. That the record was in a table that was created by the updated set involved.
2. The table extended another table ( u_cmdb_ci_app_service ). In other words, u_cmdb_ci_app_service was the parent of the table which was deleted.
3. The table was deleted in the Backout operation.
4. The part of the record which resided in the parent tables was not deleted. But the record's class still reflected the now non-existent table.
This became apparent when XML exports of the table failed for an invalid markup. It turns out that the record fragment was being exported, but there was no closing tag for the record. Attempts to view the record failed and no delete button appeared in the UI. Attempts to directly delete the record using a script also failed.
The Solution
-----------------
1. Locate the "highest table" in the record fragment's parentage which still exists
2.. Attempt to view the record using the list view of the parent table. Extract the sys_id form the URL in the "not found" message.
3. Run a script which updates the sys_class variable to the same value as the table just determined.
4. You can now view the record and delete it using the UI.
Here's the script I used:
// set the tbl variable to the correct table
var tbl = 'u_cmdb_ci_app_service';
// Set the run number if the job will be run multiple times in one day
var job = 2;
// set the sysid tpo the record's sysid
var sys_id = "0a29c13cdbbce38072b471fa8c961995";
// the script follows:
gs.log("chk_rec." + job + ".1 starting for table " + tbl + ", and sys_id=" + sys_id);
var gr = new GlideRecord(tbl);
gr.addQuery("sys_id", sys_id);
gr.query();
if ( gr.next() )
{
gs.log("chk_rec." + job + ".2 listing table=" + tbl + " name=" + gr.name + ", sys_id=" + gr.sys_id);
gr.sys_class_name = tbl;
// gr.update(); // commented for testing. Uncomment to perform the update
}
else
{
gs.log("chk_rec." + job + ".3 failed!");
}
gs.log("chk_rec." + job + ".4 Execution complete.");
- 1,444 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank for sharing this. It worked perfectly!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Happy to have helped. I knew when I wrote this article, that the problem was obscure, and few people would be interested. But I also thought that it would be most helpful for the few that do encounter the problem.
Thank you for the nice feedback.