hyperledger-cacti / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
344 stars 286 forks source link

test(plugin-odap-hermes): fix hanging, infinitely running hermes tests #2324

Open petermetz opened 1 year ago

petermetz commented 1 year ago

Depends on #2323

Once the PR above has been merged, the checks mentioned in the title need to be re-enabled. There is no code to be written to fix this issue, it's just point and click in the GitHub settings of the project (so one of the maintainers must do it who has write access to those settings)

The cactus-plugin-odap-hermes ci.yaml job has been disabled so when the fix for this gets committed please also re-enable that job.


2023-06-15 update: The ODAP hermes tests are still hanging after having merged #2323 so this is now a bug to resolve that first and THEN re-enable the checks.

2023-06-16 update: Full CI logs with the crash/hang are here: 2023-06-16T23-17-29_2470910Z_cacti-opap-hermes-plugin-test-crash.log


Locally reproduced logs (but only after the fix to the cgroup v2 sed write error bug)

2023-06-17T02:16:33.813Z - info: [NetworkConfig]: buildOrderer - Unable to connect to the committer orderer.example.com due to TypeError: Channel credentials must be a ChannelCredentials object
    at new ChannelImplementation (/****/cacti/packages/cactus-plugin-ledger-connector-fabric/node_modules/@grpc/grpc-js/src/channel.ts:200:13)
    at new Client (/****/cacti/packages/cactus-plugin-ledger-connector-fabric/node_modules/@grpc/grpc-js/src/client.ts:153:30)
    at new ServiceClientImpl (/****/cacti/packages/cactus-plugin-ledger-connector-fabric/node_modules/@grpc/grpc-js/src/make-client.ts:129:3)
    at Committer.connect (/****/cacti/packages/cactus-test-tooling/node_modules/fabric-common/lib/ServiceEndpoint.js:120:18)
    at buildOrderer (/****/cacti/packages/cactus-test-tooling/node_modules/fabric-network/src/impl/ccp/networkconfig.ts:114:17)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.loadFromConfig (/****/cacti/packages/cactus-test-tooling/node_modules/fabric-network/src/impl/ccp/networkconfig.ts:56:4)
    at Gateway.connect (/****/cacti/packages/cactus-test-tooling/node_modules/fabric-network/src/gateway.ts:340:4)
    at FabricTestLedgerV1.enrollUser (/****/cacti/packages/cactus-test-tooling/src/main/typescript/fabric/fabric-test-ledger-v1.ts:211:7)
    at Object.<anonymous> (/****/cacti/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts:195:28)
  console.info
    [2023-06-17T02:16:35.346Z] INFO (PluginKeychainMemory): Created PluginKeychainMemory. KeychainID=00d7cb65-5463-4ea7-9dda-36dc851c373b

      at Logger.info (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)

  console.warn
    [2023-06-17T02:16:35.356Z] WARN (PluginKeychainMemory): Never use PluginKeychainMemory in production. It does not support encryption. It stores everything in plain text.

      52 |
      53 |   public warn(...msg: unknown[]): void {
    > 54 |     this.backend.warn(...msg);
         |                  ^
      55 |   }
      56 |   public info(...msg: unknown[]): void {
      57 |     this.backend.info(...msg);

      at Logger.warn (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)
      at Logger.warn (packages/cactus-common/src/main/typescript/logging/logger.ts:54:18)
      at new PluginKeychainMemory (packages/cactus-plugin-keychain-memory/src/main/typescript/plugin-keychain-memory.ts:66:14)
      at Object.<anonymous> (packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts:203:28)

  console.info
    [2023-06-17T02:16:35.362Z] INFO (PluginLedgerConnectorFabric): Installing web services for plugin @hyperledger/cactus-plugin-ledger-connector-fabric...

      at Logger.info (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)

  console.info
    [2023-06-17T02:16:35.378Z] INFO (PluginLedgerConnectorFabric): Installed web services for plugin @hyperledger/cactus-plugin-ledger-connector-fabric OK {
      endpoints: [
        DeployContractGoSourceEndpointV1 { opts: [Object], log: [Logger] },
        DeployContractEndpointV1 { opts: [Object], log: [Logger] },
        RunTransactionEndpointV1 { opts: [Object], log: [Logger] },
        GetTransactionReceiptByTxIDEndpointV1 {
          opts: [Object],
          log: [Logger]
        },
        GetBlockEndpointV1 { opts: [Object], log: [Logger] },
        GetPrometheusExporterMetricsEndpointV1 {
          opts: [Object],
          log: [Logger]
        }
      ]
    }

      at Logger.info (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)

  console.info
    [2023-06-17T02:16:35.378Z] INFO (PluginLedgerConnectorFabric): Installing web services for plugin @hyperledger/cactus-plugin-ledger-connector-fabric...

      at Logger.info (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)

  console.info
    [2023-06-17T02:16:35.379Z] INFO (PluginLedgerConnectorFabric): Installed web services for plugin @hyperledger/cactus-plugin-ledger-connector-fabric OK {
      endpoints: [
        DeployContractGoSourceEndpointV1 { opts: [Object], log: [Logger] },
        DeployContractEndpointV1 { opts: [Object], log: [Logger] },
        RunTransactionEndpointV1 { opts: [Object], log: [Logger] },
        GetTransactionReceiptByTxIDEndpointV1 {
          opts: [Object],
          log: [Logger]
        },
        GetBlockEndpointV1 { opts: [Object], log: [Logger] },
        GetPrometheusExporterMetricsEndpointV1 {
          opts: [Object],
          log: [Logger]
        }
      ]
    }

      at Logger.info (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)

  console.error
    [2023-06-17T02:16:35.436Z] ERROR (DeployContractEndpointV1): DeployContractEndpointV1#handleRequest() failed to serve contract deploy request Error: All configured authentication methods failed
        at doNextAuth (/****/cacti/node_modules/ssh2/lib/client.js:803:21)
        at tryNextAuth (/****/cacti/node_modules/ssh2/lib/client.js:993:7)
        at USERAUTH_FAILURE (/****/cacti/node_modules/ssh2/lib/client.js:373:11)
        at 51 (/****/cacti/node_modules/ssh2/lib/protocol/handlers.misc.js:337:16)
        at Protocol.onPayload (/****/cacti/node_modules/ssh2/lib/protocol/Protocol.js:2025:10)
        at AESGCMDecipherBinding.decrypt (/****/cacti/node_modules/ssh2/lib/protocol/crypto.js:1086:26)
        at Protocol.parsePacket [as _parse] (/****/cacti/node_modules/ssh2/lib/protocol/Protocol.js:1994:25)
        at Protocol.parse (/****/cacti/node_modules/ssh2/lib/protocol/Protocol.js:293:16)
        at Socket.<anonymous> (/****/cacti/node_modules/ssh2/lib/client.js:713:21)
        at Socket.emit (node:events:513:28)
        at addChunk (node:internal/streams/readable:324:12)
        at readableAddChunk (node:internal/streams/readable:297:9)
        at Socket.Readable.push (node:internal/streams/readable:234:10)
        at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
      level: 'client-authentication'
    }

      48 |
      49 |   public error(...msg: unknown[]): void {
    > 50 |     this.backend.error(...msg);
         |                  ^
      51 |   }
      52 |
      53 |   public warn(...msg: unknown[]): void {

      at Logger.error (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)
      at Logger.error (packages/cactus-common/src/main/typescript/logging/logger.ts:50:18)
      at DeployContractEndpointV1.handleRequest (packages/cactus-plugin-ledger-connector-fabric/src/main/typescript/deploy-contract/deploy-contract-endpoint-v1.ts:99:16)

 FAIL  packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts (142.123 s)
  ● client sends rollback message at the end of the protocol

    Request failed with status code 500

      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:269:11)

  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'stop')

      875 |   await fabricLedger.stop();
      876 |   await fabricLedger.destroy();
    > 877 |   await besuTestLedger.stop();
          |                        ^
      878 |   await besuTestLedger.destroy();
      879 |
      880 |   await pluginSourceGateway.database?.destroy();

      at Object.<anonymous> (packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts:877:24)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        142.187 s
Ran all test suites matching /packages\/cactus-plugin-odap-hermes\/src\/test\/typescript\/integration\/odap-rollback.test.ts/i.
Jest did not exit one second after the test run has completed.
github-actions[bot] commented 1 year ago

This PR/issue depends on: