TwiN / gatus

⛑ Automated developer-oriented status page
https://gatus.io
Apache License 2.0
6.15k stars 410 forks source link

Incompatible Protocol Error 464 when checking API Endpoint #488

Open ionutz89 opened 1 year ago

ionutz89 commented 1 year ago

Describe the bug

I am experiencing an issue while using the tool to check the health status of an API Endpoint. The tool is returning an HTTP code 464, indicating an incompatible protocol error.

What do you see?

The tool is returning an HTTP code 464 when attempting to check the health status using the HTTP/1.1 protocol. However, the API only accepts requests using the HTTP/2 protocol.

What do you expect to see?

The tool should successfully check the health status of the API Endpoint and return the appropriate HTTP response code 200.

List the steps that must be taken to reproduce this issue

  1. Execute the following command using curl to check the health of the API Endpoint using HTTP/2:
❯ curl --http2 -s -i https://domain.com/health
HTTP/2 200
server: awselb/2.0
date: Thu, 25 May 2023 07:36:48 GMT
content-type: application/vnd.spring-boot.actuator.v3+json
vary: Origin
vary: Access-Control-Request-Method
vary: Access-Control-Request-Headers
server-tag: 92425df1-499d-4f04-a9f3-28ec6641375d

{"status":"UP"}%
  1. Execute the following command using curl to check the health of the API Endpoint using HTTP/1.1:
❯ curl --http1.1 -s -i https:/domain.com/health
HTTP/1.1 464
Server: awselb/2.0
Date: Thu, 25 May 2023 07:36:54 GMT
Content-Length: 0
Connection: keep-alive

Version

5.4.0

Additional information

The API Endpoint only supports HTTP/2 protocol requests and does not accept HTTP/1.1.

On other API Endpoints is working fine.

I would like to know if any option is available to force the tool to use the HTTP/2 protocol to check the API Endpoint's health.

Please let me know if you need any more details or information to resolve this issue.

Thank you for your attention to this matter.

vax-r commented 1 year ago

Hello @ionutz89 , I want to help with this bug. but I wonder does the API endpoint service built by yourself? should I make one so I can reproduce the bug again? Also which solution do you think is better?

  1. Everytime we want to check an endpoint using http, we first try using HTTP/1.1, if it fails then we try HTTP/2 again
  2. Let user define which protocol they want to use in config.yaml , specifying HTTP/1.1 or HTTP/2

@TwiN , I would also like to hear from your suggestions, thank you!

ionutz89 commented 1 year ago

Hello @vax-r,

Thank you for picking up this ticket.

The target endpoint is behind ALB on the AWS cloud.

Recently the application was migrated to serve only HTTP/2.

Before, it was only serving HTTP/1 and was working fine.

I think both of your proposals should be there. One default and one for the user to have the option to choose HTTP protocol.

Let me know if you need more details.