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-socketio): fix protobuf.loadProtoFile is not a function #2712

Closed
petermetz opened this issue Sep 20, 2023 · 4 comments
Closed
Labels
good-first-issue Good for newcomers good-first-issue-300-advanced Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P4 Priority 4: Low Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Milestone

Comments

@petermetz
Copy link
Contributor

This is likely due to the protobufjs upgrades that we had to perform in order to address some security vulnerabilities in the recent past.

Full CI log file:

2023-09-20T18-39-57-cacti-ci-crash-connector-fabric-socketio-protobufjs-load-function-post-upgrade.log

Relevant Log Snippet:

2023-09-20T18:51:55.7396777Z   ● Fabric-SocketIO connector tests › Signining proposal and sending it to the ledger works
2023-09-20T18:51:55.7397120Z 
2023-09-20T18:51:55.7397589Z     TypeError: protobuf.loadProtoFile is not a function
2023-09-20T18:51:55.7397785Z 
2023-09-20T18:51:55.7398287Z       27 | function loadFabricProto(protoFilePath: string) {
2023-09-20T18:51:55.7398936Z       28 |   const fabricModuleProtoPath = require.resolve(protoFilePath);
2023-09-20T18:51:55.7401198Z     > 29 |   return protobuf.loadProtoFile(fabricModuleProtoPath).build();
2023-09-20T18:51:55.7401861Z          |                   ^
2023-09-20T18:51:55.7402307Z       30 | }
2023-09-20T18:51:55.7402642Z       31 |
2023-09-20T18:51:55.7402958Z       32 | /**
2023-09-20T18:51:55.7403200Z 
2023-09-20T18:51:55.7404461Z       at loadFabricProto (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/fabric-proto-serializers.ts:29:19)
2023-09-20T18:51:55.7406010Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/fabric-proto-serializers.ts:107:25)
2023-09-20T18:51:55.7407658Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/ServerPlugin.ts:25:1)
2023-09-20T18:51:55.7411311Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/common/core/bin/www.ts:33:1)
2023-09-20T18:51:55.7412967Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/public-api.ts:1:1)
2023-09-20T18:51:55.7414265Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/index.ts:1:1)
2023-09-20T18:51:55.7415695Z       at packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/integration/fabric-socketio-connector.test.ts:248:23
2023-09-20T18:51:55.7416707Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/integration/fabric-socketio-connector.test.ts:248:23)
2023-09-20T18:51:55.7417369Z 
2023-09-20T18:51:55.7417858Z   ● Fabric-SocketIO connector tests › Signining proposal with connector wallet keys work
2023-09-20T18:51:55.7418214Z 
2023-09-20T18:51:55.7418518Z     TypeError: protobuf.loadProtoFile is not a function
2023-09-20T18:51:55.7418823Z 
2023-09-20T18:51:55.7419284Z       27 | function loadFabricProto(protoFilePath: string) {
2023-09-20T18:51:55.7419833Z       28 |   const fabricModuleProtoPath = require.resolve(protoFilePath);
2023-09-20T18:51:55.7453864Z     > 29 |   return protobuf.loadProtoFile(fabricModuleProtoPath).build();
2023-09-20T18:51:55.7460140Z          |                   ^
2023-09-20T18:51:55.7467911Z       30 | }
2023-09-20T18:51:55.7468271Z       31 |
2023-09-20T18:51:55.7468647Z       32 | /**
2023-09-20T18:51:55.7469025Z 
2023-09-20T18:51:55.7469804Z       at loadFabricProto (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/fabric-proto-serializers.ts:29:19)
2023-09-20T18:51:55.7471235Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/fabric-proto-serializers.ts:107:25)
2023-09-20T18:51:55.7472532Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/ServerPlugin.ts:25:1)
2023-09-20T18:51:55.7473517Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/common/core/bin/www.ts:33:1)
2023-09-20T18:51:55.7474462Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/public-api.ts:1:1)
2023-09-20T18:51:55.7475280Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/index.ts:1:1)
2023-09-20T18:51:55.7476300Z       at packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/integration/fabric-socketio-connector.test.ts:248:23
2023-09-20T18:51:55.7477329Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/integration/fabric-socketio-connector.test.ts:248:23)
2023-09-20T18:51:55.7477770Z 
2023-09-20T18:51:55.7478491Z   ● Fabric-SocketIO connector tests › Monitoring for transaction sending works
2023-09-20T18:51:55.7478869Z 
2023-09-20T18:51:55.7479148Z     TypeError: protobuf.loadProtoFile is not a function
2023-09-20T18:51:55.7479390Z 
2023-09-20T18:51:55.7479839Z       27 | function loadFabricProto(protoFilePath: string) {
2023-09-20T18:51:55.7481485Z       28 |   const fabricModuleProtoPath = require.resolve(protoFilePath);
2023-09-20T18:51:55.7482362Z     > 29 |   return protobuf.loadProtoFile(fabricModuleProtoPath).build();
2023-09-20T18:51:55.7483118Z          |                   ^
2023-09-20T18:51:55.7483994Z       30 | }
2023-09-20T18:51:55.7484238Z       31 |
2023-09-20T18:51:55.7484453Z       32 | /**
2023-09-20T18:51:55.7484602Z 
2023-09-20T18:51:55.7485301Z       at loadFabricProto (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/fabric-proto-serializers.ts:29:19)
2023-09-20T18:51:55.7487319Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/fabric-proto-serializers.ts:107:25)
2023-09-20T18:51:55.7488546Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/connector/ServerPlugin.ts:25:1)
2023-09-20T18:51:55.7489466Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/common/core/bin/www.ts:33:1)
2023-09-20T18:51:55.7490238Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/public-api.ts:1:1)
2023-09-20T18:51:55.7490985Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/index.ts:1:1)
2023-09-20T18:51:55.7491786Z       at packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/integration/fabric-socketio-connector.test.ts:248:23
2023-09-20T18:51:55.7492673Z       at Object.<anonymous> (packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/integration/fabric-socketio-connector.test.ts:248:23)
2023-09-20T18:51:55.7493033Z 

cc: @izuru0 @takeutak @outSH

@petermetz petermetz added good-first-issue Good for newcomers ConnectionChain Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. good-first-issue-300-advanced Tests Anything related to tests be that automatic or manual, integration or unit, etc. P4 Priority 4: Low labels Sep 20, 2023
@petermetz petermetz added this to the vT.B.D milestone Sep 20, 2023
@outSH
Copy link
Contributor

outSH commented Sep 21, 2023

@petermetz I've seen this error too but I'd propose to simply ignore it since fabric-socketio connector is about to be removed anyway (PR https://github.com/hyperledger/cacti/pull/2645)

@Yogesh01000100
Copy link
Contributor

@petermetz @outSH can you tell how can I use the cactus for my project without fabric-socketio connector, is there any new connector going to be released?

@outSH
Copy link
Contributor

outSH commented Nov 2, 2023

@petermetz
Copy link
Contributor Author

@petermetz I've seen this error too but I'd propose to simply ignore it since fabric-socketio connector is about to be removed anyway (PR #2645)

@outSH Oh, OK, then I'll close this now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers good-first-issue-300-advanced Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P4 Priority 4: Low Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Projects
None yet
Development

No branches or pull requests

3 participants