Uploaded image for project: 'RH-SSO'
  1. RH-SSO
  2. RHSSO-2191

[RH-SSO 7.5.X/7.6.X images] S2I with custom Maven mirror url settings fails due to undefined AUS value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • RH-SSO-7.6.1
    • RH-SSO-7.6.0, RH-SSO-7.5.1, RH-SSO-7.5.2
    • OpenShift - xPaaS
    • None
    • CIAM Sprint 23

      Attempt to perform S2I image build using custom Maven mirror (custom MAVEN_MIRROR_URL env var) fails with sed unknown option to `s' message (see SSOSUP-323 for full issue details and complete reproducer).

      The problematic sed command, causing this behaviour is the following one:

      ++ sed -i 's<!-- ### configured mirrors ### --><mirror>\n      <id>mirror.default</id>\n      <url>http://nexus3:8081/repository/maven-public/</url>\n      <mirrorOf>*</mirrorOf>\n    </mirror>\n    <!-- ### configured mirrors ### -->' /opt/jboss/container/wildfly/s2i/galleon/settings.xml
      sed: -e expression #1, char 55: unknown option to `s'
      

      The problem is caused due to undefined value of the AUS environment variable, which is expected to define the character, which should be used as the delimiter for sed expressions.

      Since the AUS variable is not set, the sed command uses the next character after the 's' command, which in this specific case of 's<!-- ### configured mirrors ### --><mirror>\n <i' string is the less-than ('<') character (the first less-than character is start of sed pattern, the middle one is delimiter between pattern and the intended replacement string, finally the '<' character is treated as end of the replacement). The 'i' character after the third '<' is then treated as command / instruction / option to sed tool, which is unknown, and thus the whole sed command fails.

            rhn-jlieskov Ján Lieskovský
            rhn-jlieskov Ján Lieskovský
            Olivier Rivat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: