Client Timeout error in elastic heartbeat for http POST

I have an error while trying to apply the heartbeat for the post request. My heartbeat config is:

heartbeat.monitors:
    - type: http
      ipv4: true
      mode: any
      timeout: 30s
      name: test
      schedule: '@every 1m'
      urls:
          - "test-app.test.svc.cluster.local:8080/send_message"
      check.request:
           method: POST
           headers: 
               'Content-Type': 'application/json'
           body: '{"channel_id":"heartbeat","app_version":"1.10.0","fid":"string","allmember_id":"string","message":{"id":"string","data":"chicken or eggs"},"from_fixed_menu":false,"from_map":false}'
                  
      check.response:
            status: 200

error i am getting is

           "error": {
            "type": "io",
            "message": "Post \"http://test-app.test.svc.cluster.local:8080/send_message\": http: request timed out while waiting for response (Client.Timeout exceeded while awaiting headers)"
          }

I am using heartbeat 7.10.0 in GKE, FYI the GET method for the health check works

Hi,

It seems to be network related, can you check that you are able to resolve your app hostname from your server ? ( ping test-app.test.svc.cluster.local )

Not exactly as i have tested the curl from the server and its works fine

It's tough to say what the problem would be if curl works but heartbeat does not. Can you post your exact curl command? One thought is that yes it may be network related as mentioned above.

Another possibility is that the application is doing user agent sniffing and is rejecting heartbeat but allows curl.

That aside it's really hard to say as it's probably an issue specific to your application and/or network. You could try to get a packet dump and see if that yields any clues.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.