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

CHANNEL CREATION FAILED: Error: Error: Failed to create the channel. #18

Closed
servntire opened this issue Jul 13, 2018 · 13 comments
Closed
Assignees

Comments

@servntire
Copy link

Getting error when running node createTradeApp.js

  • Docker containers are up and running.
  • Dependencies are correct.

screen shot 2018-07-14 at 12 41 57 am

@VRamakrishna
Copy link
Collaborator

Clearly the client.createChannel(...) failed, but it's hard to say what the problem was without more info. Can you paste the results of docker ps -a, and also attach the network log file (the default should be <root-folder>/network/logs/network.log)?

@VRamakrishna VRamakrishna self-assigned this Jul 13, 2018
@servntire
Copy link
Author

I'm executing the project as follows.
DIR network
./trade.sh up
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 090492aac76a hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 2 hours ago Up About a minute 0.0.0.0:7054->7054/tcp ca_peerExporterOrg d05185b04ef4 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 2 hours ago Up About a minute 0.0.0.0:10054->7054/tcp ca_peerRegulatorOrg e429e94a4896 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 2 hours ago Up About a minute 0.0.0.0:9054->7054/tcp ca_peerCarrierOrg d831241c9d4b hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 2 hours ago Up About a minute 0.0.0.0:8054->7054/tcp ca_peerImporterOrg 2ddcaca2ab34 hyperledger/fabric-peer:latest "peer node start" 2 hours ago Up About a minute 0.0.0.0:10055->6060/tcp, 0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp peer0.regulatororg.trade.com 7caba45fa694 hyperledger/fabric-peer:latest "peer node start" 2 hours ago Up About a minute 0.0.0.0:8055->6060/tcp, 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer0.importerorg.trade.com 7fdfdeb1d0e2 hyperledger/fabric-peer:latest "peer node start" 2 hours ago Up About a minute 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp, 0.0.0.0:7055->6060/tcp peer0.exporterorg.trade.com b8bf8698862e hyperledger/fabric-orderer:latest "orderer" 2 hours ago Up About a minute 0.0.0.0:7050->7050/tcp orderer.trade.com 44638dff878a hyperledger/fabric-peer:latest "peer node start" 2 hours ago Up About a minute 0.0.0.0:9055->6060/tcp, 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp peer0.carrierorg.trade.com

DIR middleware
node createTradeApp.js

screen shot 2018-07-14 at 2 38 28 am

screen shot 2018-07-14 at 2 38 05 am

NetworkLog
network.log

@VRamakrishna
Copy link
Collaborator

If you scroll down to the end of the network.log file, you'll see that the signature validations fail, most likely because of certificate/key mismatches. Please retry after starting from a clean slate:

  • Clear the contents of the network/client-certs/ folder.
  • Regenerate the crypto material and channel artifacts using ./trade.sh generate -c tradechannel in the network folder.
  • Restart the network by running ./trade.sh up.
  • Run the JS scripts in the middleware folder.

@servntire
Copy link
Author

I tried it again. The ca is getting exited. Earlier I solved it by replacing ORG_CA_PRIVATE_KEY manually into the docker-compose-e2e.yaml file

screen shot 2018-07-14 at 1 57 47 pm

Attaching the network log.
network.log

Looks like something is missing.

@VRamakrishna
Copy link
Collaborator

Did you run ./trade.sh generate -c tradechannel? That command is supposed to replace the variable with the generated key file location. Did you observe any errors when you ran the command?

@shalini-kad
Copy link

shalini-kad commented Jul 14, 2018

It was not replacing the place holders. OS X requires the extension to be explicitly specified. The So I added an empty string. Now it's properly generating the e2e-compose file.

screen shot 2018-07-14 at 2 25 22 pm

screen shot 2018-07-14 at 2 28 06 pm

But still the issue is existing.
screen shot 2018-07-14 at 2 29 55 pm

From network log, I assume it's related to certificate validation. Principal deserialization failure (the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" or policy.

Networklog
network.log

@servntire
Copy link
Author

Resolved the issue by clearing docker volumes and removing docker images.

screen shot 2018-07-14 at 3 08 44 pm

Error: status: 500, message: is not a valid endorsement system chaincode

Network Log
network.log

@VRamakrishna
Copy link
Collaborator

OK, I understand now. I tested the setup and application on Linux (Ubuntu), and in an Ubuntu Box on Windows using Vagrant.

@ldesrosi Do you have any tips to share for setup and runs on a Mac?

@servntire
Copy link
Author

@VRamakrishna Can you please check my previous comment also.

@VRamakrishna
Copy link
Collaborator

@servntire Yes, you needed to remove the chaincode images (I thought you hadn't crossed the channel creation stage, and the chaincode containers don't get built until the instantiation stage.)

It's hard to make out what the error is from the logs. Did you check whether all the containers are running using docker ps -a? Did some exit?

Your best best at this time is to reset and retry.

Remove the running containers:
docker kill $(docker ps -q)
docker rm $(docker ps -a -f status=exited -q)
Delete the chaincode images (if they exist): docker rmi $(docker images | grep "dev-" | awk '{print $3}')
Clear the contents of the network/client-certs folder.

Then restart the network and run the trade application.

Repeat the procedure a couple of times to ensure you are getting an identical error. If that happens, we can try to investigate.

Also, what's your platform? Looking at the paths, you seem to be running on a Windows machine using a Cygwin shell (or is it Git Bash)? Be warned that the setup was tested on Linux (Ubuntu). Even on Windows, we created VMs using VirtualBox and Vagrant. You can use the Vagrantfile bundled with the Fabric source: check out the devenv folder in your local clone of hyperledger/fabric.

@VRamakrishna
Copy link
Collaborator

Still seeing these issues? If not, can we close this out?

@VRamakrishna
Copy link
Collaborator

Closing due to inactivity.

@tomorenge
Copy link

am getting the same error while running node createTradeApp.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants