排查 Azure 事件网格错误Troubleshoot Azure Event Grid errors

此故障排除指南提供以下信息:This troubleshooting guide provides you the following information:

  • Azure 事件网格错误代码Azure Event Grid error codes
  • 错误消息Error messages
  • 错误描述Descriptions for the errors
  • 收到这些错误时应采取的建议操作。Recommended actions that you should take when you receive these errors.

错误代码:400Error code: 400

错误代码Error code 错误消息Error message 说明Description 建议Recommendation
HttpStatusCode.BadRequestHttpStatusCode.BadRequest
400400
主题名称的长度必须为 3 到 50 个字符。Topic name must be between 3 and 50 characters in length. 自定义主题名称的长度应为 3 到 50 个字符。The custom topic name length should be between 3 and 50 characters in length. 主题名称中只允许字母数字字符、数字和“-”字符。Only alphanumeric letters, digits and the '-' character are allowed in the topic name. 此外,名称的开头不能是以下保留字:Also, the name shouldn't start with the following reserved words:
  • Microsoft-Microsoft-
  • EventGrid-EventGrid-
  • System-System-
请选择符合主题名称要求的其他主题名称。Choose a different topic name that adheres to the topic name requirements.
HttpStatusCode.BadRequestHttpStatusCode.BadRequest
400400
域名的长度必须为 3 到 50 个字符。Domain name must be between 3 and 50 characters in length. 域名的长度应为 3 到 50 个字符。The domain name length should be between 3 and 50 characters in length. 域名中只允许字母数字字符、数字和“-”字符。Only alphanumeric letters, digits and the '-' character are allowed in the domain name. 此外,名称的开头不能是以下保留字:Also, the name shouldn't start with the following reserved words:
  • Microsoft-Microsoft-
  • EventGrid-EventGrid-
  • System-System-
请选择符合域名要求的其他域名。Choose a different domain name that adheres to the domain name requirements.
HttpStatusCode.BadRequestHttpStatusCode.BadRequest
400400
过期时间无效。Invalid expiration time. 事件订阅的过期时间决定了事件订阅何时停用。The expiration time for the event subscription determines when the event subscription will retire. 此值应是将来的有效日期时间值。This value should be a valid DateTime value in the future. 确保事件订阅过期时间采用有效的日期时间格式,并设置为将来的时间。Make sure the Event Subscription expiration time in a valid DateTime format and it's set to be in the future.

错误代码:409Error code: 409

错误代码Error code 错误消息Error message 说明Description 建议的操作Recommended action
HttpStatusCode.ConflictHttpStatusCode.Conflict
409409
已存在具有指定名称的主题。Topic with the specified name already exists. 请选择其他主题名称。Choose a different topic name. 自定义主题名称在单个 Azure 区域中应保持唯一,以确保正常完成发布操作。The custom topic name should be unique in a single Azure region to ensure a correct publishing operation. 同一名称可在不同的 Azure 区域中使用。The same name can be used in different Azure regions. 请为主题选择其他名称。Choose a different name for the topic.
HttpStatusCode.ConflictHttpStatusCode.Conflict
409409
已存在具有指定名称的域。Domain with the specified already exists. 请选择其他域名。Choose a different domain name. 域名在单个 Azure 区域中应保持唯一,以确保正常完成发布操作。The domain name should be unique in a single Azure region to ensure a correct publishing operation. 同一名称可在不同的 Azure 区域中使用。The same name can be used in different Azure regions. 请为该域选择其他名称。Choose a different name for the domain.
HttpStatusCode.ConflictHttpStatusCode.Conflict
409409
已达配额限制。Quota limit reached. 有关这些限制的详细信息,请参阅 Azure 事件网格限制For more information on these limits, see Azure Event Grid limits. 每个 Azure 订阅可使用的 Azure 事件网格资源数量有限制。Each Azure subscription has a limit on the number of Azure Event Grid resources that it can use. 已超过部分或全部配额,无法创建更多的资源。Some or all of this quota had been exceeded and no more resources could be created. 请检查当前的资源用量,并删除任何不需要的资源。Check your current resources usage and delete any that aren't needed. 如果无法删除任何资源,请在该订阅中创建另一个 Azure 订阅并创建事件网格资源。If you can't delete any resources, create another Azure subscription and create Event Grid resources in that subscription.

错误代码:403Error code: 403

错误代码Error code 错误消息Error message 说明Description 建议的操作Recommended action
HttpStatusCode.ForbiddenHttpStatusCode.Forbidden
403403
由于 IpAddress 筛选规则,客户端 {IpAddress} 执行的向 {主题/域} 的发布被拒绝。Publishing to {Topic/Domain} by client {IpAddress} is rejected because of IpAddress filtering rules. 主题或域已配置 IP 防火墙规则,并且访问仅限于配置的 IP 地址。The topic or domain has IP firewall rules configured and access is restricted only to configured IP addresses.
HttpStatusCode.ForbiddenHttpStatusCode.Forbidden
403403
由于请求来自专用终结点,并且没有为资源找到匹配的专用终结点连接,客户端执行的向 {主题/域} 的发布被拒绝。Publishing to {Topic/Domain} by client is rejected as request came from Private Endpoint and no matching private endpoint connection found for the resource. 主题或域具有专用终结点,且发布请求来自未配置或批准的专用终结点。The topic or domain has private endpoints and publish request came from a private endpoint that's not configured or approved.

另外,请检查 Webhook 是否位于 Azure 应用程序网关或 Web 应用程序防火墙后面。Also, check if your webhook is behind an Azure Application Gateway or Web Application Firewall. 如果是这样,请禁用以下防火墙规则,并再次执行 HTTP POST:If it's, disable the following firewall rules and do an HTTP POST again:

  • 920300(请求缺少 Accept 标头)920300 (Request missing an accept header)
  • 942430(受限 SQL 字符异常情况检测 (args):已超出特殊字符数 (12))942430 (Restricted SQL character anomaly detection (args): # of special characters exceeded (12))
  • 920230(检测到多个 URL 编码)920230 (Multiple URL encoding detected)
  • 942130(SQL 注入攻击:检测到 SQL 同义反复。)942130 (SQL injection attack: SQL tautology detected.)
  • 931130(可能的远程文件包含 (RFI) 攻击 = 域外引用/链接)931130 (Possible remote file inclusion (RFI) attack = Off-domain reference/link)

后续步骤Next steps

如需更多帮助,请在 Stack Overflow 论坛中发布问题,或开具支持票证If you need more help, post your issue in the Stack Overflow forum or open a support ticket.