What is Benchmark error code 4 in Hyperledger Caliper - node.js

error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Could not parse enrollment response [Client sent an HTTP request to an HTTPS server.
] as JSON due to error [SyntaxError: Unexpected token C in JSON at position 0], stack=Error: Could not parse enrollment response [Client sent an HTTP request to an HTTPS server.
] as JSON due to error [SyntaxError: Unexpected token C in JSON at position 0]
at IncomingMessage.response.on (F:\SE\3rd_Year\FYP\Blockchain\hyperledger-template\hyperledger-caliper\node_modules\fabric-client\node_modules\fabric-ca-client\lib\FabricCAClient.js:475:21)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
2020.06.06-23:24:43.152 error [caliper] [caliper-engine] Error while performing "init" step: Error: Couldn't enroll Patient's registrar or set it as user context: Could not parse enrollment response [Client sent an HTTP request to an HTTPS server.
] as JSON due to error [SyntaxError: Unexpected token C in JSON at position 0]
2020.06.06-23:24:43.153 info [caliper] [caliper-engine] Executed "init" step in 0.527 seconds
2020.06.06-23:24:43.153 info [caliper] [caliper-engine] Network configuration attribute "caliper.command.end" is not present, skipping end command
2020.06.06-23:24:43.154 error [caliper] [cli-launch-master] Benchmark failed with error code 4
This is the output of the bash. I have no idea what causes this. My network has 3 organizations with 2 peers each and one orderer. And I have edited the fabic-node.yaml file to match the requirements.
IF anyone has any suggestions on what to do im all ears. Thank you

Basically, error code 4 is when you try to initialize connection with blockchain (SUT) but failed, error code 5 is when you fail to install smart contract and error code 6 is for other errors (e.g configuration)

Related

Azure - nodejs serverless function throwing error Error: 13 INTERNAL: Failed to parse server response

I am getting the below expeception, my node serverless function is throwing exception however many time it works correctly, when I check failed request, these exceptions are found.
Exception while executing function: Functions.createParticipantUserEntry node exited with code 1
at Object.module.exports.exports.createStatusError (/azure-functions-host/workers/node/worker-bundle.js:980:15),
details: 'Failed to parse server response',LanguageWorkerConsoleLog[error]
Worker 78afd559-7c19-4b0d-9a60-9a3039049fe2 uncaught exception: Error: Error: 13 INTERNAL: Failed to parse server response
at ClientDuplexStream.<anonymous> (/azure-functions-host/workers/node/worker-bundle.js:18483:19)
at ClientDuplexStream.emit (events.js:400:28)
at ClientDuplexStream._emitStatusIfDone (/azure-functions-host/workers/node/worker-bundle.js:7691:12)
at ClientDuplexStream._receiveStatus (/azure-functions-host/workers/node/worker-bundle.js:7668:8)
at Object.onReceiveStatus (/azure-functions-host/workers/node/worker-bundle.js:23065:15)
at InterceptingListener.module.exports.InterceptingListener._callNext (/azure-functions-host/workers/node/worker-bundle.js:22322:42)
at InterceptingListener.module.exports.InterceptingListener.onReceiveStatus (/azure-functions-host/workers/node/worker-bundle.js:22372:8)
at /azure-functions-host/workers/node/worker-bundle.js:22881:18
This issue is different than Error: 14, this one is Error 13 which is related to the response while Error 14 is related to connection to the azure portal from VS Code.

Getting error 4 when starting the hyperledger caliper benchmark

