gpt4 book ai didi

envoyproxy - 特使配置解析错误 INVALID_ARGUMENT :Unexpected token

转载 作者:行者123 更新时间:2023-12-02 00:50:16 26 4
gpt4 key购买 nike

我试图从特使文档中设置一个基本的特使代理(使用 Docker),但我不断收到如下解析错误:

[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:238] initializing epoch 0 (hot restart version=11.104)
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:240] statically linked extensions:
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:242] access_loggers: envoy.file_access_log,envoy.http_grpc_access_log
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:245] filters.http: envoy.buffer,envoy.cors,envoy.csrf,envoy.ext_authz,envoy.fault,envoy.filters.http.dynamic_forward_proxy,envoy.filters.http.grpc_http1_reverse_bridge,envoy.filters.http.header_to_metadata,envoy.filters.http.jwt_authn,envoy.filters.http.original_src,envoy.filters.http.rbac,envoy.filters.http.tap,envoy.grpc_http1_bridge,envoy.grpc_json_transcoder,envoy.grpc_web,envoy.gzip,envoy.health_check,envoy.http_dynamo_filter,envoy.ip_tagging,envoy.lua,envoy.rate_limit,envoy.router,envoy.squash
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:248] filters.listener: envoy.listener.original_dst,envoy.listener.original_src,envoy.listener.proxy_protocol,envoy.listener.tls_inspector
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:251] filters.network: envoy.client_ssl_auth,envoy.echo,envoy.ext_authz,envoy.filters.network.dubbo_proxy,envoy.filters.network.mysql_proxy,envoy.filters.network.rbac,envoy.filters.network.sni_cluster,envoy.filters.network.thrift_proxy,envoy.filters.network.zookeeper_proxy,envoy.http_connection_manager,envoy.mongo_proxy,envoy.ratelimit,envoy.redis_proxy,envoy.tcp_proxy
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:253] stat_sinks: envoy.dog_statsd,envoy.metrics_service,envoy.stat_sinks.hystrix,envoy.statsd
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:255] tracers: envoy.dynamic.ot,envoy.lightstep,envoy.tracers.datadog,envoy.tracers.opencensus,envoy.zipkin
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:258] transport_sockets.downstream: envoy.transport_sockets.alts,envoy.transport_sockets.tap,raw_buffer,tls
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:261] transport_sockets.upstream: envoy.transport_sockets.alts,envoy.transport_sockets.tap,raw_buffer,tls
[2019-09-30 11:16:05.313][1][info][main] [source/server/server.cc:267] buffer implementation: old (libevent)
[2019-09-30 11:16:05.318][1][critical][main] [source/server/server.cc:93] error initializing configuration '/etc/envoy/envoy.yml': Unable to parse JSON as proto (INVALID_ARGUMENT:Unexpected token.
admin:
access_log
^): admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 127.0.0.1, port_value: 9901 }

static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 127.0.0.1, port_value: 10000 }
filter_chains:
- filters:

正如您所看到的,它是 JSON to Proto 解析错误,但是我不知道我从网站上的文档中偏离了哪里。除非文档已经过时!下面是我的 envoy.yml 文件:
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 127.0.0.1, port_value: 9901 }

static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 127.0.0.1, port_value: 10000 }
filter_chains:
- filters:
- name: envoy.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
stat_prefix: ingress_http
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match: { prefix: "/" }
route: { cluster: some_service }
http_filters:
- name: envoy.router
clusters:
- name: some_service
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: some_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 1234

这是我的 docker-compose 文件的特使部分:
 envoy:
image: envoyproxy/envoy:v1.11.1
command: /usr/local/bin/envoy -c /etc/envoy/envoy.yml -l debug --service-cluster proxy
container_name: envoy
ports:
- 8070:12000
volumes:
- ./scripts/envoy/envoy.yml:/etc/envoy/envoy.yml
networks:
- mongo-cluster

最佳答案

发现问题了,我太傻了,我知道我一定是傻了,但直到我发布问题才弄明白,哈哈。

问题与我的 yaml 文件扩展名有关。我使用的是 .YML 而不是 .YAML
我不知道为什么 VS Code 会识别出让我失望的扩展。

关于envoyproxy - 特使配置解析错误 INVALID_ARGUMENT :Unexpected token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58167174/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com