Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOUD-3387] s2i/run attempts to source missing scl-enable-maven #354

Open
jmtd opened this issue Sep 19, 2019 · 6 comments
Open

[CLOUD-3387] s2i/run attempts to source missing scl-enable-maven #354

jmtd opened this issue Sep 19, 2019 · 6 comments

Comments

@jmtd
Copy link
Collaborator

jmtd commented Sep 19, 2019

With the OpenJDK RHEL8/JDK11 image, on start up, one gets the following error

/usr/local/s2i/run: line 15: /opt/jboss/container/maven/default//scl-enable-maven: No such file or directory

The image uses the following modules at the top level (image):

  install:
  - name: jboss.container.openjdk.jdk
    version: "8"
  - name: jboss.container.java.s2i.bash
  - name: jboss.container.openjdk.jdk
    version: "11"
  - name: jboss.container.maven.35.bash
    version: "3.5"

Cekit (3.4.0) unravels this to the following full list

jboss.container.java.jvm.api     jboss.container.maven.35.bash       jboss.container.prometheus.bash
jboss.container.java.jvm.bash    jboss.container.maven.api           jboss.container.proxy.api
jboss.container.java.proxy.bash  jboss.container.maven.default.bash  jboss.container.s2i.core.api
jboss.container.java.run.bash    jboss.container.maven.s2i.api       jboss.container.s2i.core.bash
jboss.container.java.s2i.bash    jboss.container.maven.s2i.bash      jboss.container.user
jboss.container.jolokia.api      jboss.container.openjdk.jdk         jboss.container.util.logging.bash
jboss.container.jolokia.bash     jboss.container.prometheus.api

the script jboss/container/java/s2i/bash/artifacts/usr/local/s2i/run contains the following

# XXX: Not sure why we need to setup maven, but this was part of the old s2i-setup script, so...
source "${JBOSS_CONTAINER_MAVEN_DEFAULT_MODULE}/scl-enable-maven"

(that comment looks suspicious)

the var JBOSS_CONTAINER_MAVEN_DEFAULT_MODULE is not set in that script. It's defined as set in jboss/container/maven/default/bash/module.yaml, so it's set by the build process (in the Dockerfile) to /opt/jboss/container/maven/default/.

@jmtd
Copy link
Collaborator Author

jmtd commented Sep 19, 2019

Ultimately we can probably delete those two lines from the s2i/run script.

@jmtd
Copy link
Collaborator Author

jmtd commented Sep 19, 2019

same issue with openjdk/openjdk-11-rhel8 but not openjdk/openjdk-11-rhel7 or redhat-openjdk-18/openjdk18-openshift:1.6

@jmtd
Copy link
Collaborator Author

jmtd commented Sep 19, 2019

In the working image, /opt/jboss/container/maven/default/scl-enable-maven -> /opt/jboss/container/maven/35/scl-enable-maven

@jmtd
Copy link
Collaborator Author

jmtd commented Sep 19, 2019

This is the line that creates the symlink:

jboss/container/maven/default/bash/configure.sh:ln -s /opt/jboss/container/maven/35/* /opt/jboss/container/maven/default

There's a few things wrong there. It's 35-specific so will fail for 36 amongst other things. There directory is created by the 35scl module when copying in the single file scl-enable-maven which the 35 module doesn't have so doesn't copy and so doesn't create the directory.

@jmtd jmtd changed the title s2i/run attempts to source missing scl-enable-maven [CLOUD-3387] s2i/run attempts to source missing scl-enable-maven Oct 2, 2019
jmtd added a commit to jmtd/cct_module that referenced this issue Oct 2, 2019
don't try to enable Maven (Via SCL) in the s2i run script.

We might not have provided Maven via SCL in the image anyway.

Fixes jboss-openshift#354.

Signed-off-by: Jonathan Dowland <[email protected]>
jmtd added a commit to jmtd/cct_module that referenced this issue Sep 15, 2020
RHEL7-based images that use SCL to provide Maven need this in order
to have Maven available in the run environment (although I'd be
surprised if anyone actually used that)

Fixes GitHub jboss-openshift#354.

Signed-off-by: Jonathan Dowland <[email protected]>
jmtd added a commit that referenced this issue Sep 15, 2020
RHEL7-based images that use SCL to provide Maven need this in order
to have Maven available in the run environment (although I'd be
surprised if anyone actually used that)

Fixes GitHub #354.

Signed-off-by: Jonathan Dowland <[email protected]>
@m4rc77
Copy link

m4rc77 commented Mar 27, 2021

FYI: The error /usr/local/s2i/run: line 15: /opt/jboss/container/maven/default//scl-enable-maven: No such file or directory also occurs in UBI images registry.access.redhat.com/ubi8/openjdk-11:latest and registry.access.redhat.com/ubi8/openjdk-8:latest.

A simple RUN touch /opt/jboss/container/maven/default/scl-enable-maven in the Dockerfile let's the error disappear. Hope there are no side-effects ;-)

@jmtd
Copy link
Collaborator Author

jmtd commented Mar 29, 2021

A simple RUN touch /opt/jboss/container/maven/default/scl-enable-maven in the Dockerfile let's the error disappear. Hope there are no side-effects ;-)

That should be fine. I think we fixed this a while ago in our development branch but we haven't made a release since. (Soon!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants