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

build(corda-all-in-one-obligation): fix image build error - unable to select packages #2621

Closed
aldousalvarez opened this issue Aug 17, 2023 · 2 comments · Fixed by #2659
Closed
Assignees
Labels
bug Something isn't working Corda Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P1 Priority 1: Highest Tests Anything related to tests be that automatic or manual, integration or unit, etc.

Comments

@aldousalvarez
Copy link
Contributor

Describe the bug
In the process of the container building of corda-all-in-one-obligation, there are the following errors and the container cannot be built.

[process] 
DOCKER_BUILDKIT=1 docker build ./tools/docker/corda-all-in-one/ -f ./tools/docker/corda-all-in-one/corda-v4_8/Dockerfile

[error 1]
#16 [11/44] RUN apk add --no-cache openssh augeas
#16 0.311 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
#16 0.402 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
#16 0.644 ERROR: unable to select packages:
#16 0.646   openssh-client-common-9.3_p1-r3:
#16 0.646     breaks: openssh-client-default-9.3_p2-r0[openssh-client-common=9.3_p2-r0]
#16 ERROR: process "/bin/sh -c apk add --no-cache openssh augeas" did not complete successfully: exit code: 2
------
 > [11/44] RUN apk add --no-cache openssh augeas:
0.311 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
0.402 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
0.644 ERROR: unable to select packages:
0.646   openssh-client-common-9.3_p1-r3:
0.646     breaks: openssh-client-default-9.3_p2-r0[openssh-client-common=9.3_p2-r0]
------
Dockerfile:37
--------------------
  35 |     
  36 |     # OpenSSH - need to have it so we can shell in and install/instantiate contracts and troubleshoot
  37 | >>> RUN apk add --no-cache openssh augeas
  38 |     
  39 |     # Configure the OpenSSH server we just installed
--------------------
ERROR: failed to solve: process "/bin/sh -c apk add --no-cache openssh augeas" did not complete successfully: exit code: 2
Error: Process completed with exit code 1.

[error 2]
=> ERROR [29/45] RUN java -jar /corda-tools-shell-cli-all.jar install-shell-extensions                                                                                 0.8s 
------                                                                                                                                                                       
 > [29/45] RUN java -jar /corda-tools-shell-cli-all.jar install-shell-extensions:                                                                                            
0.752 Error: Invalid or corrupt jarfile /corda-tools-shell-cli-all.jar
------
Dockerfile:69
--------------------
  67 |     RUN curl https://software.r3.com/artifactory/corda-releases/net/corda/corda-tools-shell-cli/${CORDA_TOOLS_SHELL_CLI_VERSION}/corda-tools-shell-cli-${CORDA_TOOLS_SHELL_CLI_VERSION}-all.jar --output /corda-tools-shell-cli-all.jar
  68 |     # This is what makes the "corda-shell" alias avaialble on the terminal
  69 | >>> RUN java -jar /corda-tools-shell-cli-all.jar install-shell-extensions
  70 |     
  71 |     RUN git clone https://github.com/corda/samples-kotlin.git
--------------------
ERROR: failed to solve: process "/bin/sh -c java -jar /corda-tools-shell-cli-all.jar install-shell-extensions" did not complete successfully: exit code: 1

To Reproduce
[error 1]

Run the [process] command above and it will try to build the image.

[error 2]

modify tools/docker/corda-all-in-one/corda-v4_8/Dockerfile and replace the following:
36 # OpenSSH - need to have it so we can shell in and install/instantiate contracts and troubleshoot
37 RUN apk add --no-cache openssh augeas

With

RUN apk upgrade
RUN apk add --no-cache openssh=9.3_p2-r0
RUN apk add --no-cache augeas=1.12.0-r5
@aldousalvarez aldousalvarez added the bug Something isn't working label Aug 17, 2023
@petermetz petermetz self-assigned this Aug 17, 2023
@petermetz petermetz added good-first-issue Good for newcomers Corda Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. good-first-issue-400-expert Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) Tests Anything related to tests be that automatic or manual, integration or unit, etc. P1 Priority 1: Highest labels Aug 17, 2023
@petermetz petermetz added this to the v2.0.0-alpha.2 milestone Aug 17, 2023
petermetz added a commit to petermetz/cacti that referenced this issue Aug 17, 2023
…ages

WORK IN PROGRESS - Image build is broken still

Fixes hyperledger-cacti#2621

Signed-off-by: Peter Somogyvari <[email protected]>
@aldousalvarez
Copy link
Contributor Author

Hello @petermetz

[error 2] has now been fixed by this commit https://github.com/hyperledger/cacti/commit/01c52652098405673e2b0bbb72852f7ba35f5816

and we have encountered a new error when building the corda v4-8 image.

[error 3]


9.066 FAILURE: Build failed with an exception.
9.066 
9.066 * What went wrong:
9.066 Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
9.066 > Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 [in thread "Daemon worker"]
9.066 
9.066 * Try:
9.066 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
9.066 
9.066 * Get more help at https://help.gradle.org
9.066 
9.066 BUILD FAILED in 8s
------
Dockerfile:84
--------------------
  82 |     RUN apk add --no-cache supervisor
  83 |     
  84 | >>> RUN ./gradlew build deployNodes
  85 |     
  86 |     # OpenSSH server
--------------------
ERROR: failed to solve: process "/bin/sh -c ./gradlew build deployNodes" did not complete successfully: exit code: 1

@petermetz
Copy link
Contributor

@aldousalvarez Gotcha, I'll look into it!

@petermetz petermetz changed the title bug(cactus-corda-all-in-one-obligation): ERROR "unable to select packages" & Error: "Invalid or corrupt jarfile /corda-tools-shell-cli-all.jar" build(corda-all-in-one-obligation): fix image build error - unable to select packages Aug 29, 2023
petermetz added a commit to petermetz/cacti that referenced this issue Sep 7, 2023
1. Fixed the OpenSSH related problems by wiping the default installation
of it that ships with the distro (Alpine Linux images)
2. Updated the kotlin samples repository's code manually so that it
specifies the platform version as 11 instead of 12 for the basic contracts
which is what we need for Corda v4.8 and v4.9 as well (I'm guessing that
platform  version 12 will stand for v5 when it becomes GA but not sure)
The manual update is done via sed-ing at image build time right after
the kotlin samples repository has been cloned.

Fixes hyperledger-cacti#2621

Signed-off-by: Peter Somogyvari <[email protected]>
petermetz added a commit to petermetz/cacti that referenced this issue Sep 7, 2023
1. Fixed the OpenSSH related problems by wiping the default installation
of it that ships with the distro (Alpine Linux images)
2. Updated the kotlin samples repository's code manually so that it
specifies the platform version as 11 instead of 12 for the basic contracts
which is what we need for Corda v4.8 and v4.9 as well (I'm guessing that
platform  version 12 will stand for v5 when it becomes GA but not sure)
The manual update is done via sed-ing at image build time right after
the kotlin samples repository has been cloned.

Fixes hyperledger-cacti#2621

Signed-off-by: Peter Somogyvari <[email protected]>
petermetz added a commit to petermetz/cacti that referenced this issue Sep 7, 2023
1. Fixed the OpenSSH related problems by wiping the default installation
of it that ships with the distro (Alpine Linux images)
2. Updated the kotlin samples repository's code manually so that it
specifies the platform version as 11 instead of 12 for the basic contracts
which is what we need for Corda v4.8 and v4.9 as well (I'm guessing that
platform  version 12 will stand for v5 when it becomes GA but not sure)
The manual update is done via sed-ing at image build time right after
the kotlin samples repository has been cloned.

Fixes hyperledger-cacti#2621

Signed-off-by: Peter Somogyvari <[email protected]>
petermetz added a commit that referenced this issue Sep 7, 2023
1. Fixed the OpenSSH related problems by wiping the default installation
of it that ships with the distro (Alpine Linux images)
2. Updated the kotlin samples repository's code manually so that it
specifies the platform version as 11 instead of 12 for the basic contracts
which is what we need for Corda v4.8 and v4.9 as well (I'm guessing that
platform  version 12 will stand for v5 when it becomes GA but not sure)
The manual update is done via sed-ing at image build time right after
the kotlin samples repository has been cloned.

Fixes #2621

Signed-off-by: Peter Somogyvari <[email protected]>
sandeepnRES pushed a commit to sandeepnRES/cacti that referenced this issue Dec 21, 2023
1. Fixed the OpenSSH related problems by wiping the default installation
of it that ships with the distro (Alpine Linux images)
2. Updated the kotlin samples repository's code manually so that it
specifies the platform version as 11 instead of 12 for the basic contracts
which is what we need for Corda v4.8 and v4.9 as well (I'm guessing that
platform  version 12 will stand for v5 when it becomes GA but not sure)
The manual update is done via sed-ing at image build time right after
the kotlin samples repository has been cloned.

Fixes hyperledger-cacti#2621

Signed-off-by: Peter Somogyvari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Corda Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P1 Priority 1: Highest Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants