由於OSGi設定屬性無效,AEM部署管道失敗
中繼和生產環境中的部署管道在執行一段時間後,會在 更新服務 子步驟期間失敗。 若要修正此問題,請更新或移除設定檔案中的空白機碼,然後透過Cloud Manager重新部署。
說明 description
環境
- Adobe Experience Manager (AEM) as a Cloud Service
- Cloud Manager CI/CD管道(中繼/生產)
- Sling功能啟動器
問題/症狀
- 部署管道失敗,並出現系統問題 訊息。
- 執行超過2小時之後,Update services子步驟中發生失敗。
原因
-
由於專案程式碼基底中的OSGi設定屬性無效,Sling功能啟動器無法初始化。
-
以下是OSGi設定檔案具有空白屬性索引鍵的範例,
code language-none { "scheduler.expression": "0 0 6 * * ?", "job.enabled": true, "": "notifications@example.com", "emailName": "System Reminder", "emailSubject": "Reminder", "emailMessage": "This is an automated reminder for your content." }
在啟動期間剖析設定時,空白屬性(「」)會導致AEM失敗,導致 更新服務 步驟中的管道錯誤。
解決方法 resolution
若要解決此問題,請更新或移除受影響設定檔案中的無效屬性。
-
開啟受影響的組態檔,通常可在下列位置找到:
ui.config/src/main/content/jcr_root/apps/<project-name>/osgiconfig/config.<runmode>/
如需詳細資訊,請參閱為Adobe Experience Manager as a Cloud Service設定OSGi。 -
移除或修正無效的屬性。
範例(更正屬性)
code language-none { "scheduler.expression": "0 0 6 * * ?", "job.enabled": true, "recipientEmail": "notifications@example.com", "emailName": "System Reminder", "emailSubject": "Reminder", "emailMessage": "This is an automated reminder for your content." }重要:請勿直接在OSGi設定檔中包含秘密、密碼、API金鑰或其他敏感資訊。 若要安全地管理敏感值,請在Cloud Manager中使用環境變數。
-
透過Cloud Manager認可並重新部署修正後的設定。 如需詳細資訊,請參閱AEM as a Cloud Service使用指南中的部署至AEM as a Cloud Service。
修正設定後,管道應會成功執行。
其他附註
- 使用如
jsonlint或基於IDE的驗證等工具,在認可之前在本機驗證JSON設定。 - 請確定所有屬性名稱不是空白、唯一且輸入正確。
- 在Cloud Manager中檢閱AEM as a Cloud Service組建記錄,以及早偵測設定問題。
- 將設定置於
config.<runmode>資料夾下(例如,config.author、config.publish),讓設定保持特定於環境。
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f