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

Issues in running curl commands for the application module #54

Closed
kaliaanup opened this issue Feb 14, 2019 · 3 comments
Closed

Issues in running curl commands for the application module #54

kaliaanup opened this issue Feb 14, 2019 · 3 comments

Comments

@kaliaanup
Copy link

kaliaanup commented Feb 14, 2019

Hi

I ran the following curl command

curl -s -X POST http://localhost:4000/channel/join -H "authorization: Bearer auth-token"

I am getting the following error.

{"success":false,"message":"Cannot read property 'stack' of undefined"}

When I checked the error I am getting the following. Am I missing something.

Joining channel tradechannel
Successfully enrolled 'admin' user for org exporterorg
Successfully got the genesis block
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Cannot create ledger from genesis block, due to LedgerID already exists
at /home/akkalia/go/src/trade-finance-logistics/middleware/node_modules/fabric-client/lib/Peer.js:114:16
at /home/akkalia/go/src/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:586:7
Failed join attempt: TypeError: Cannot read property 'stack' of undefined
at Client.newDefaultKeyValueStore.then.then.then.then (/home/akkalia/go/src/trade-finance-logistics/middleware/join-channel.js:205:61)
at

@VRamakrishna
Copy link
Collaborator

It means that the peers have already joined the channel. Why were you retrying the command? The peer tried to instantiate another ledger with the same ID, so it threw an exception.

Can you read through the systems and protocol description in the book and try out the exercises while understanding the purpose of the different commands? Just pinging the application server with curl commands serves no purpose otherwise.

I agree that the application server could do with better error messaging, but there is a laundry list of ways in which Fabric can throw an exception, and handling each of them is a much longer exercise. The purpose of building the application server in this repo (and for the book) was just to demonstrate the most basic functionality. It is up to the reader to work on making that server more robust and user-friendly if they wish to.

@kaliaanup
Copy link
Author

Hi Venkat

Thanks.

I am new to the whole Hyperledger fabric and hence, I was blindly following the instructions. As of now my observation is that the instructions are not intuitive. It still needs more clarifications.

Anyways now I can confirm my setup is complete.

Regards
Anup

@VRamakrishna
Copy link
Collaborator

VRamakrishna commented Feb 15, 2019

If you have any specific comments on the non-intuitiveness, state them here. At least it'll be in the records for people to see, and I can try to update the READMEs. Can't do anything about the contents of the book, I'm afraid. Perhaps if there's a future edition....

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

2 participants