IBM / todo-list-fabricV1

A todo list application using Hyperledger Fabric V1 as a data source
https://developer.ibm.com/code/patterns/create-a-to-do-list-app-using-blockchain/
Apache License 2.0
107 stars 64 forks source link

Error when running install-chaincode.js #13

Open deepanair opened 6 years ago

deepanair commented 6 years ago

Env: Go: 1.9.2 windows/amd64 Node: v6.2.0 Docker: 17.09.0-ce Docker-Compose: 1.16.1

I get the following error when running "node test/integration/e2e/install-chaincode.js".

Prior to executing the .js script, I ran the command to copy all the files to example_cc. [cp todo-list-fabric-server/chaincode/* fabric-sdk-node/test/fixtures/src/github.com/example_cc/]

error: [Peer.js]: GRPC client got an error response from the peer "grpc://localhost:7051". Error: Illegal file detected in payload: "src\github.com\example_cc\account.go" at C:\Users\pilla\to-do\todo-list-fabricV1\fabric-sdk-node\node_modules\grpc\src\client.js:554:15 error: [Chain.js]: Chain-sendPeersProposal - Promise is rejected: Error: Illegal file detected in payload: "src\github.com\example_cc\account.go" at C:\Users\pilla\to-do\todo-list-fabricV1\fabric-sdk-node\node_modules\grpc\src\client.js:554:15 error: [Peer.js]: GRPC client got an error response from the peer "grpc://localhost:7056". Error: Illegal file detected in payload: "src\github.com\example_cc\account.go" at C:\Users\pilla\to-do\todo-list-fabricV1\fabric-sdk-node\node_modules\grpc\src\client.js:554:15 error: [Chain.js]: Chain-sendPeersProposal - Promise is rejected: Error: Illegal file detected in payload: "src\github.com\example_cc\account.go" at C:\Users\pilla\to-do\todo-list-fabricV1\fabric-sdk-node\node_modules\grpc\src\client.js:554:15 error: [install-chaincode]: install proposal

ljbennett62 commented 6 years ago

@ishangulhane - can you take a look at this - tx

ishangulhane commented 6 years ago

@deepanair The code is working fine for me. Please try troubleshooting and run the steps again from start. From the above error message, it seems like the fabric network is down. I have attached the log file from my latest run. logs.txt

deepanair commented 6 years ago

When I ran "docker ps" this is what it shows. Does anything standout as unusual here? $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 88f7df44cb8c hyperledger/fabric-peer "peer node start -..." 7 hours ago Up 7 hours 0.0.0.0:8056->7051/tcp, 0.0.0.0:8058->7053/tcp peer3

b784e7f48243 hyperledger/fabric-peer "peer node start -..." 7 hours ago Up 7 hours 0.0.0.0:7056->7051/tcp, 0.0.0.0:7058->7053/tcp peer1

0941cb04d2df hyperledger/fabric-peer "peer node start -..." 7 hours ago Up 7 hours 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer2

672bf5d09e55 hyperledger/fabric-peer "peer node start -..." 7 hours ago Up 7 hours 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0

518f3ea16dcb hyperledger/fabric-ca "sh -c 'fabric-ca-..." 7 hours ago Up 7 hours 0.0.0.0:8054->7054/tcp ca_peerOrg2

42567aaf5427 hyperledger/fabric-orderer "orderer" 7 hours ago Up 7 hours 0.0.0.0:7050->7050/tcp orderer0

6cd0bd5be4de couchdb "tini -- /docker-e..." 7 hours ago Up 7 hours 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb

321b1f508db3 hyperledger/fabric-ca "sh -c 'fabric-ca-..." 7 hours ago Up 7 hours 0.0.0.0:7054->7054/tcp ca_peerOrg1

deepanair commented 6 years ago

@ishangulhane - Also, I am running this on Windows 10 OS.

ishangulhane commented 6 years ago

@deepanair For Windows, you need to do additional settings. Please see the instructions on http://hyperledger-fabric.readthedocs.io/en/release/prereqs.html#windows-extras http://hyperledger-fabric.readthedocs.io/en/release/getting_started.html

Gxz-NGU commented 5 years ago

I got this problem. [root@localhost fabric-sdk-node]# node test/integration/e2e/instantiate-chaincode.js

info: Returning a new winston logger with default configurations
TAP version 13
#

***** End-to-end flow: instantiate chaincode *****
info: [Peer.js]: Peer.const - url: grpc://localhost:7051 options  grpc.ssl_target_name_override=peer0, grpc.default_authority=peer0
info: [Peer.js]: Peer.const - url: grpc://localhost:8051 options  grpc.ssl_target_name_override=peer2, grpc.default_authority=peer2
info: [crypto_ecdsa_aes]: This class requires a CryptoKeyStore to save keys, using the store: {"opts":{"path":"/root/.hfc-key-store"}}
info: [Client.js]: Successfully loaded user "admin" from local key value store
ok 1 Successfully loaded member from persistence
ok 2 Successfully enrolled user 'admin'
error: [Peer.js]: GRPC client got an error response from the peer "grpc://localhost:8051". Error: Timeout expired while starting chaincode end2end:v1(networkid:dev,peerid:peer2,tx:b8fba6cbb8bf479a658c6585e1155fcd326aa977fddd7d3db5069ffbc79c0de1)
    at /usr/local/fabric/fabric-sdk-node/node_modules/grpc/src/node/src/client.js:434:17
error: [Chain.js]: Chain-sendPeersProposal - Promise is rejected: Error: Timeout expired while starting chaincode end2end:v1(networkid:dev,peerid:peer2,tx:b8fba6cbb8bf479a658c6585e1155fcd326aa977fddd7d3db5069ffbc79c0de1)
    at /usr/local/fabric/fabric-sdk-node/node_modules/grpc/src/node/src/client.js:434:17
error: [Peer.js]: GRPC client got an error response from the peer "grpc://localhost:7051". Error: Timeout expired while starting chaincode end2end:v1(networkid:dev,peerid:peer0,tx:b8fba6cbb8bf479a658c6585e1155fcd326aa977fddd7d3db5069ffbc79c0de1)
    at /usr/local/fabric/fabric-sdk-node/node_modules/grpc/src/node/src/client.js:434:17
error: [Chain.js]: Chain-sendPeersProposal - Promise is rejected: Error: Timeout expired while starting chaincode end2end:v1(networkid:dev,peerid:peer0,tx:b8fba6cbb8bf479a658c6585e1155fcd326aa977fddd7d3db5069ffbc79c0de1)
    at /usr/local/fabric/fabric-sdk-node/node_modules/grpc/src/node/src/client.js:434:17
error: [install-chaincode]: instantiate proposal was bad
error: [install-chaincode]: instantiate proposal was bad
not ok 3 Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
  ---
    operator: fail
    at: hfc.newDefaultKeyValueStore.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:228:6)
    stack: |-
      Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
          at Test.assert [as _assert] (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:224:54)
          at Test.bound [as _assert] (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:76:32)
          at Test.fail (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:317:10)
          at Test.bound [as fail] (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:76:32)
          at hfc.newDefaultKeyValueStore.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:228:6)
          at process._tickCallback (internal/process/next_tick.js:103:7)
  ...
not ok 4 Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting... at hfc.newDefaultKeyValueStore.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:229:10) at process._tickCallback (internal/process/next_tick.js:103:7)
  ---
    operator: fail
    at: hfc.newDefaultKeyValueStore.then.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:246:5)
    stack: |-
      Error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
          at hfc.newDefaultKeyValueStore.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:229:10)
          at process._tickCallback (internal/process/next_tick.js:103:7)
          at Test.assert [as _assert] (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:224:54)
          at Test.bound [as _assert] (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:76:32)
          at Test.fail (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:317:10)
          at Test.bound [as fail] (/usr/local/fabric/fabric-sdk-node/node_modules/tape/lib/test.js:76:32)
          at hfc.newDefaultKeyValueStore.then.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:246:5)
          at process._tickCallback (internal/process/next_tick.js:103:7)
  ...
info: [install-chaincode]: Disconnecting the event hub
info: [install-chaincode]: Disconnecting the event hub
not ok 5 Error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting... at hfc.newDefaultKeyValueStore.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:229:10) at process._tickCallback (internal/process/next_tick.js:103:7)
  ---
    operator: error
    expected: |-
      undefined
    actual: |-
      [Error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
    at hfc.newDefaultKeyValueStore.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:229:10)
    at process._tickCallback (internal/process/next_tick.js:103:7)]
    at: Test.onetime (/usr/local/fabric/fabric-sdk-node/node_modules/onetime/index.js:22:12)
    stack: |-
      Error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
          at hfc.newDefaultKeyValueStore.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:229:10)
          at process._tickCallback (internal/process/next_tick.js:103:7)
          at hfc.newDefaultKeyValueStore.then.then.then.then.then (/usr/local/fabric/fabric-sdk-node/test/integration/e2e/instantiate-chaincode.js:247:9)
          at process._tickCallback (internal/process/next_tick.js:103:7)
  ...

1..5
# tests 5
# pass  2
# fail  3