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

test(connector-fabric): fix tests - package io/fs is not in GOROOT #2358

Closed
petermetz opened this issue Mar 29, 2023 · 0 comments · Fixed by #2599
Closed

test(connector-fabric): fix tests - package io/fs is not in GOROOT #2358

petermetz opened this issue Mar 29, 2023 · 0 comments · Fixed by #2599
Assignees
Labels
bug Something isn't working Developer_Experience Fabric P2 Priority 2: High Tests Anything related to tests be that automatic or manual, integration or unit, etc. Triage_Needed Triage if the issue is/still relevant, bug report is valid, arch/design details etc.

Comments

@petermetz
Copy link
Contributor

Describe the bug

Test case: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source-private-data.test.ts

2023-03-29T06:02:24.1304202Z     console.error
2023-03-29T06:02:24.1305051Z       [2023-03-29T06:02:13.636Z] ERROR (get-block-endpoint-v1): Crash while serving GetBlockEndpointV1#handleRequest(): Error: Failed to parse block number with error strconv.ParseUint: parsing "foo": invalid syntax
2023-03-29T06:02:24.1306283Z           at SingleQueryHandler.evaluate (/home/runner/work/cacti/cacti/packages/cactus-plugin-ledger-connector-fabric/node_modules/fabric-network/src/impl/query/singlequeryhandler.ts:51:42)
2023-03-29T06:02:24.1314268Z           at runMicrotasks (<anonymous>)
2023-03-29T06:02:24.1314773Z           at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-03-29T06:02:24.1315710Z           at Transaction.evaluate (/home/runner/work/cacti/cacti/packages/cactus-plugin-ledger-connector-fabric/node_modules/fabric-network/src/transaction.ts:382:19)
2023-03-29T06:02:24.1330543Z           at Object.querySystemChainCode (/home/runner/work/cacti/cacti/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/common/query-system-chain-code.ts:33:24)
2023-03-29T06:02:24.1331698Z           at PluginLedgerConnectorFabric.getBlock (/home/runner/work/cacti/cacti/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/plugin-ledger-connector-fabric.ts:1496:22)
2023-03-29T06:02:24.1332828Z           at GetBlockEndpointV1.handleRequest (/home/runner/work/cacti/cacti/packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/get-block/get-block-endpoint-v1.ts:90:23) {
2023-03-29T06:02:24.1333342Z         isEndorsed: false,
2023-03-29T06:02:24.1333588Z         payload: <Buffer >,
2023-03-29T06:02:24.1334069Z         status: 500
2023-03-29T06:02:24.1334258Z       }
2023-03-29T06:02:24.1334377Z 

To Reproduce

yarn jest packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source-private-data.test.ts

Expected behavior

Test passes.

Logs/Stack traces

With the current source code of the test case: 2023-03-28T22-21-57-cacti-fabric-test-crash.csv

After using a more up to date AIO image: 2023-03-28T02-50-11-cacti-ci-fabric-go-chaincode-deployment-crash.log

Cloud provider or hardware configuration:

Both local and cloud.

Operating system name, version, build:

Ubuntu 20.04

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

1.2.0 & main

Hyperledger Cactus Plugins/Connectors Used

  • Fabric

Additional context

The Fabric 2.x AIO image comes with go v1.15.5 but some of the (apparently) auto-upgrading dependencies in chain code builds we have have started requiring v1.16.x.

@petermetz petermetz added bug Something isn't working Fabric Developer_Experience Triage_Needed Triage if the issue is/still relevant, bug report is valid, arch/design details etc. Tests Anything related to tests be that automatic or manual, integration or unit, etc. P2 Priority 2: High labels Mar 29, 2023
@petermetz petermetz self-assigned this Mar 29, 2023
@petermetz petermetz added this to the v2.0.0-alpha.2 milestone Aug 5, 2023
petermetz added a commit to petermetz/cacti that referenced this issue Aug 8, 2023
The simple answer was to upgrade to go v1.20.x from v1.15.x, but
this caused a series of other problems that also needed to address
so the complete list of changes and their motivations are below:

1. The upgrade to go v1.20.6
1.1. We no longer install docker-compose via pip because since v2
it ships with the main docker package itself (they rewrote it in go)
1.2. Added a new "gcompat" apk package which is necessary because
of go v1.20.6 as well. Details on this can be found here:
golang/go#59305 (comment)
1.3. As  part of installing the OpenSSH server, we now must first wipe all
openssh* packages due to newly surfaced package version conflicts due
to the ones that are prepackaged with the alpine image.
Without the purge step it fails like this:
    => ERROR [17/64] RUN apk add --no-cache openssh augeas                   1.1s
   ------
    > [17/64] RUN apk add --no-cache openssh augeas:
   0.300 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
   0.560 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
   1.041 ERROR: unable to select packages:
   1.043   openssh-client-common-9.3_p1-r3:
   1.043     breaks: openssh-client-default-9.3_p2-r0[openssh-client-common=9.3_p2-r0]
