<h2>Connection test failed: Credentials not found, id: <SYS_ID> to connect to Nagios on test connector. Invalid API Key</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><ul><li>It is observed that the Nagios connector failing with the below error while performing the test connector. This is observed when the instance got cloned recently.<br /><br /><span style="color: #ffffff; background-color: #ff0000;">Connection test failed: Credentials not found, id: <SYS_ID> to connect to Nagios on test connector. Invalid API Key</span><br /><br /></li></ul> <p style="padding-left: 40px;"><img style="border: 2px solid black; align: baseline;" src="sys_attachment.do?sys_id=fe5f99c8dbbee850679499ead39619b0" width="885" height="382" align="baseline" border="2" /></p></section></div><div ><h3 >Cause</h3><section><ul><li>If we see the error, we can see that it says "credential not found". When we hardcode the API key in the script it will work. This means that the issue is not with the correctness of credentials but is with the selection of credentials. </li><li>We checked further and found that the selection is failing because there were few "Orphan Credentials" present on the "discovery_credentials" table. When you see the credential from the lost view it shows a valid record but when you open it, <span style="background-color: #ff9900;">it says Page not found or record not found.</span></li><li>One of the root cause of this issue could be the cloning of instances which causes the orphan credentials. </li></ul></section></div><div ><h3 >Resolution</h3><section><ul><li>In order to resolve the issue, we need to identify the Orphan credentials where while opening the record, it says, the record not found page does not exist.</li><li>Delete those records using table cleaner job or some script. <span style="background-color: #ffff00;">It cannot be deleted from UI.</span></li><li>Once you delete the orphan credential, it will start using a valid credential. If the API key is correct then it will pass. if you start getting an invalid API key then you need to provide a valid API key.</li><li>In case you need any assistance in finding Orphan credentials then kindly reach out to support. </li></ul></section></div></article></div>