Envoy 代理失败,并且适用于 Envoy 的 Apigee Adapter 中出现 HTTP 403 Forbidden 错误

您正在查看 Apigee Edge 文档。
转到 Apigee X 文档
info

问题

通过 Apigee Adapter for Envoy 调用时,Envoy 代理失败,并显示 HTTP 403 Forbidden 错误。

出错提示

系统会显示以下错误消息:

HTTP/1.1 403 Forbidden
content-length: 19
content-type: text/plain
date: Tue, 03 Nov 2020 00:20:10 GMT
server: istio-envoy

可能的原因

如果发生以下任一情况,Envoy 代理将引发 HTTP 403 错误:

原因 说明 适用的问题排查说明
API 产品未启用 API 产品未针对特定环境启用。 Edge 公有云和私有云用户
API 产品中缺少目标服务 URI 路径 目标服务的 URI 路径缺失或未添加到 API 资源下的 API 产品中。 Edge 公有云和私有云用户
API 产品中缺少主机名 客户端 API 请求中给定的主机名在 Apigee 远程服务目标下的 API 产品中缺失。 Edge 公有云和私有云用户
请求标头中缺少 API 密钥 API 密钥未在 x-api-key HTTP 标头中传递。 Edge 公有云和私有云用户
API 密钥无效 作为请求的一部分传递的 API 密钥无效。 Edge 公有云和私有云用户
Apigee Adapter for Envoy 无法与远程服务 API 代理通信 Apigee Adapter for Envoy 无法与远程服务 API 代理通信。 Edge 公有云和私有云用户
Envoy 代理无法与 Apigee Adapter for Envoy 通信 Envoy 代理无法与 Apigee Adapter for Envoy 通信 Edge 公有云和私有云用户

准备工作

  1. 验证您是否从 Envoy 代理收到 403 Forbidden 响应消息。例如:
    curl -i -H "x-api-key: $API_KEY" http://httpbin:8080/echo
    
    HTTP/1.1 403 Forbidden
    content-length: 19
    content-type: text/plain
    date: Tue, 12 Jan 2021 08:18:08 GMT
    server: envoy
    RBAC: access denied
  2. 启用调试日志:

    确保您已在 Apigee Adapter for Envoy 中启用调试日志,以捕获有关错误的更多详细信息。 如果未启用,请停止 Apigee Adapter for Envoy 并重新启动,使用以下命令启用调试日志 :

    apigee-remote-service-envoy -c config.yaml -l debug

原因:API 产品未启用

如果 Envoy 代理使用的特定 API 产品未在调用 API 调用的 特定环境中启用,则会发生此错误。

诊断

请执行以下步骤来诊断问题:

  1. 按照上述第 2 步中的说明启用调试日志。
  2. 检查 Apigee Adapter for Envoy 日志,并验证以下消息是否显示在 Authorizing request 部分下:
    product: API_PRODUCT_NAME not found

    调试日志输出示例

    2021-01-12T08:18:08.124Z        DEBUG   auth/auth.go:98 Authenticate: key: 7mQIG..., claims: map[string]interface {}(nil)
    2021-01-12T08:18:08.124Z        DEBUG   auth/verify_api_key.go:106      fetchToken fetching: 7mQIG...
    2021-01-12T08:18:08.589Z        DEBUG   auth/auth.go:125        using api key from request
    2021-01-12T08:18:08.589Z        DEBUG   auth/auth.go:157        Authenticate success: &auth.Context{Context:(*server.Handle
    r)(0xc0001a0600), ClientID:"7mQIG...", AccessToken:"", Application:"ENVOY-APP-1", APIProducts:[]string{"ENVOY-PRODUCT-1"},
    Expires:time.Time{wall:0x0, ext:63746037188, loc:(*time.Location)(0x14a3be0)}, DeveloperEmail:"[---masked---]", Scopes:[]
    string{""}, APIKey:"7mQIG..."}
    2021-01-12T08:18:08.589Z        DEBUG   product/manager.go:89
    Authorizing request:
      products: [ENVOY-PRODUCT-1]
      scopes: []
      operation: GET /echo
      target: httpbin:8080
      - product: ENVOY-PRODUCT-1
        not found

    上面的示例显示,在 Apigee Adapter for Envoy 中未找到 API 产品 ENVOY-PRODUCT-1

    如需详细了解 Apigee Adapter for Envoy 日志记录,请参阅 日志记录

  3. 如果您在授权 API 请求时看到此消息,则很可能表示 您在发出 API 调用的特定环境中未启用特定 API 产品。
  4. 请执行以下步骤进行验证:
    1. 登录 Edge 界面
    2. 发布 > API 产品 页面上,点击您用于配置 Apigee Adapter for Envoy 的特定 API 产品。
    3. 验证您发出 API 请求的特定环境是否已 在 API 产品中启用。
    4. 如果特定环境未在 API 产品中启用,则会导致此问题。
  5. 如果特定环境已启用,请转到 原因:API 产品中缺少目标服务 URI 路径

分辨率

如果特定环境未在 API 产品中启用,请执行以下步骤来 解决此问题:

  1. 登录 Edge 界面
  2. 发布 > API 产品 页面上,点击您用于配置 Apigee Adapter for Envoy 的特定 API 产品。
  3. API 产品 > 产品名称 页面上,点击修改
  4. 选中相关环境复选框,以启用您想要发出 API 请求的特定环境。
  5. 点击保存

原因:API 产品中缺少目标服务 URI 路径

如果未在 Envoy 代理使用的特定 API 产品中指定目标的 URI 路径,则会发生此错误。

诊断

请执行以下步骤来诊断问题:

  1. 按照上述第 2 步中的说明启用调试日志。
  2. 检查 Apigee Adapter for Envoy 日志,并验证以下消息是否 显示在与 Authorizing request 部分下的特定目标关联的特定 API 产品中:

    no path: REQUEST_URI_PATH

    调试日志输出示例

    2021-01-12T08:09:02.604Z        DEBUG   auth/auth.go:98 Authenticate: key: 7mQIG..., claims: map[string]interface {}(nil)
    2021-01-12T08:09:02.605Z        DEBUG   auth/auth.go:125        using api key from request
    2021-01-12T08:09:02.605Z        DEBUG   auth/auth.go:157        Authenticate success: &auth.Context{Context:(*server.Handle
    r)(0xc0001a4180), ClientID:"7mQIG...", AccessToken:"", Application:"ENVOY-APP-1", APIProducts:[]string{"ENVOY-PRODUCT-1"},
    Expires:time.Time{wall:0x0, ext:63746036507, loc:(*time.Location)(0x14a3be0)}, DeveloperEmail:"[---masked---]", Scopes:[]
    string{""}, APIKey:"7mQIG..."}
    2021-01-12T08:09:02.605Z        DEBUG   product/manager.go:89
    Authorizing request:
      products: [ENVOY-PRODUCT-1]
      scopes: []
      operation: GET /echo1
      target: httpbin:8080
      - product: ENVOY-PRODUCT-1
        no path: /echo1
    2021-01-12T08:09:02.605Z        DEBUG   server/authorization.go:228     sending ok (actual: PERMISSION_DENIED)

    示例输出显示以下消息:

    no path: /echo1

    这表示在 API 产品 ENVOY-PRODUCT-1中未找到路径/echo1

  3. 如果您在 Apigee Adapter for Envoy 调试日志中看到消息 no path: REQUEST_URI_PATH,则会导致此问题。如果不是,请转到 原因:API 产品中缺少主机名

分辨率