2. Upgraded the node-ssh library to v13 because v12 was broken due to
changes introduced by the new OpenSSH server.
3. Modified the container image definition so that we have the ability
to customize the version of fabric-nodeenv images used internally by the
peers of the fabric-samples repository. This was needed so that we can
control what version of npm and NodeJS are being used when the chain code
installation process is happening (which is just the peer running the
`npm install --production` command within the fabric-nodeenv container)
4. The default Fabric version used by the testing infrastructure is now
Fabric v2.2.13 and for the NodeJS chain code it is 2.4.2
5. Slightly rearranged the imports & constants in some of the tests
which made it easier to verify that the new image is working as intended.

Fixes hyperledger-cacti#2358

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit to petermetz/cacti that referenced this issue Aug 11, 2023
The simple answer was to upgrade to go v1.20.x from v1.15.x, but
this caused a series of other problems that also needed to address
so the complete list of changes and their motivations are below:

1. The upgrade to go v1.20.6
1.1. We no longer install docker-compose via pip because since v2
it ships with the main docker package itself (they rewrote it in go)
1.2. Added a new "gcompat" apk package which is necessary because
of go v1.20.6 as well. Details on this can be found here:
golang/go#59305 (comment)
1.3. As  part of installing the OpenSSH server, we now must first wipe all
openssh* packages due to newly surfaced package version conflicts due
to the ones that are prepackaged with the alpine image.
Without the purge step it fails like this:
    => ERROR [17/64] RUN apk add --no-cache openssh augeas                   1.1s
   ------
    > [17/64] RUN apk add --no-cache openssh augeas:
   0.300 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
   0.560 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
   1.041 ERROR: unable to select packages:
   1.043   openssh-client-common-9.3_p1-r3:
   1.043     breaks: openssh-client-default-9.3_p2-r0[openssh-client-common=9.3_p2-r0]
2. Upgraded the node-ssh library to v13 because v12 was broken due to
changes introduced by the new OpenSSH server.
3. Modified the container image definition so that we have the ability
to customize the version of fabric-nodeenv images used internally by the
peers of the fabric-samples repository. This was needed so that we can
control what version of npm and NodeJS are being used when the chain code
installation process is happening (which is just the peer running the
`npm install --production` command within the fabric-nodeenv container)
4. The default Fabric version used by the testing infrastructure is now
Fabric v2.2.13 and for the NodeJS chain code it is 2.4.2
5. Slightly rearranged the imports & constants in some of the tests
which made it easier to verify that the new image is working as intended.
6. The new image built from this dockerfile for Fabric AIO 2.x is tagged
on the registry as:
`ghcr.io/hyperledger/cactus-fabric2-all-in-one:2023-08-05-issue2358`

Fixes hyperledger-cacti#2358

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit to petermetz/cacti that referenced this issue Aug 11, 2023
The simple answer was to upgrade to go v1.20.x from v1.15.x, but
this caused a series of other problems that also needed to address
so the complete list of changes and their motivations are below:

1. The upgrade to go v1.20.6
1.1. We no longer install docker-compose via pip because since v2
it ships with the main docker package itself (they rewrote it in go)
1.2. Added a new "gcompat" apk package which is necessary because
of go v1.20.6 as well. Details on this can be found here:
golang/go#59305 (comment)
1.3. As  part of installing the OpenSSH server, we now must first wipe all
openssh* packages due to newly surfaced package version conflicts due
to the ones that are prepackaged with the alpine image.
Without the purge step it fails like this:
    => ERROR [17/64] RUN apk add --no-cache openssh augeas                   1.1s
   ------
    > [17/64] RUN apk add --no-cache openssh augeas:
   0.300 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
   0.560 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
   1.041 ERROR: unable to select packages:
   1.043   openssh-client-common-9.3_p1-r3:
   1.043     breaks: openssh-client-default-9.3_p2-r0[openssh-client-common=9.3_p2-r0]
2. Upgraded the node-ssh library to v13 because v12 was broken due to
changes introduced by the new OpenSSH server.
3. Modified the container image definition so that we have the ability
to customize the version of fabric-nodeenv images used internally by the
peers of the fabric-samples repository. This was needed so that we can
control what version of npm and NodeJS are being used when the chain code
installation process is happening (which is just the peer running the
`npm install --production` command within the fabric-nodeenv container)
4. The default Fabric version used by the testing infrastructure is now
Fabric v2.2.13 and for the NodeJS chain code it is 2.4.2
5. Slightly rearranged the imports & constants in some of the tests
which made it easier to verify that the new image is working as intended.
6. The new image built from this dockerfile for Fabric AIO 2.x is tagged
on the registry as:
`ghcr.io/hyperledger/cactus-fabric2-all-in-one:2023-08-05-issue2358`
7. increased the tap timeout from 900 seconds (15 minutes) to 3600 (an hour)

