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提供的修補程式
- 尋找標題為「為
<project_ID>」啟用自助服務功能的最新Adobe Commerce支援票證。 - 依照票證中的指示套用修補程式,以更新雲端環境的路由設定。
- 提с交並推送變更以重新部署您的專案。
方法2:手動新增遺失的路由設定
-
若要使用相同的路由設定為您專案中的所有網域提供服務,請更新
routes.yaml檔案,新增預設網域和您專案上所有其他網域的路由範本,如下列範例所示:code language-none "http://{default}/": type: upstream upstream: "mymagento:http" "http://{all}/": type: upstream upstream: "mymagento:http" -
提с交並推送您的變更,以重新部署您的專案。
3d58f420-19b5-47a0-a122-5c9dab55ec7f