I created a functional network with 3 nodes and an orderer using the hyperleger fabric, in which I can carry out the communication between all nodes, executing existing operations in smart contracts. This network does not have TLS validation between nodes. The cryptographic material was created in one of the nodes and distributed among the other nodes in the network.
Now I'm trying to check the performance of the network using the hyperledger caliper. I created the test file, the network file and the other files needed to perform the performance evaluation, however, I am getting Error 4 in return.
Someone could help me, I am stuck on this problem for a few weeks and I don't see how to solve
it.
2021.01.07-01:58:10.942 info [caliper] [cli-launch-manager] Set workspace path: /home/ubuntu/caliper/monitor-benchmark
2021.01.07-01:58:10.944 info [caliper] [cli-launch-manager] Set benchmark configuration path: /home/ubuntu/caliper/monitor-benchmark/config.yaml
2021.01.07-01:58:10.944 info [caliper] [cli-launch-manager] Set network configuration path: /home/ubuntu/caliper/monitor-benchmark/net.yaml
2021.01.07-01:58:10.944 info [caliper] [cli-launch-manager] Set SUT type: fabric
2021.01.07-01:58:10.978 info [caliper] [benchmark-validator] No observer specified, will default to `none`
2021.01.07-01:58:10.978 info [caliper] [caliper-engine] Starting benchmark flow
2021.01.07-01:58:11.518 info [caliper] [fabric-connector] Initializing gateway connector compatible with installed SDK: 1.4.14
2021.01.07-01:58:11.651 info [caliper] [connectors/v1/fabric-gateway] Creating new InMemoryWallets for organizations
2021.01.07-01:58:11.664 info [caliper] [caliper-engine] Network configuration attribute "caliper.command.start" is not present, skipping start command
2021.01.07-01:58:11.665 info [caliper] [connectors/v1/fabric-gateway] Fabric SDK version: 1.4.14; TLS: none
2021-01-07T01:58:12.118Z - error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 192.169.0.4:7054], stack=Error: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 192.169.0.4:7054]
at ClientRequest.request.on (/home/ubuntu/caliper/monitor-benchmark/node_modules/fabric-ca-client/lib/FabricCAClient.js:487:12)
at ClientRequest.emit (events.js:198:13)
at Socket.socketErrorListener (_http_client.js:401:9)
at Socket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
2021.01.07-01:58:12.119 error [caliper] [caliper-engine] Error while performing "init" step: Error: Couldn't enroll Org1's registrar or set it as user context: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 192.169.0.4:7054]
2021.01.07-01:58:12.120 info [caliper] [caliper-engine] Executed "init" step in 0.456 seconds
2021.01.07-01:58:12.120 info [caliper] [caliper-engine] Network configuration attribute "caliper.command.end" is not present, skipping end command
2021.01.07-01:58:12.120 error [caliper] [cli-launch-manager] Benchmark failed with error code 4
If necessary, I make the configuration files available to help find the cause of the problem.
From the errors shown above, it looks like a credentials issue.
I would recommend moving up to using the v2 fabric connector that is present in the most recent (0.4.2) Caliper release. It is based on the use of an explicit caliper configuration file that references Fabric Common Connection Profiles. There is a tutorial present in the Caliper documentation that should help you create the required resources, currently accessible at https://hyperledger.github.io/caliper/v0.4.2/fabric-tutorial/tutorials-fabric-existing/

Dialogflow NodeJS library issue

