envoyproxy / envoyproxy/gateway

LUA scripts in EnvoyExtensionPolicy failing validation causes all routes to return direct_response with 500 status

Open
#6,942 4 comments 0 reactions 0 assignees View on GitHub
stale triage
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

**Description**:
>What issue is being seen? Describe what should be happening instead of
the bug, for example: The expected value isn't returned, etc.

I have a `EnvoyExtensionPolicy` with a clearly invalid LUA script. Indeed the status message on that object is that it's not accepted:

```
Lua: validation failed for lua body in policy with name
envoyextensionpolicy/envoy-gateway-system/lua-headers/lua/0:
failed to validate with envoy_on_response: :628: attempt to call a non-function object
```

Now everything in the Gateway is returning HTTP 500

```
"response_code":500,"response_code_details":"direct_response"
```

And all generated routes in envoy.json now have this attached to them:

```json
{
"match": {
"path_separated_prefix": "/httpbin"
},
"metadata": {
"filter_metadata": {
"envoy-gateway": {
"resources": [
{
"kind": "HTTPRoute",
"name": "backend",
"namespace": "httpbin"
}
]
}
}
},
"direct_response": {
"status": 500
},
"name": "httproute/httpbin/backend/rule/0/match/0/external-1"
}
```

Is this expected behaviour? I felt a bit surprised about it. I rather expected that everything continues working, but without the LUA.

**Environment**:
>Include the environment like gateway version, envoy version and so on.

This is for 1.5.0 version, and this image: `docker.io/envoyproxy/gateway:v1.5.0`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.