Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service status endpoint not returning correct status #96

Open
chrsamp opened this issue May 31, 2023 · 1 comment
Open

Service status endpoint not returning correct status #96

chrsamp opened this issue May 31, 2023 · 1 comment
Assignees
Labels
bug Something isn't working jira

Comments

@chrsamp
Copy link

chrsamp commented May 31, 2023

When configuring a service that also uses the request-transformer plugin to rewrite the Host header to the upstream service, the GET /v2/namespaces/{ns}/services endpoint shows the service as down, when in fact both the upstream and APS service are operating normally.

gwconfig.yaml

services:
- name: aps-docs
  host: bcgov.github.io
  path: /aps-infra-platform/
  tags: [ ns.csampson ]
  plugins:
  - config:
      add:
        headers:
          - "Host: bcgov.github.io"
    enabled: true
    name: request-transformer
    protocols:
    - https
    - http
    tags: [ ns.csampson ]
  port: 443
  protocol: https
  retries: 0
  routes:
  - name: aps-docs-route
    tags: [ ns.csampson ]
    hosts:
    - aps-docs.api.gov.bc.ca
    preserve_host: false
    paths:
    - /
    methods:
    - GET
    strip_path: false
    https_redirect_status_code: 426
    path_handling: v0
    request_buffering: true
    response_buffering: true

gwa-api Response

[
	{
		"env_host": "aps-docs.api.gov.bc.ca",
		"host": "aps-docs.api.gov.bc.ca",
		"name": "aps-docs",
		"reason": "404 Response",
		"status": "DOWN",
		"upstream": "https://bcgov.github.io:443/aps-infra-platform/"
	}
]

Expected behaviour

The GET /v2/namespaces/{ns}/services endpoint shows the service as up

Observed behaviour

The GET /v2/namespaces/{ns}/services endpoint erroneously responds with a "404 Down" response (in this case, because the upstream returns 404 for unknown hosts).

curl https://aps-docs.api.gov.bc.ca returns an HTTP 200 code and the correct response from the upstream service.

@chrsamp chrsamp added the bug Something isn't working label May 31, 2023
@JohnathanBrammall
Copy link

Confirm if this has been resolved with latest deployment.

@Elson9 Elson9 self-assigned this Sep 28, 2023
@rustyjux rustyjux added the jira label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira
Projects
None yet
Development

No branches or pull requests

4 participants