envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
25.12k stars 4.82k forks source link

Error: terminal filter named envoy.filters.network.golang of type envoy.filters.network.golang must be the last filter in a network filter chain. #36829

Open owayss opened 1 month ago

owayss commented 1 month ago

Title: Error: terminal filter named envoy.filters.network.golang of type envoy.filters.network.golang must be the last filter in a network filter chain.

Description: Seen on contrib-dev, but also on all v1.30+ releases that admit the golang filter.

It seems that the golang network filter implementation is hardcoded to be a terminal filter https://github.com/envoyproxy/envoy/blob/63d4fb0c442d6362bcf5101fc2a5279aeaef31bb/contrib/golang/filters/network/source/config.h#L42, while the HTTP golang filter can be placed anywhere in the chain.

Repro steps: Add any network filter in a chain after envoy.filters.network.golang

Note: If there are privacy concerns, sanitize the data prior to sharing.

Config:

Include the config used to configure Envoy.

# envoy demo with golang extension enabled
static_resources:
listeners:
- name: listener_0
address:
socket_address:
address: 0.0.0.0
port_value: 10000
filter_chains:
- filters:
- name: envoy.filters.network.golang
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.golang.v3alpha.Config
is_terminal_filter: false
library_id: simple
library_path: "/lib/simple.so"
plugin_name: simple
plugin_config:
"@type": type.googleapis.com/xds.type.v3.TypedStruct
value:
echo_server_addr: echo_service
- name: envoy.filters.network.tcp_proxy
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
stat_prefix: destination
cluster: cluster_0
clusters:
- name: plainText
type: ORIGINAL_DST
lb_policy: CLUSTER_PROVIDED
- name: cluster_0
connect_timeout: 30s
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
load_assignment:
cluster_name: cluster_0
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: localhost
port_value: 5000

Logs:

golang-network-proxy-1         | [2024-10-25 08:55:50.756][1][critical][main] [source/server/server.cc:412] error initializing config '  /etc/envoy.yaml': Error: terminal filter named envoy.filters.network.golang of type envoy.filters.network.golang must be the last filter in a network filter chain.
golang-network-proxy-1         | [2024-10-25 08:55:50.756][1][info][main] [source/server/server.cc:1050] exiting
golang-network-proxy-1         | Error: terminal filter named envoy.filters.network.golang of type envoy.filters.network.golang must be the last filter in a network filter chain.

Note: If there are privacy concerns, sanitize the data prior to sharing.

Call Stack:

If the Envoy binary is crashing, a call stack is required. Please refer to the Bazel Stack trace documentation.

doujiang24 commented 1 month ago

It's a known TODO, but we do not have much time to implement it yet. Please see: https://github.com/envoyproxy/envoy/issues/25906#issuecomment-1615117709

github-actions[bot] commented 2 days ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.