Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-1988

NODE_TLS_REJECT_UNAUTHORIZED should also apply to the backstage init container

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Undefined Undefined
    • None
    • 1.7.0
    • Operator
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Known Issue
    • Low

      Description of problem:

      I've added NODE_TLS_REJECT_UNAUTHORIZED to the backstage resource in an RHDH operator deployment in order to install dynamic plugins from a server with a self signed cert, but it is not taking. The env var is only getting added to the backstage deployment main container and not the init container.

      The purpose of this would be for a dev/test env only, obviously not prod. 

      Prerequisites (if any, like setup, operators/versions):

      Just RHDH operator 1.7

      Steps to Reproduce

      • deploy rhdh operator 1.7
      • include NODE_TLS_REJECT_UNAUTHORIZED: 0 in the backstage resource (example below) 
      • Add packages to dynamic plugins cm that are hosted by a self signed unsecure host - eg:

       

            package: "https://indy.corp.redhat.com/api/content/npm/hosted/pnc-builds/@redhat/backstage-plugin-orchestrator-backend-dynamic/-/backstage-plugin-orchestrator-backend-dynamic-1.7.1-rc.1.tgz"
            package: "https://indy.corp.redhat.com/api/content/npm/hosted/pnc-builds/@redhat/backstage-plugin-orchestrator/-/backstage-plugin-orchestrator-1.7.1-rc.1.tgz"
            package: "https://indy.corp.redhat.com/api/content/npm/hosted/pnc-builds/@redhat/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic/-/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic-1.7.1-rc.1.tgz"
            package: "https://indy.corp.redhat.com/api/content/npm/hosted/pnc-builds/@redhat/backstage-plugin-orchestrator-form-widgets/-/backstage-plugin-orchestrator-form-widgets-1.7.1-rc.1.tgz"
       

       

       

      Actual results:

      Fails with

      Traceback (most recent call last):
        File "/opt/app-root/src/install-dynamic-plugins.py", line 527, in <module>
          main()
        File "/opt/app-root/src/install-dynamic-plugins.py", line 443, in main
          raise InstallException(f'Error while installing plugin { package } with \'npm pack\' : ' + completed.stderr.decode('utf-8'))
      InstallException: Error while installing plugin https://indy.corp.redhat.com/api/content/npm/hosted/pnc-builds/@redhat/backstage-plugin-orchestrator-backend-dynamic/-/backstage-plugin-orchestrator-backend-dynamic-1.7.1-rc.1.tgz with 'npm pack' : npm error code SELF_SIGNED_CERT_IN_CHAIN
      npm error errno SELF_SIGNED_CERT_IN_CHAIN
      npm error request to https://indy.corp.redhat.com/api/content/npm/hosted/pnc-builds/@redhat/backstage-plugin-orchestrator-backend-dynamic/-/backstage-plugin-orchestrator-backend-dynamic-1.7.1-rc.1.tgz failed, reason: self-signed certificate in certificate chain
      npm error Log files were not written due to an error writing to the directory: /opt/app-root/src/.npm/_logs
      npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal 

      Expected results:

      Installs dynamic plugin

      Reproducibility (Always/Intermittent/Only Once):

      100%

      Build Details:

      RHDH 1.7

      Additional info (Such as Logs, Screenshots, etc):

      Backstage resource

       

        spec:
          application:
            appConfig:
              configMaps:
              - name: app-config-rhdh-auth
              - name: app-config-rhdh-catalog
              - name: app-config-rhdh
              mountPath: /opt/app-root/src
            dynamicPluginsConfigMapName: dynamic-plugins-rhdh
            extraEnvs:
              envs:
              - name: NODE_TLS_REJECT_UNAUTHORIZED
                value: "0"
       

       

       

              Unassigned Unassigned
              chadcrum Chad Crum
              RHIDP - Install
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: