-
Bug
-
Resolution: Unresolved
-
Critical
-
1.36.0
-
None
-
False
-
-
False
-
-
Known Issue
-
+
-
-
Summary
In SRVLOGIC-528 was introduced maven wrapper downloader. Changes were done to install Maven wrapper for Maven 3.8.6. The maven wrapper is installed from public repo.maven.apache.org (see the properties configured - maven-wrapper.properties )
Installation of maven-wrapper in disconnected cluster causes the `Connection timed out` exception during starting the build. Disconnected cluster does not have access outside and it is not possible to pull these resources, so build is not started.
As these artifacts have hard-coded location in properties file and they are not part of pom, the MAVEN_MIRROR_URL does not affect this.
Environment
OpenShift Disconnected 4.16 running in AWS
Mirrored images for 1.36.0.CR1 build
Steps to reproduce
- Create a simple workflow (e.g. greeting)
- Deploy it in preview mode into OCP with Operator
Actual results
Build failing with following exception:
[1/2] STEP 7/7: RUN /home/kogito/launch/build-app.sh ./resources INFO -> Copying files from /home/kogito/serverless-workflow-project/resources, if any... INFO -> Destination folder is /home/kogito/serverless-workflow-project/src/main/resources/ '/home/kogito/serverless-workflow-project/resources/Dockerfile' -> '/home/kogito/serverless-workflow-project/src/main/resources/Dockerfile' '/home/kogito/serverless-workflow-project/resources/application-prod.properties' -> '/home/kogito/serverless-workflow-project/src/main/resources/application-prod.properties' '/home/kogito/serverless-workflow-project/resources/application.properties' -> '/home/kogito/serverless-workflow-project/src/main/resources/application.properties' '/home/kogito/serverless-workflow-project/resources/greeting.sw.json' -> '/home/kogito/serverless-workflow-project/src/main/resources/greeting.sw.json' INFO Configure Maven INFO --> checking if .mvn/jvm.config exists. INFO ---> .mvn/jvm.config does not exists, memory will be calculated based on container limits. Exception in thread "main" java.net.ConnectException: Connection timed out at java.base/sun.nio.ch.Net.connect0(Native Method) at java.base/sun.nio.ch.Net.connect(Net.java:579) at java.base/sun.nio.ch.Net.connect(Net.java:568) at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) at java.base/java.net.Socket.connect(Socket.java:633) at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174) at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:638) at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266) at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1257) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1143) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1702) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:100) at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:86) at org.apache.maven.wrapper.Installer.createDist(Installer.java:84) at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:160) at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:73) error: build error: building at STEP "RUN /home/kogito/launch/build-app.sh ./resources": while running runtime: exit status 1
Expected results
Build passes without any exception
Workaround
Exists, only for builder image. It is not trivial
Steps for builder:
- Into the mirror registry upload the artifacts from distributionUrl and wrapperUrl that are used in maven-wrapper.properties file
- Update the build dockerfile to replace the repo url in maven-wrapper.properties
RUN sed -i "s|https://repo.maven.apache.org/maven2|<your-mirror-registry-that-ocp-disconnected-can-use>|" /usr/share/maven/bin/.mvn/wrapper/maven-wrapper.properties
- Rebuild the sonataflow
Steps for devmode image
- Into the mirror registry upload the artifacts from distributionUrl and wrapperUrl that are used in maven-wrapper.properties file
- Add to the devmode running sonataflow definition env variable `MVNW_REPOURL` for pod template to change the url for download
podTemplate: container: env: - name: MAVEN_MIRROR_URL value: '<your-mirror-registry-that-ocp-disconnected-can-use>' - name: MVNW_REPOURL value: '<your-mirror-registry-that-ocp-disconnected-can-use>'
- Check the running devmode image
Workaround 2 for builder image (this one is easier and similar to devmode workaround)
- Into the mirror registry upload the artifacts from distributionUrl and wrapperUrl that are used in maven-wrapper.properties file
- First, create SonataflowPlatform with set-up build template env variable for `MVNW_REPOURL`
spec: build: template: envs: - name: MAVEN_MIRROR_URL value: '<your-mirror-registry-that-ocp-disconnected-can-use>' - name: MVNW_REPOURL value: '<your-mirror-registry-that-ocp-disconnected-can-use>'
- Create a new preview workflow (e.g. greetings)
- Check that build passes
Testing
Covered by manual test in test plan.
- blocks
-
SRVLOGIC-531 Support disconnected cluster environment
-
- Release Pending
-
- is blocked by
-
SRVLOGIC-608 OSL Builder image always downloads plexus-utils-1.1
-
- ON_QA
-
-
OPENJDK-3142 [rhel-9] upgrade Maven to a version of maven compatible with OpenJDK 17 and 21
-
- Closed
-
- is related to
-
SRVLOGIC-528 Fix maven wrapper download in OSL swf-builder and swf-devmode images
-
- Release Pending
-