Relationship type is missing in query builder even though it is there in cmdb_rel_ci and cmdb_rel_ty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 09:58 AM
Hi Team,
I’m currently working on a query to identify VMware Virtual Machine Instances that have a relationship with Servers.
This query works as expected in the lower environment, but relationship type is missing in in prod instance to select in query builder. Here's what I’ve checked so far:
- Compared cmdb_rel_type entries between both environments.
- Manually verified data in cmdb_rel_ci in both systems.
- Confirmed that the relationship type "Instantiates::Instantiated by" is not available for selection in query builder in Production.
- Only "Registered on::Has registered" is visible, which returns ESX servers but not the expected virtual machine relationships.
- Both relationship types are visible in lower environment. cmdb_ci_type and cmdb_rel_ci has same data.
- Tried adjusting direction, level, and other parameters—still no luck.
Any pointers or suggestions to help resolve this would be much appreciated. If anyone has faced a similar issue or knows how to make the missing relationship type available, please share your insights.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:54 AM
Hi @SivaBoppana ,
As per my understanding Issue summary is :-
* Relationship type exists in cmdb_rel_type & data exists in cmdb_rel_ci.
* But it doesn’t appear as selectable in Query Builder in PROD.
* Same setup works in lower environment.
solution & checks:
Step 1: Confirm cmdb_rel_type record is active and visible
In PROD:
* Go to cmdb_rel_type table → find the record for Instantiates::Instantiated by.
* Make sure:
* Active field = true
* Applies to is correctly configured (i.e., Source type: ESX Server, Target type: Virtual Machine).
* There isn’t a retired or hidden flag (sometimes customizations hide it).
Step 2: Check cmdb_rel_type advanced flags
Verify:
* sys_scope field (should be global or your app scope).
* sys_domain if using domain separation (should be global domain if intended for all).
* Visible field (sometimes custom column; make sure not hidden by ACL/UI policy).
Step 3: ACLs & roles
In PROD:
* Check if there’s an ACL on cmdb_rel_type table filtering or restricting visibility of this specific record.
* Use the Security > Access Control (ACL) module:
* Search for table cmdb_rel_type or field-level ACLs.
* Compare ACLs with your lower environment to find any delta.
Step 4: Compare sys_scope & app metadata
Sometimes, relationship types are installed via plugins or specific apps.
* Compare:
* sys_scope of the relationship type between environments.
* If lower env is in Global but PROD is in a restricted scope, Query Builder may hide it.
Step 5: Relationship type directionality
* Verify in PROD:
* Source table and target table are correct.
* Make sure the relationship is defined:
* Source: ESX Server (cmdb_ci_esx_server)
* Target: Virtual Machine (cmdb_ci_vm_instance)
* If direction is flipped, it won’t show in Query Builder.
Step 6: Query Builder data source
In PROD:
* Make sure Query Builder’s data source is correctly set.
* Confirm you’re not using a saved Query Builder view that may have filtered out that relationship.
Step 7: Clear cache & reload metadata
After making changes, run in PROD:
* Cache refresh: cache.do
* Or use script:
GlideCacheManager.invalidateAll();
GlideTableManager.invalidateTable("cmdb_rel_type");
Then, re-open Query Builder.
Step 8: If still missing → export & import
If everything matches & it still doesn’t appear:
* Export the cmdb_rel_type record from lower env (XML).
* Import into PROD.
* Retest in Query Builder.
Optional: Validate relationship usage
In PROD:
* Go to cmdb_rel_ci table → filter by type=Instantiates::Instantiated by → confirm data exists.
* Check if relationship data points to correct CIs
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thank You
AJ - TechTrek with AJ
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
ServiceNow Community MVP 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 12:25 AM
Hi,
I've recently encountered a similar bug in Query Builder, but in my case, selecting relationships between nodes was not available at all (could only select CIs with no relationships or duplicates).
This was related to Yokohama release change in one of the jobs populating Rels in Query Builder.
Here is the KB article I found that might help you:
CMDB Query Builder Suggested Relations job can fail to process all CMDB_REL_CI records - Known Error
Hope this helps.
Cheers,
Mateusz