如果未将特定请求 URI 添加到特定目标的 API 产品中,则 执行以下步骤来解决此问题:

  1. 登录 Edge 界面
  2. 发布 > API 产品 页面上,点击您用于配置 Apigee Adapter for Envoy 的特定 API 产品。
  3. API 产品 > 产品名称 页面上,点击修改
  4. API 资源 窗格中,将 API 请求 URI 添加到 API 产品中。
  5. 监控 Apigee Adapter for Envoy 日志,并等待 Apigee Adapter for Envoy 提取更新后的 API 产品。之后,发送另一个 API 请求以验证修复。

原因:API 产品中缺少主机名

如果未将目标主机名和端口组合添加到 Envoy 代理使用的特定 API 产品中,则会发生此错误。

诊断

请执行以下步骤来诊断问题:

  1. 按照上述第 2 步中的说明启用调试日志。
  2. 检查 Apigee Adapter for Envoy 日志,并验证以下消息是否 显示在与 Authorizing request 部分下的特定目标关联的特定 API 产品中:

    no targets: HOSTNAME:PORT

    调试日志输出示例

    2021-01-12T08:12:06.019Z        DEBUG   auth/auth.go:98 Authenticate: key: 7mQIG..., claims: map[string]interface {}(nil)
    2021-01-12T08:12:06.019Z        DEBUG   auth/auth.go:125        using api key from request
    2021-01-12T08:12:06.019Z        DEBUG   auth/auth.go:157        Authenticate success: &auth.Context{Context:(*server.Handle
    r)(0xc0001a4180), ClientID:"7mQIG...", AccessToken:"", Application:"ENVOY-APP-1", APIProducts:[]string{"ENVOY-PRODUCT-1"},
    Expires:time.Time{wall:0x0, ext:63746036507, loc:(*time.Location)(0x14a3be0)}, DeveloperEmail:"[---masked---]", Scopes:[]
    string{""}, APIKey:"7mQIG..."}
    2021-01-12T08:12:06.019Z        DEBUG   product/manager.go:89
    Authorizing request:
      products: [ENVOY-PRODUCT-1]
      scopes: []
      operation: GET /echo
      target: httpbin1:8080
      - product: ENVOY-PRODUCT-1
        no targets: httpbin1:8080
    2021-01-12T08:12:06.020Z        DEBUG   server/authorization.go:228     sending ok (actual: PERMISSION_DENIED)

    上面的示例显示,在 API 产品 ENVOY-PRODUCT-1 中未找到主机名和端口组合 httpbin1:8080

  3. 如果在授权请求时,Apigee Adapter for Envoy 日志包含一条消息为 no targets: HOSTNAME:PORT 的条目,则会导致此 问题。如果不是,请转到 原因:请求标头中缺少 API 密钥

分辨率

如果未将目标主机名和端口组合添加到 API 产品中,请执行以下步骤来解决此问题:

  1. 登录 Edge 界面
  2. 发布 > API 产品 页面上,点击您用于配置 Apigee Adapter for Envoy 的特定 API 产品。
  3. API 产品 > 产品名称 页面上,点击修改
  4. Apigee 远程服务目标 窗格中,添加目标主机名和 端口,然后点击 保存

    如果您在界面中没有看到 Apigee 远程服务目标 部分,请使用 Edge API 向 API 产品添加一个自定义属性,名称为 apigee-remote-service-targets,并添加 HOSTNAME:PORT 值。例如:

    curl https://api.enterprise.apigee.com/v1/organizations/$ORG/apiproducts/$ENVOY_PRODUCT \
        -X GET \
        -H "Authorization: Bearer $ACCESS_TOKEN" \
        -H "Content-Type:application/json" \
        -d \
    {
        "apiResources": [
            "/echo",
            "/verifyApiKey"
        ],
        "approvalType": "auto",
        "attributes": [
            {
                "name": "access",
                "value": "public"
            },
            {
                "name": "apigee-remote-service-targets",
                "value": "localhost:8080"
            }
        ],
        "createdAt": 1610435989556,
        "createdBy": "---masked---",
        "description": "",
        "displayName": "ENVOY-PRODUCT-1",
        "environments": [
            "test"
        ],
        "lastModifiedAt": 1612234134060,
        "lastModifiedBy": "---masked---",
        "name": "ENVOY-PRODUCT-1",
        "proxies": [
            "remote-service"
        ],
        "scopes": []
    }
  5. 完成上述任务后,监控 Apigee Adapter for Envoy 日志,并等待直到 Apigee Adapter for Envoy 提取更新后的 API 产品。之后,发送另一个 API 请求以验证修复。