I'm working on a dialogflow POC where I'm trying to invoke the v2 API provided by DialogFlow. While trying the NodeJS code example provided here, I'm getting the below error
{ Error: EHOSTUNREACH undefined: Getting metadata from plugin failed with error: request to https://www.googleapis.com/oauth2/v4/token failed, reason: connect EHOSTUNREACH 0.0.38.172:80 - Local (192.168.0.103:51468)
at Object.callErrorFromStatus (/Users/devuser/Development/workspaces/df-poc/node_modules/#grpc/grpc-js/build/src/call.js:30:26)
at Http2CallStream.call.on (/Users/devuser/Development/workspaces/df-poc/node_modules/#grpc/grpc-js/build/src/client.js:96:33)
at Http2CallStream.emit (events.js:203:15)
at process.nextTick (/Users/devuser/Development/workspaces/df-poc/node_modules/#grpc/grpc-js/build/src/call-stream.js:75:22)
at process._tickCallback (internal/process/next_tick.js:61:11)
code: 'EHOSTUNREACH',
details:
'Getting metadata from plugin failed with error: request to https://www.googleapis.com/oauth2/v4/token failed, reason: connect EHOSTUNREACH 0.0.38.172:80 - Local (192.168.0.103:51468)',
metadata: Metadata { internalRepr: Map {}, options: {} } }
I have imported GOOGLE_APPLICATION_CREDENTIALS and point the environment variable to the credentials. The invocation works fine if I try the REST API route with the Authorization header.
Kindly let me know if there is something which I'm missing here.
This means EHOST (the remote host of the files you are requesting) are unreachable. They are either down, or your computer cannot access them due to some other restriction, such as location, which can be solved with a VPN.

Hyperledger Fabric peer instantiate chaincode error

I am getting this error while trying to instantiate chaincode on peer1 of org1.
NodeJS console error :
Failed to send Proposal and receive all good ProposalResponse Failed
to instantiate. cause:Failed to send Proposal and receive all good
ProposalResponse (node:25005) UnhandledPromiseRejectionWarning: Error:
Failed to instantiate. cause:Failed to send Proposal and receive all
good ProposalResponse
Blockchain console error :
ERRO 692 [[e9585782 PUT_STATE ERROR]]No ledger context for
%!!(MISSING)s(MISSING). Sending %!!(MISSING)s(MISSING) ERRO 6a2
[bloqchannel][e9585782] failed to invoke chaincode name:"lscc" ,
error: timeout expired while executing transaction
I am using Hyperledger Fabric 1.1 and Hyperledger fabric node SDK.
The nodeJS version is 8.11.2.
Any help is appreciated.

Hyperledger Fabric Errror : Query - Error: chaincode error (status: 500, message: Failed to get block number 1, error Entry not found in index

I am trying to execute balance-transfer application that ship in fabric-samples of hyperledger. Source code path git clone https://github.com/hyperledger/fabric-samples.git
All steps executed as below
Channel created Joined channel on Org1
Joined channel on Org2
Successfully Installed chaincode on organization org1
Successfully Installed chaincode on organization org2
but instantiate of chaincode operation is failing on peers.
Can anyone please help me to solve this issue. I am struggling from last one week. I am using docker container on ubuntu v16.
Error Log:
[2017-10-02 05:11:11.374] [DEBUG] Helper - [crypto_ecdsa_aes]: ecdsa signature: Signature {<br/>
r: <BN: 4824699f0a1d1a0fc696df545fb3379dffc6b46124619f53672359a6755bc7ff>,<br/>
s: <BN: 49fc91b2a7800eff5396053d4d8ff2683167a9e3f52ccc43228143f9b5741168>,<br/>
recoveryParam: 0 }
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: chaincode error (status: 500, message: Failed to get block number 1, error Entry not found in index)<br/>
at /home/02102017/fabric-samples/balance-transfer/node_modules/grpc/src/node/src/client.js:554:15<br/>
error: [Channel.js]: Failed Query block. Error: Error: chaincode error (status: 500, message: Failed to get block number 1, error Entry not found in index)<br/>
at /home/02102017/fabric-samples/balance-transfer/node_modules/grpc/src/node/src/client.js:554:15<br/>
[2017-10-02 05:11:11.472] [ERROR] Query - Error: chaincode error (status: 500, message: Failed to get block number 1, error Entry not found in index)<br/>
at /home/02102017/fabric-samples/balance-transfer/node_modules/grpc/src/node/src/client.js:554:15<br/>
Isssue resolve after increasing request-timeout in file fabric-samples-master/balance-transfer/node_modules/fabric-client/config/default.json
There is no need to overwrite fabric-samples-master/balance-transfer/node_modules/fabric-client/config/default.json. There is a open issue on JIRA https://jira.hyperledger.org/browse/FABN-884 regarding request timeout.
and For now as a workaround you could set it globally before making the call.
const temp = client.getConfigSetting('request-timeout');
client.setConfigSetting('request-timeout', 60000);
... make your call ...
client.setConfigSetting('request-timeout', temp);
Hope it will work for you.

Resources