Uploaded image for project: 'FlightPath'
  1. FlightPath
  2. FLPATH-2156

[m5] notifications email plugin has incorrect configuration in dynamic plugins cm

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Description of the problem:
      When deploying the orchestrator operator v1.5.0-2025-03-03, if you create the orchestrator CR and fill out the notification plugin section :

          rhdh:
            devMode: true
            installOperator: true
            name: backstage
            namespace: rhdh
            plugins:
              notificationsEmail:
                enabled: true
                port: 25
                replyTo: gharden@redhat.com
                sender: gharden@redhat.com 

      It propagates to the automatically generated dynamic plugins CR as:

            - package: ./dynamic-plugins/dist/backstage-plugin-notifications-backend-module-email-dynamic
              disabled: false
              pluginConfig:
                notifications:
                  processors:
                    email:
                      transportConfig:
                        transport: smtp
                        hostname: ${NOTIFICATIONS_EMAIL_HOSTNAME}
                        port: 25
                        secure: false
                        username: ${NOTIFICATIONS_EMAIL_USERNAME}
                        password: NOTIFICATIONS_EMAIL_PASSWORD
                        sender: gharden@redhat.com
                        replyTo: gharden@redhat.com
                      broadcastConfig:
                        receiver: "none"
                      concurrencyLimit: 10
                      cache:
                        ttl:
                          days: 1
       

      This configuration causes the backstage pod deployment to fail and be stuck in CLBO, with:

                        throw new errors.ForwardedError(
                              ^ForwardedError: Module 'email' for plugin 'notifications' startup failed; caused by Error: Missing required config value at 'notifications.processors.email.sender' in 'app-config.dynamic-plugins.yaml'
          at /opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:228:25
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async /opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:227:17
          at async processNode (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:170:22)
          ... 7 lines matching cause stack trace ...
          at async BackstageBackend.start (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackstageBackend.cjs.js:19:5) {
        cause: Error: Missing required config value at 'notifications.processors.email.sender' in 'app-config.dynamic-plugins.yaml'
            at ConfigReader.getString (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/config/dist/reader.cjs.js:270:13)
            at ObservableConfigProxy.getString (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/config-loader/dist/sources/ObservableConfigProxy.cjs.js:109:30)
            at new NotificationsEmailProcessor (/opt/app-root/src/dynamic-plugins-root/backstage-plugin-notifications-backend-module-email-dynamic-0.3.4/node_modules/@backstage/plugin-notifications-backend-module-email/dist/processor/NotificationsEmailProcessor.cjs.js:32:40)
            at Object.init [as func] (/opt/app-root/src/dynamic-plugins-root/backstage-plugin-notifications-backend-module-email-dynamic-0.3.4/node_modules/@backstage/plugin-notifications-backend-module-email/dist/module.cjs.js:33:11)
            at /opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:227:39
            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
            at async processNode (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:170:22)
            at async Promise.all (index 0)
            at async processMoreNodes (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:165:7)
            at async DependencyGraph.parallelTopologicalTraversal (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/lib/DependencyGraph.cjs.js:176:5)
            at async /opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:220:13
            at async Promise.allSettled (index 13)
            at async #doStart (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:195:21)
            at async BackendInitializer.start (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackendInitializer.cjs.js:120:5)
            at async BackstageBackend.start (/opt/app-root/src/node_modules/@backstage/backend-defaults/node_modules/@backstage/backend-app-api/dist/wiring/BackstageBackend.cjs.js:19:5)
      }
       

      Fixing the dynamic plugins CM to be (i.e., moving the sender and replyTo sections up a level):

            - package: ./dynamic-plugins/dist/backstage-plugin-notifications-backend-module-email-dynamic
              disabled: false
              pluginConfig:
                notifications:
                  processors:
                    email:
                      transportConfig:
                        transport: smtp
                        hostname: ${NOTIFICATIONS_EMAIL_HOSTNAME}
                        port: 25
                        secure: false
                        username: ${NOTIFICATIONS_EMAIL_USERNAME}
                        password: NOTIFICATIONS_EMAIL_PASSWORD
                      sender: gharden@redhat.com
                      replyTo: gharden@redhat.com
                      broadcastConfig:
                        receiver: "none"
                      concurrencyLimit: 10
                      cache:
                        ttl:
                          days: 1
       

      fixed the issue and allowed the backstage pod to roll out normally.

      How reproducible: %

      Steps to reproduce:

      1. See above.

      Actual results: Backstage pod fails to roll out

      Expected results: CM should be configured as above and backstage pod should deploy normally.

              jubah@redhat.com Jennifer Ubah
              yfirst Yona First
              Yona First Yona First
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: