"java.net.SocketTimeoutException connect timed out" exception when uploading a custom monitor document containing a webhook to App Metrics 2.x
search cancel

"java.net.SocketTimeoutException connect timed out" exception when uploading a custom monitor document containing a webhook to App Metrics 2.x

book

Article ID: 293633

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

You encounter an HTTP 500 error when uploading a custom monitor document with a webhook to App Metrics 2.x.

When you review the appmetrics application logs, you see a Java network exception.

For example:
$ cf target -o system -s app-metrics-v2
$ cf logs appmetrics --recent
2021-06-08T10:25:22.185+07:00 [APP/PROC/WEB/0] [OUT] 2021-06-08 10:25:22 INFO monitors.MonitorsDatabasePostController [qtp783719469-2124] Received Monitor Request for test
2021-06-08T10:25:32.196+07:00 [APP/PROC/WEB/0] [OUT] 2021-06-08 10:25:32 ERROR catalyst.CatalystServer [qtp783719469-2124] Exception: java.net.SocketTimeoutException connect timed out
2021-06-08T10:25:32.204+07:00 [RTR/2] [OUT] <host name>.<Your domain> - [2021-06-08T03:25:15.966854907Z] "POST /monitor-documents HTTP/1.1" 500 382 97 "-" "curl/7.29.0" "<IP ADDR>:35356" "<IP ADDR>:61006" 
...



Environment

Product Version: 2.0

Resolution

appmetrics tests the webhook URL you are providing in the document during the upload processing.

You can manually validate that the appmetrics have access to the webhook by getting into the application container and using curl.

$ cf target -o system -s app-metrics-v2
$ cf ssh appmetrics
$ curl -v <webhook_url>


If SSH is not enabled in your environment, start a shell in the application container. Refer to How to get into an App Container manually with Garden-RunC backen for more information on how to start a shell in the application container.