Service Mapping Troubleshoot 101: Business Service with Service Model (Why my business service map is not showing up on the page?)Description<!-- div.margin{ padding: 10px 40px 40px 30px; } table tr td { padding: 15px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } .title { color: #D1232B; font-weight:normal; font-size:28px; } .spanColor { color: #646464; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } hr{ border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc; } ul { list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --> Background 1) The business service map for the Service Mapping, has a "Service Model" data structure at the backend. 2) When we ask to do the "View Map", the system will have to produce the "Service Model" in a JSON format, and the page will render the data. 3) With Kingston release, there is a "Related Link" on the business service, name "Recompute Business Service" which will do a recompute of the service model. 4) There are three additional links on the "Related Links" of each of the "Discovered Service" (cmdb_ci_service_discovered)which are only showing up for "maint" at the moment. They are: a) "Show Service Model JSON" b) "Sync with Service Model" c) "Remove from Service Model" Note: The three links are defined on the "UI Actions" of the instance. If you will like to have access to those links, you can open the respective records, change the condition to only show for specific users and do an "Insert and Stay" to create a separate record. Please use these links with care, a misuse of these features may result in performance issues on your instance. Checks If the "Discovery Service" (cmdb_ci_service_discovered) is not showing up, we want to check to see if the "Service Model" JSON is returning the correct information. To do this, click on the "Show Service Model JSON" link and see if a proper JSON object shows up.If you get just a "null" word, check to see if there are proper "Entry Point" for the "business service". If there are proper "Entry Point" for the "business service", you can try the following Quick Fixes. Quick Fix 1 If the "Show Service Model JSON" returns with just a "null" word, you can try to click on the "Recompute Business Service" once. What this does, is that it will do a "Recomputation" for the "Service Model" for the "business service". After you a while, try the "Show Service Model JSON" and see if it returns a proper JSON. If it still returns the same result, you could try the background script as listed on the "Service Model Troubleshooting" at the bottom of this KB. Quick Fix 2 Try the "Recompute Business Service" first. If the "Show Service Model JSON" still returns with just a "null" word, you can try to click on the "Sync with Service Model" once. What this does, is that it will do a "Recomputation" for the "Service Model" for the "business service". ** USE WITH CAUTION ** This "Sync with Service Model" removes and then adds the business service to the Service Model, along with its Entry Points and Boundary Endpoints. As a result, all business service history resets. After you a while, try the "Show Service Model JSON" and see if it returns a proper JSON. Quick Fix 3 Try the "Recompute Business Service" and "Sync Service Model JSON" first. Occasionally, we may need to do the whole "Service Model" again. Warning: By doing this step, the whole history of the business service, will be gone forever. The steps are:1) Click on the "Remove from Service Model"2) Click on the "Sync with Service Model" To check, click on the "Show Service Model JSON" again to see if it returns a proper JSON. Service Model Troubleshooting If trying the above Quick Fix, the "Show Service Model JSON" still returns a single word "null", it may suggest that the system had some trouble trying to do the "recomputation" for the "Service Model". To do this, we have to run the following script using the "Background Scripts" on the instance. // Begin Script gs.setProperty("glide.cmdb.logger.source.service_mapping.coordinator","info,warn,error,*"); gs.setProperty("glide.cmdb.logger.source.service_mapping.template", "info,warn,error,*"); gs.setProperty("glide.cmdb.logger.source.service_mapping.matching", "info,warn,error,*"); gs.setProperty('glide.transaction.max_logs', 200*10000); var gr = new GlideRecord('cmdb_ci_service_discovered'); gr.get('<replace_with_business_service_sys_id'); // <<<<<<<======= replace argument with service sys_id var layerId= gr.layer; var layerGr= new GlideRecord('svc_layer'); layerGr.get(layerId); var env= sn_svcmod.ServiceContainerFactory.loadEnvironment(layerGr.environment); var allLayers= env.layers(); for (var i= 0 ; i< allLayers.length; i++) { var layer = allLayers[i]; layer.markRecomputationNeeded(); } SNC.ServiceMappingFactory.recomputeLayer(layerGr); gs.setProperty('glide.transaction.max_logs', 200*1000); gs.setProperty("glide.cmdb.logger.source.service_mapping", "info,warn,error"); gs.setProperty("glide.cmdb.logger.source.service_mapping.coordinator", "info,warn,error"); gs.setProperty("glide.cmdb.logger.source.service_mapping.template", "info,warn,error"); gs.setProperty("glide.cmdb.logger.source.service_mapping.matching", "info,warn,error"); // End Script