{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":29811,"path":"it-operations-management/discovery/t_FixTheCauseOfASensorErrorMessage.md","title":"Fix the cause of a sensor error message","bundle":null,"doc_type":null,"release":"australia","body":"\n# Fix the cause of a sensor error message\n\nTo fix a Discovery sensor error message, you must fix the JavaScript file containing the code that generated the error.\n\n## Before you begin\n\nVerify the following:\n\n-   You have access to the Discovery Definition modules.\n-   You have completed the steps in [Find the cause of a sensor error message](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/discovery/t_FindTheCauseOfASensorErrorMessage.md).\n\nRole required: admin\n\n## About this task\n\nUse the sensor name and stack trace you identified in [Find the cause of a sensor error message](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/discovery/t_FindTheCauseOfASensorErrorMessage.md) to locate the failing code. The stack trace provides the line number and function name where the error occurred.\n\n**Note:** The exact fix depends on the specific sensor and payload. This topic describes where and how to fix the error, not specific code changes. For errors with a refined code, you can view the root cause and remediation steps directly on the [Discovery Admin Workspace Error Details](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/discovery/daw-error-details.md) page.\n\n## Procedure\n\n1.  Navigate to the Discovery Definition module where the error occurred.\n\n    For example, navigate to **Discovery Definition** &gt; **Script Includes**.\n\n2.  Search for the sensor name in the **Name** field.\n\n3.  Select the link to open the record.\n\n4.  Locate the failing function or line using the stack trace, then correct the JavaScript.\n\n    For example, if the error indicates it \"Cannot read property X of undefined\", add a defensive check around the payload fields.\n\n5.  Select **Update**.\n\n\n## What to do next\n\nRerun Discovery to verify the sensor no longer generates the error. If the error persists after applying the fix, contact ServiceNow Support and provide the full stack trace, the sensor name, and a description of the changes you made.\n\n**Parent Topic:**[Discovery error messages](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/discovery/c_DiscoveryErrorMessages.md)\n\n**Related topics**  \n\n\n[Find the cause of a sensor error message]()\n\n[Find the cause of a \"No Sensor Defined\" error message]()\n\n[Find the cause of a \"Probe not found\" error]()\n\n"}}