E: Error verifying routes.yaml error during Staging or Production deploy

This article provides a solution for the Adobe Commerce on cloud infrastructure issue, where you get the “E: Error while verifying routes.yaml” error message when trying to deploy the project to the Staging or Production environment.

Affected versions

  • Adobe Commerce on cloud infrastructure, all versions

Issue

Steps to reproduce:

Trigger a deploy by pushing the code to the Staging or Production environment.

Expected behavior:

Deployment is successful.

Actual behavior:

The deployment is blocked and the following error message is displayed in the log:

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:
 /help/troubleshooting/deployment/e-error-verifying-routes-yaml-error-during-staging-or-production-deploy.md

Cause

This error occurs if the route configuration for any additional domains that have been added to your project are missing from the routes.yaml file.

As part of the Adobe Commerce self-service enablement upgrade for self-service route configuration, we added a pre-deployment check to ensure that all domains in your project have routes configured in the routes.yaml file. If any domains are missing route configuration, the deployment gets blocked.

Solution

To resolve the blocked deployment, update the routes.yaml file to configure routes for the domains listed in the error message by using either of the following methods:

  • Apply the patch supplied by Adobe Commerce during the upgrade process.
  • Manually add the missing route configuration to the routes.yaml file.

Method 1: Apply the patch supplied by Adobe Commerce

  1. Look for a recent Adobe Commerce support ticket with the title "Enable self service features for <project_ID>".
  2. Follow the instructions in the ticket to apply the patch, which updates the route configuration for your cloud environment.
  3. Сommit and push the changes to redeploy your project.

Method 2: Manually add the missing route configuration

  1. To serve all domains in your project using the same route configuration, update the routes.yaml file adding route templates for the default domain and all other domains on your project as shown in the following example:

    code language-yaml
    "http://{default}/":
        type: upstream
        upstream: "mymagento:http"
    "http://{all}/":
        type: upstream
        upstream: "mymagento:http"
    
  2. Сommit and push your changes to redeploy your project.

For detailed instructions to update the route configuration, see Cloud for Adobe Commerce > Configure routes in our developer documentation.

NOTE
If your project configuration specifies domains that are no longer in use, complete the following steps to remove them from your project at your earliest convenience: 1. Submit a support ticket with a list of domains to remove from your project environments. 2. After the Support team removes the domains, update the routes.yaml file to remove any references to the obsolete domains.
recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a