-
Bug
-
Resolution: Done
-
Critical
-
RH-SSO-7.6.0, RH-SSO-7.5.1, RH-SSO-7.5.2
-
None
-
False
-
None
-
False
-
-
-
-
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.