Skip to content

bug: plugin api-breaker set response headers occur 500 Internal Error #7234

@he953481025-debug

Description

@he953481025-debug

Current Behavior

Use api-breaker to set circuit breaker

Expected Behavior

When the upstream service is not available, return my desired json

Error Logs

image
image

Steps to Reproduce

1.configure api-breaker of plugin
{ "break_response_code": 200, "max_breaker_sec": 300, "unhealthy": { "http_statuses": [ 500, 502, 503 ], "failures": 3 }, "healthy": { "http_statuses": [ 200 ], "successes": 3 }, "break_response_body": "{\"code\":\"0\",\"msg\":\"new json body\"}", "break_response_headers": [{"content-type":"application/json"}] }
2.When I remove break_response_headers, the plugin works fine

Environment

  • Kubernetes version: v1.18.15
  • APISIX version : apache/apisix:2.14.1-alpine
  • Ingress Controller: apache/apisix-ingress-controller:1.4.1
  • etcd version: docker.io/bitnami/etcd:3.4.14-debian-10-r0
  • APISIX Dashboard version: 2.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions