search cancel

UIM Restmon probe for GCP monitoring never reaching out - log shows StringIndexOutOfBoundsException

book

Article ID: 253486

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

New implementation of Restmon probe to monitor production GCP.  Fairly sure I have the GCP connection params correct, but no evidence of restmon probe ever reaching our web proxy, much less GCP API.

Restmon.log shows repeated entries

2022-11-01 17:08:59 ERROR DataCollector - Error in executeUrlTasks is:
2022-11-01 17:08:59 ERROR DataCollector - java.lang.StringIndexOutOfBoundsException: String index out of range: -6
        at java.lang.String.substring(String.java:1967)
        at com.ca.ce.restmon.auth.oauth.OAuthUtils.getPrivateKey(OAuthUtils.java:282)
        at com.ca.ce.restmon.auth.oauth.OAuthUtils.getGoogleCredentials(OAuthUtils.java:226)
        at com.ca.ce.restmon.auth.oauth.OAuthUtils.updateOAuthGoogle(OAuthUtils.java:213)
        at com.ca.ce.restmon.auth.oauth.OAuthUtils.updateAccessToken(OAuthUtils.java:154)
        at com.ca.ce.restmon.comm.RestApiCallFactory.getRestApiCall(RestApiCallFactory.java:98)
        at com.ca.ce.restmon.core.ExecuteUrlTask.call(ExecuteUrlTask.java:22)#

suggesting that authentication is never being attempted.  GCP probe is 3.32, system is 20.4 CU4.

Environment

Release : 20.4

Resolution

The value entered for the Private Key must be in the format of "-----\n<key>\n-----"

Example: -----\nsomekey\n-----