# ELB Gateway异常排查
#### Gateway 、ListenerSet异常排查
#### 查看Gateway的事件确定原因
查看Gateway事件：
![](https://support.huaweicloud.com/usermanual-cce/zh-cn_image_0000002760177748.png "点击放大")
异常原因请参考下表：
| 异常信息                                                                                                                                                                                                | 原因       | 解决方案            |
|:---|:---|:---|
| failed to create ELB: create ELB: status_code: 409, resp_body: {"error_msg":"Quota exceeded for resources: loadbalancer","error_code":"ELB.8905","request_id":"b89cae6e534af5e6f17333c4b03b6444"} | ELB配额不足 | 使用已有ELB或扩充ELB配额 |
   
#### 查看ListenerSet异常原因
查看ListenerSet状态：
1. 进入自定义资源 ![](https://support.huaweicloud.com/usermanual-cce/zh-cn_image_0000002760184572.png "点击放大")
   
2. 查看ListenerSet资源 ![](https://support.huaweicloud.com/usermanual-cce/zh-cn_image_0000002789583427.png "点击放大")
   
3. 搜索ListenerSet名称，查看ListenerSet状态 ![](https://support.huaweicloud.com/usermanual-cce/zh-cn_image_0000002760184738.png "点击放大")
   
异常原因请参考下表：
| 异常信息                                       | 原因                                         | 排查方法                                                                                                                                                                    |
|:---|:---|:---|
| parent Gateway not found or not allowed | ListenerSet指定的Gateway不存在或不允许该ListenerSet挂载 | 查询Gateway是否存在 查看Gateway是否允许该命名空间的ListenerSet挂载，参考[Gateway与ListenerSet参数配置](https://support.huaweicloud.com/usermanual-cce/cce_10_1179.html)。 |
   
#### Gateway、ListenerSet无异常时查看监听器事件确认异常
- Gateway查看监听器事件 进入Gateway详情页面，查看lsconfig状态或事件确认异常原因。
  ![](https://support.huaweicloud.com/usermanual-cce/zh-cn_image_0000002760185732.png "点击放大")
  
- ListenerSet查看监听器事件
  1. 查询关联的lsconfig名称，详见[查询关联的lsconfig资源名称](https://support.huaweicloud.com/usermanual-cce/cce_10_1183.html#cce_10_1183__section115102529263)。
  
  2. 查询lsconfig的状态和事件确认异常原因。
     ```
     kubectl describe lsconfig -n <namespace> <name>
     ```
     参数说明：
     - \<namespace\>： ListenerSet所在的命名空间。
     
     - \<name\>：lsconfig的名称。
      
   
异常原因请参考下表：
| 异常信息                                                                                                                                                                                                                        | 原因               | 处理方法                                                                                                       |
|:---|:---|:---|
| defaultServerCertificate is required for HTTPS protocol listener                                                                                                                                                           | HTTPS监听器没有配置服务器证书 | 编辑lsconfig，添加服务器证书，参考[监听器参数配置（lsconfig）](https://support.huaweicloud.com/usermanual-cce/cce_10_1183.html)。 |
| create listener for ELB 7c76a669-cf7e-43cf-8bf3-924be3a79dd7: status_code: 409, resp_body: {"error_msg":"Quota exceeded for resources: listener","error_code":"ELB.8905","request_id":"27ab3ccdb9396f31a8d9a6d0fe3278f3"} | 监听器配额不足           | 扩充监听器配额                                                                                                   |
   
#### HTTPRoute异常排查
#### 转发策略创建、更新失败，查看HTTPRoute事件
查看HTTPRoute事件：
![](https://support.huaweicloud.com/usermanual-cce/zh-cn_image_0000002760347306.png "点击放大")
异常原因请参考下表：
| 异常信息                                                                             | 原因                         | 处理方法                                                                                                                                                                                                                                                                                                                                                                                                                       |
|:---|:---|:---|
| policy reconcile errors: rule 0: duplicate PATH match rule (at most 1 is allowed) | 转发策略配置错误，一个rule下只能配置一个path | - 如果需要一条转发策略配置多个服务器组，参考[多后端加权分发](https://support.huaweicloud.com/usermanual-cce/cce_10_1181.html#cce_10_1181__section121141112926)。  - 如果需要HTTPRoute下配置多条转发策略，参考[HTTPRoute配置多个转发规则](https://support.huaweicloud.com/usermanual-cce/cce_10_1181.html#cce_10_1181__section15304037164019)。   |
   
#### 后端服务器组、后端服务器异常，查看poolconfig事件
进入HTTPRoute详情界面，进入路由规则界面，查看Service对应的poolconfig的事件。
![](https://support.huaweicloud.com/usermanual-cce/zh-cn_image_0000002760347598.png "点击放大")
异常原因请参考下表：
| 异常信息                                                                                                                                                                                                                                                                                                                                                                                                             | 原因                              | 处理方法                                                                          |
|:---|:---|:---|
| no matching ServicePort, skipping member sync                                                                                                                                                                                                                                                                                                                                                                    | HTTPRoute中的Service端口配置错误       | 核对并修改HTTPRoute的端口配置，确保其backendRefs\[\].port与对应Service的暴露端口完全一致。                |
| failed to sync members: sync members for pool 587aebfc-68e1-4387-b2ee-b133959a6ea0: create members : failed to create member in pool 587aebfc-68e1-4387-b2ee-b133959a6ea0: status_code: 400, resp_body: {"error_msg":"Loadbalancers \[465b58ba-3ee3-49d0-94b8-594cc6cae8df\] ip_target_enable must be true when an ip member is added","error_code":"ELB.8939","request_id":"29a3616352a03a39518cb6a30c4511bf"} | poolconfig中开启了ipTarget，但ELB没有开启 | 在ELB控制台中找到对应的负载均衡器，**开启 IP Target（IP 类型后端）功能** ；或者在poolconfig中关闭**IP Target**。 |
   