原因:请求标头中缺少 API 密钥

如果 API 密钥未作为请求标头的一部分传递,则会发生此错误。

诊断

请执行以下步骤来诊断问题:

  1. 按照上述第 2 步中的说明启用调试日志。
  2. 检查 Apigee Adapter for Envoy 日志,并验证您是否在 Authenticate error 部分下看到 [missing authentication] 消息。

    调试日志输出示例

    2021-01-12T08:20:31.461Z        DEBUG   auth/auth.go:98 Authenticate: key: , claims: map[string]interface {}(nil)
    2021-01-12T08:20:31.461Z        DEBUG   auth/auth.go:159
    Authenticate error: &auth.Context{Context:(*server.Handler)
    (0xc0001a0600), ClientID:"", AccessToken:"", Application:"", APIProducts:[]string(nil), Expires:time.Time{wall:0x0, ext:0,
    loc:(*time.Location)(nil)}, DeveloperEmail:"", Scopes:[]string(nil), APIKey:""} [missing authentication]
    2021-01-12T08:20:31.461Z        DEBUG   server/authorization.go:205     sending denied: UNAUTHENTICATED
    2021-01-12T08:20:32.448Z        DEBUG   server/header_context.go:68     No context header x-apigee-api, using target header
    : :authority

    上面显示的示例输出包含消息 [missing authentication]。 此消息表示 API 密钥未作为 请求标头的一部分传递。

  3. 如果 Apigee Adapter for Envoy 日志在 Authenticate error 部分下包含一条消息为 [missing authentication] 的日志条目,则会导致此问题。如果不是,请转到 原因:API 密钥无效

分辨率

如果在 Apigee Adapter for Envoy 日志中显示错误 [missing authentication],请执行以下步骤来解决此问题:

  1. 检查客户端是否已在 API 请求中使用 HTTP 标头 x-api-key 在 发送 API 密钥。如果不是,请请求客户端在 HTTP 标头 x-api-key 中发送 API 密钥。
  2. 检查 Apigee Adapter for Envoy 配置文件,并验证默认 API 密钥 标头名称 x-api-key 是否已更改,例如:
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: apigee-remote-service-envoy
      namespace: apigee
    data:
      config.yaml: |
        global:
          tls:
            ...
        tenant:
          ...
        auth:
          target_header: api-key

    在上面的示例中,默认 API 密钥标头名称已修改为 api-key。在这种情况下,您需要将 API 密钥作为标头 api-key 的一部分传递。

  3. 如果默认 API 密钥标头名称已更改,请请求客户端使用更新后的 API 密钥标头名称,然后发送另一个 API 请求,并验证是否解决了问题。

原因:API 密钥无效

如果无效 API 密钥作为请求标头的一部分传递,则会发生此错误。

诊断

