由于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

要解决此问题,请更新或删除受影响的配置文件中的无效属性。

  1. 打开受影响的配置文件,该文件通常位于以下位置:

    ui.config/src/main/content/jcr_root/apps/<project-name>/osgiconfig/config.<runmode>/
    有关更多详细信息,请参阅为Adobe Experience Manager as a Cloud Service配置OSGi

  2. 删除或更正无效属性。

    示例(更正属性)

    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中的环境变量。

  3. 通过Cloud Manager提交并重新部署更正后的配置。 有关更多详细信息,请参阅《AEM as a Cloud Service用户指南》中的部署到AEM as a Cloud Service

修复配置后,管道应成功执行。

其他说明

  • 在提交之前在本地验证JSON配置,使用诸如jsonlint或基于IDE的验证之类的工具。
  • 确保所有属性名称非空、唯一且键入正确。
  • 查看Cloud Manager中的AEM as a Cloud Service构建日志,以尽早检测配置问题。
  • 将配置放置在config.<runmode>文件夹(例如,config.authorconfig.publish)下,以保持配置特定于环境。
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f