E:验证路由时出错。在暂存或生产部署期间出现yaml错误

本文为Adobe Commerce在云基础架构问题上的问题提供了一个解决方案,在该问题中,您会收到​ E:验证路由时出错。尝试将项目部署到暂存或生产环境时,出现 ​错误消息。

描述 description

受影响的环境

云基础架构上的Adobe Commerce,所有版本

问题/症状

重现步骤

通过将代码推送到暂存或生产环境来触发部署。

预期行为

部署成功。

实际行为

部署被阻止,日志中显示以下错误消息:

Deploying applications Verifying configuration E: Error while verifying routes.yaml.
The following domains are configured for your cluster, but have no routes defined in your routes.yaml file:

- store1.example.com
- store2.example.com
- test-store.example.com

With your current routes.yaml configuration,
    these domains would NOT be served!

In order to continue, please see here for instructions to troubleshoot:
    E: Error verifying routes.yaml error during Staging or Production deploy

原因

如果routes.yaml文件中缺少已添加到项目中的任何其他域的路由配置,则会出现此错误。

作为自助路由配置的Adobe Commerce自助启用升级的一部分,我们添加了部署前检查,以确保项目中的所有域已在routes.yaml文件中配置路由。 如果有任何域缺少路由配置,则会阻止部署。

解决方法 resolution

若要解决阻止的部署,请使用以下任一方法更新routes.yaml文件,以便为错误消息中列出的域配置路由:

  • 在升级过程中应用Adobe Commerce提供的修补程序。
  • 手动将缺少的路由配置添加到routes.yaml文件。

方法1:应用Adobe Commerce提供的修补程序

  1. 查找标题为“< project_ID> ​启用自助服务功能”的最新Adobe Commerce支持票证。
  2. 按照票证中的说明应用补丁程序,这会更新云环境的路由配置。
  3. 提交с并推送更改以重新部署项目。

方法2:手动添加缺少的路由配置

  1. 要使用相同的路由配置为项目中的所有域提供服务,请更新routes.yaml文件,为项目中的默认域和所有其他域添加路由模板,如以下示例所示:

    code language-none
    "http://{default}/":
        type: upstream
        upstream: "mymagento:http"
    "http://{all}/":
        type: upstream
        upstream: "mymagento:http"
    
  2. 提交с并推送更改以重新部署项目。

相关阅读

有关更新路由配置的详细说明,请参阅我们的开发人员文档中的Adobe Commerce云>配置路由

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f