请执行以下步骤来诊断问题:

  1. 按照上述第 2 步中的说明启用调试日志。
  2. 检查 Apigee Adapter for Envoy 日志,并验证您是否在 Authenticate error 部分下看到消息 [permission denied] 。 通常,在适配器提取 API 密钥后会显示此消息,该消息由 消息 fetchToken fetching: API_KEY 指示。

    调试日志输出示例

    2021-01-12T05:01:07.198Z        DEBUG   auth/auth.go:98 Authenticate: key: 123, claims: map[string]interface {}(nil)
    2021-01-12T05:01:07.198Z        DEBUG   auth/verify_api_key.go:106      fetchToken fetching: API_KEY
    2021-01-12T05:01:09.102Z        DEBUG   server/header_context.go:68     No context header x-apigee-api, using target header: :authority
    2021-01-12T05:01:09.831Z        DEBUG   auth/auth.go:159        Authenticate error: &auth.Context{Context:(*server.Handler)(0xc0001640c0), ClientID:"", AccessToken:"", Application:"", APIProducts:[]string(nil), Expires:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}, DeveloperEmail:"", Scopes:[]string(nil), APIKey:""} [permission denied]
    2021-01-12T05:01:09.832Z        DEBUG   server/authorization.go:228     sending ok (actual: PERMISSION_DENIED)

    在此示例中,API 请求中发送的 API 密钥无效。

  3. 如果 Apigee Adapter for Envoy 日志在 Authenticate error 部分下包含一条带有 [permission denied] 的日志条目,则表示 作为请求的一部分传递的 API 密钥无效,并且会导致此问题。 如果不是,请转到 原因:Apigee Adapter for Envoy 无法与远程服务 API 代理通信

分辨率

如果在 Apigee Adapter for Envoy 日志的 Authenticate error 部分下观察到消息 [permission denied],请执行以下步骤 来解决此问题:

  1. 根据连接到 API 产品的应用中找到的 API 密钥值检查 API 请求中发送的 API 密钥。
  2. 如果客户端使用的 API 密钥无效,请请求客户端发送有效的 API 密钥。
  3. 如果客户端使用的 API 密钥有效,但您仍然看到 HTTP 403 错误,请与 Apigee Edge Support 联系以进一步调查。

原因:Apigee Adapter for Envoy 无法与远程服务 API 代理通信

如果配置的远程服务主机无效,Apigee Adapter for Envoy 无法与远程 服务 API 代理通信,则会发生此错误。

诊断

请执行以下步骤来诊断问题:

  1. 按照上述第 2 步中的说明启用调试日志。
  2. 检查 Apigee Adapter for Envoy 日志,并验证您是否看到以下消息:

    Error retrieving products: REQUEST_URI: no such host

    调试日志输出示例

    2021-01-12T08:29:06.499Z        DEBUG   product/manager.go:188  retrieving products from: https://foo/remote-service/products
    2021-01-12T08:29:06.505Z        ERROR   product/manager.go:164  Error retrieving products: GET "https://foo/remote-service/pro
    ducts": dial tcp: lookup foo on 169.254.169.254:53: no such host
    github.com/apigee/apigee-remote-service-golib/product.(*manager).start.func1
            /go/pkg/mod/github.com/apigee/apigee-remote-service-golib@v1.4.0/product/manager.go:164
    github.com/apigee/apigee-remote-service-golib/util.(*Looper).Run
            /go/pkg/mod/github.com/apigee/apigee-remote-service-golib@v1.4.0/util/looper.go:87
    github.com/apigee/apigee-remote-service-golib/util.(*Looper).Start.func1
            /go/pkg/mod/github.com/apigee/apigee-remote-service-golib@v1.4.0/util/looper.go:59

    在此示例中,Apigee Adapter for Envoy 无法与 远程服务 API 代理通信,因为远程服务器 API 代理 网址中提供的主机名无效,如错误 no such host 所示。

  3. 如果 Apigee Adapter for Envoy 日志包含一条消息为 no such host 的日志条目,则会导致此问题。如果不是,请转到 原因:Envoy 代理无法与 Apigee Adapter for Envoy 通信

分辨率

如果在 Apigee Adapter for Envoy 日志中显示上述错误,请执行以下 步骤来解决此问题:

  1. 检查 Apigee Adapter for Envoy 配置文件,并验证给定的 远程服务 API 代理网址是否有效。

    如果不是,请停止 Apigee Adapter for Envoy,修复配置文件中的远程服务 API 代理网址,启动 Apigee Adapter for Envoy,然后发送另一个 API 请求并验证修复。

    配置示例

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: apigee-remote-service-envoy
      namespace: apigee
    data:
      config.yaml: |
        tenant:
          internal_api: https://istioservices.apigee.net/edgemicro
          remote_service_api: https://ORG-ENV.apigee.net/remote-service
          org_name: ORG
          env_name: ENV
          key: KEY
          secret: SECRET
          
  2. 验证 remote-service API 代理是否部署在相关的 Edge 环境中。如果不是,请在相关的 Edge 环境中部署 remote-service API 代理,然后重试。
  3. 验证 Apigee Adapter for Envoy 与 remote-service API 代理端点之间的网络连接。如果发现任何网络连接 问题,请与您的网络团队联系并尝试解决问题。

原因:Envoy 代理无法与 Apigee Adapter for Envoy 通信

诊断

请执行以下步骤来诊断问题:

  1. 确保您已在 Envoy 中启用调试日志。如果未启用,请停止 Envoy 并重新启动, 启用调试日志。然后发送另一个 API 请求。

    独立部署

    envoy -c envoy-config.yaml -l debug

    基于 Kubernetes/Istio 的部署

    kubectl -n=istio-system get pods
    kubectl -n=istio-system exec -it INGRESS_GATEWAY_NAME bash -- curl -X POST localhost:15000/logging?connection=debug
  2. 检查 Apigee Adapter for Envoy 日志,并验证是否存在一条消息为以下内容的日志条目:
    connecting to APIGEE_ENVOY_ADAPTER_HOST:5000

    然后是:

    upstream connect error or disconnect/reset before headers. reset reason: ACTUAL_REASON

    调试日志输出示例

    [2021-03-23 05:44:41.867][1303661][debug][connection] [external/envoy/source/common/network/connection_impl.cc:769] [C4] connecting to 127.0.0.1:5000
    [2021-03-23 05:44:41.867][1303661][debug][connection] [external/envoy/source/common/network/connection_impl.cc:785] [C4] connection in progress
    [2021-03-23 05:44:41.868][1303661][debug][http2] [external/envoy/source/common/http/http2/codec_impl.cc:1173] [C4] updating connection-level initial window size to 268435456
    [2021-03-23 05:44:41.869][1303661][debug][connection] [external/envoy/source/common/network/connection_impl.cc:634] [C4] delayed connection error: 111
    [2021-03-23 05:44:41.869][1303661][debug][connection] [external/envoy/source/common/network/connection_impl.cc:203] [C4] closing socket: 0
    [2021-03-23 05:44:41.869][1303661][debug][client] [external/envoy/source/common/http/codec_client.cc:96] [C4] disconnect. resetting 0 pending requests
    [2021-03-23 05:44:41.869][1303661][debug][pool] [external/envoy/source/common/conn_pool/conn_pool_base.cc:314] [C4] client disconnected, failure reason:
    [2021-03-23 05:44:41.869][1303661][debug][router] [external/envoy/source/common/router/router.cc:1031] [C0][S6149963213555558594] upstream reset: reset reason: connection failure, transport failure reason:
    [2021-03-23 05:44:41.869][1303661][debug][http] [external/envoy/source/common/http/async_client_impl.cc:100] async http request response headers (end_stream=true):
    ':status', '200'
    'content-type', 'application/grpc'
    'grpc-status', '14'
    'grpc-message', 'upstream connect error or disconnect/reset before headers. reset reason: connection failure'

    上面的示例显示,Envoy 无法与 Apigee Adapter for Envoy 通信,原因是 connection failure

  3. connection failure 可能有多种原因。 我们来看看每种情形。

情形 1:适配器进程未运行