Fixes hyperledger-cacti#2358

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit that referenced this issue Aug 11, 2023
The simple answer was to upgrade to go v1.20.x from v1.15.x, but
this caused a series of other problems that also needed to address
so the complete list of changes and their motivations are below:

1. The upgrade to go v1.20.6
1.1. We no longer install docker-compose via pip because since v2
it ships with the main docker package itself (they rewrote it in go)
1.2. Added a new "gcompat" apk package which is necessary because
of go v1.20.6 as well. Details on this can be found here:
golang/go#59305 (comment)
1.3. As  part of installing the OpenSSH server, we now must first wipe all
openssh* packages due to newly surfaced package version conflicts due
to the ones that are prepackaged with the alpine image.
Without the purge step it fails like this:
    => ERROR [17/64] RUN apk add --no-cache openssh augeas                   1.1s
   ------
    > [17/64] RUN apk add --no-cache openssh augeas:
   0.300 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
   0.560 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
   1.041 ERROR: unable to select packages:
   1.043   openssh-client-common-9.3_p1-r3:
   1.043     breaks: openssh-client-default-9.3_p2-r0[openssh-client-common=9.3_p2-r0]
2. Upgraded the node-ssh library to v13 because v12 was broken due to
changes introduced by the new OpenSSH server.
3. Modified the container image definition so that we have the ability
to customize the version of fabric-nodeenv images used internally by the
peers of the fabric-samples repository. This was needed so that we can
control what version of npm and NodeJS are being used when the chain code
installation process is happening (which is just the peer running the
`npm install --production` command within the fabric-nodeenv container)
4. The default Fabric version used by the testing infrastructure is now
Fabric v2.2.13 and for the NodeJS chain code it is 2.4.2
5. Slightly rearranged the imports & constants in some of the tests
which made it easier to verify that the new image is working as intended.
6. The new image built from this dockerfile for Fabric AIO 2.x is tagged
on the registry as:
`ghcr.io/hyperledger/cactus-fabric2-all-in-one:2023-08-05-issue2358`
7. increased the tap timeout from 900 seconds (15 minutes) to 3600 (an hour)

Fixes #2358

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
sandeepnRES pushed a commit to sandeepnRES/cacti that referenced this issue Dec 21, 2023
The simple answer was to upgrade to go v1.20.x from v1.15.x, but
this caused a series of other problems that also needed to address
so the complete list of changes and their motivations are below:

1. The upgrade to go v1.20.6
1.1. We no longer install docker-compose via pip because since v2
it ships with the main docker package itself (they rewrote it in go)
1.2. Added a new "gcompat" apk package which is necessary because
of go v1.20.6 as well. Details on this can be found here:
golang/go#59305 (comment)
1.3. As  part of installing the OpenSSH server, we now must first wipe all
openssh* packages due to newly surfaced package version conflicts due
to the ones that are prepackaged with the alpine image.
Without the purge step it fails like this:
    => ERROR [17/64] RUN apk add --no-cache openssh augeas                   1.1s
   ------
    > [17/64] RUN apk add --no-cache openssh augeas:
   0.300 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
   0.560 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
   1.041 ERROR: unable to select packages:
   1.043   openssh-client-common-9.3_p1-r3:
   1.043     breaks: openssh-client-default-9.3_p2-r0[openssh-client-common=9.3_p2-r0]
2. Upgraded the node-ssh library to v13 because v12 was broken due to
changes introduced by the new OpenSSH server.
3. Modified the container image definition so that we have the ability
to customize the version of fabric-nodeenv images used internally by the
peers of the fabric-samples repository. This was needed so that we can
control what version of npm and NodeJS are being used when the chain code
installation process is happening (which is just the peer running the
`npm install --production` command within the fabric-nodeenv container)
4. The default Fabric version used by the testing infrastructure is now
Fabric v2.2.13 and for the NodeJS chain code it is 2.4.2
5. Slightly rearranged the imports & constants in some of the tests
which made it easier to verify that the new image is working as intended.
6. The new image built from this dockerfile for Fabric AIO 2.x is tagged
on the registry as:
`ghcr.io/hyperledger/cactus-fabric2-all-in-one:2023-08-05-issue2358`
7. increased the tap timeout from 900 seconds (15 minutes) to 3600 (an hour)

Fixes hyperledger-cacti#2358

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Developer_Experience Fabric P2 Priority 2: High Tests Anything related to tests be that automatic or manual, integration or unit, etc. Triage_Needed Triage if the issue is/still relevant, bug report is valid, arch/design details etc.
Projects
None yet
1 participant