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

[Bug]: There seems to be no way to set the success code for gRPC services #5958

Open
proof-nicholas opened this issue Oct 23, 2024 · 0 comments
Labels
type/bug Issues that are bugs.

Comments

@proof-nicholas
Copy link

Description:

I have a backend gRPC service that I'm attempting to set the health check success code with an http configuration as follows:

    http:
      version: grpc
      path: /
      healthcheck:
        path: "/grpc.health.v1.Health/Check"
        success_codes: "0"

I get the following error:

- Updating the infrastructure for ...                   [update rollback complete]  [10.5s]
  The following resource(s) failed to update: [TargetGroup].
  - A target group to connect the load balancer to your service on port 8080         [update complete]           [0.0s]
    Resource handler returned message: "Health check matcher GRPC code can
    not be empty (Service: ElasticLoadBalancingV2, Status Code: 400, Reque
    st ID: 2f882cda-c03f-4a13-90fd-de57293579b7)" (RequestToken: 6e68ba66-
    1ac0-9126-8914-6128326c07f0, HandlerErrorCode: GeneralServiceException
    )

If I don't set the success_codes, AWS uses its default value of 12 which causes my health checks to fail.

Details:

AWS Region: us-east-2
type: Backend Service
version: version: v1.34.0, built for darwin

Observed result:

Error when attempting to set the success code.

Expected result:

Target group health check is configured with the success code set to zero rather than 12.

Debugging:

I checked the source code and this file https://github.com/aws/copilot-cli/blob/b1c4c42cf1c47793a8181314a732312f3e3df1a7/internal/pkg/template/templates/workloads/partials/cf/alb.yml#L43 seems to imply that it should be set using the http.additional_rules but when I tried that as in the following:

    http:
      version: grpc
      path: /
      additional_rules:
        - healthcheck:
            path: "/grpc.health.v1.Health/Check"
            success_codes: "0"

I get the following error:

✘ validate manifest against environment "staging": validate "http": validate "additional_rules[0]": "path" must be specified
@proof-nicholas proof-nicholas added the type/bug Issues that are bugs. label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issues that are bugs.
Projects
None yet
Development

No branches or pull requests

1 participant