如果 Apigee Adapter for Envoy 进程未运行,则可能会发生此错误。

  1. 执行以下命令,验证 Apigee Adapter for Envoy 进程是否正在运行。如果 Apigee Adapter for Envoy 进程正在运行,则以下 命令的结果应列出该进程。
    ps -ef | grep apigee-remote-service-envoy
  2. 如果未运行,则会导致此问题。

分辨率

  1. 如果 Apigee Adapter for Envoy 进程未运行,请启动 Apigee Adapter for Envoy。
  2. 发出另一个 API 请求,并验证问题是否已修复。

情形 2:适配器进程未监听特定端口

如果 Apigee Adapter for Envoy 进程未监听特定端口, 则可能会发生此错误。

如果 Apigee Adapter for Envoy 进程正在运行,请验证是否存在监听端口 5000 的套接字:APIGEE_ENVOY_ADAPTER_HOST:5000。您可以运行 netstat 命令来验证这一点:

sudo netstat -lnp | grep 5000

示例输出

sudo netstat -lnp | grep 5000

tcp6       0      0 :::5000                 :::*                    LISTEN      1596530/./apigee-re

如果没有套接字监听端口 5000,则可能是导致此问题的原因。

分辨率

  1. 停止 Apigee Adapter for Envoy 并重新启动。
  2. 发出另一个 API 请求,并验证问题是否已修复。

情形 3:Envoy 和 Apigee Adapter for Envoy 之间的网络连接

  1. 验证 Envoy 和 Apigee Adapter for Envoy 之间的网络连接:
    ssh $ENVOY_HOST
    telnet $APIGEE_ENVOY_ADAPTER_HOST 5000

    如果 telnet 可以与 Apigee Adapter for Envoy 建立 TCP 连接,则会显示类似如下所示的输出:

    telnet $APIGEE_ENVOY_ADAPTER_HOST 5000
    
    Trying ::1...
    Connected to localhost.
    Escape character is '^]'.
  2. 如果您使用 telnet 观察到错误 Connection timed out,则表示 Envoy 和 Apigee Adapter for Envoy 之间存在网络连接问题。

分辨率

如果您发现 Envoy 和 Apigee Adapter for Envoy 之间存在任何网络连接问题,请 与您的网络团队联系并尝试解决问题。

如果问题仍然存在,请转到 必须收集的诊断信息

必须收集的诊断信息

如果按照上述说明操作后问题仍然存在,请收集以下诊断 信息,然后与 Apigee Edge 支持团队联系:

  1. 使用的 Apigee 产品:

    示例: Apigee Edge Cloud、Apigee OPDK、Apigee Hybrid、Apigee X

  2. Apigee 组织和环境
  3. 使用 Edge API 读取的 API 产品定义:

    curl -i -u $USER:$PASSWORD $MANAGEMENT_SERVER_ENDPOINT/v1/organizations/$ORGANIZATION/apiproducts/$API_PRODUCT

    参考文档Apigee Edge API

  4. 使用 Apigee Edge 界面在 remote-service API 代理中启动跟踪会话。重现此问题并分享跟踪会话 XML 文件。

    参考文档 使用跟踪工具 | Apigee Edge

  5. Apigee Adapter for Envoy 日志(与给定时间段相关的完整日志)

    独立部署

    # by default Apigee Envoy write logs to stdout and stderr, check your deployment configuration and collect logs accordingly

    基于 Kubernetes/Istio 的部署

    kubectl -n=apigee get pods
    kubectl -n=apigee logs APIGEE_REMOTE_SERVICE_ENVOY_POD_NAME > apigee-remote-service-envoy.log
  6. 使用 curl 命令发送到 Envoy 代理的 API 请求 (curl 命令的完整输出):
    curl -v ENVOY_PROXY_ENDPOINT
  7. 使用 curl 命令发送到目标服务的 API 请求(curl 命令的完整输出):
    curl -v TARGET_SERVICE_ENDPOINT