Skip to content

Instantly share code, notes, and snippets.

@mads6879
Last active March 12, 2022 23:03
Show Gist options
  • Save mads6879/f532d7a5ce432e63a3ea2098b7b75955 to your computer and use it in GitHub Desktop.
Save mads6879/f532d7a5ce432e63a3ea2098b7b75955 to your computer and use it in GitHub Desktop.
Hyperledger Fabric v2.0 Error Resolution

Fabric v2.2 network related

Error Cause Resolution
API error (404): network_test not found Components are at different network export COMPOSE_PROJECT_NAME=net
API error (404): network docker_test not found Possible mismatch in network mode in docker-compose.yaml or core.yaml Option 1 Change CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE variable in docker-compose-test-net.yaml file from ${COMPOSE_PROJECT_NAME}_test to docker_test. Verify that the NetworkMode in core.yaml is set to docker_test
API error (404): network docker_test not found docker-compose reading .env file for project name Option 2 Create a .env file in the test_network folder. Add COMPOSE_PROJECT_NAME=docker in .env file. Add .env file to the docker-compose commands in the network.sh file docker-compose --env-file ./.env
Channel cannot be created due to tcp connection error Conflicting docker images Check for any old docker images. Get new docker images after deleting old ones
FileNotFoundError: Errno 2 No such file or directory. Failed to execute script docker-compose docker-compose command throws error Try docker compose instead
Failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded Possibly applied capabilites in configtx.yaml dont match the fabric binaries Ensure the fabric binaries match the capabilites expected for the orderer
Unable to give network name in docker-compose docker-compose 1.28.5 needed curl -L https://github.com/docker/compose/releases/download/1.28.5/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose

Chaincode related

Dependencies
"fabric-contract-api": "^2.0.0"
"fabric-shim": "^2.0.0"

Error Cause Resolution
Chaincode invoke fails with "container exited with 254" Incorrect path or incorrect language flag specified when packaging the chaincode Specify the correct path and language when packing the chaincode When packaging with lifecycle commands, language is node while using deployCC in network.sh, the language is javascript
Could not assemble transaction: ProposalResponsePayloads do not match proposal response: version:1 response:<status:200 > Mismatch in the payloads returned by the peers Check if the same chaincode is installed and instantiated on all peers. The environment variables are set correctly for the peers. The output is same on all peers.
Failed to invoke backing implementation of 'InstallChaincode': could not build chaincode Network not available on VM Ensure that VM has network connectivity

Fabric client related (Gateway errors)

Dependencies
"fabric-ca-client": "^2.2.4"
"fabric-network": "^2.2.4"

Error Cause Resolution
Must have a valid mspId for gateway.connect mspId not found when adding wallet mspId is case-sensitive. Error was caused as mspID was used instead of mspId
Failed constructing descriptor of chaincode when trying to process the transaction Chaincode name mismatch The chaincode that's deployed and the chaincode that is being executed via network.getContract should have same name
sendPeersProposal: Promise is rejected: Error: chaincode with name chain-code-name already exists Chaincode was already instantiated on peers Install new version of the chaincode and then instantiate

npm related

Error Cause Resolution
post-install script not found or failed It's not possible to disable only postinstall scripts Run npm install by disabling all all scripts > $ npm install --ignore-scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment