Reputation: 53
i am getting error while i run the command node query.js in hypeledger-samples fabcar example.
root@ubcourt:/home/fabric-samples/fabcar/javascript# node query.js
Wallet path: /home/fabric-samples/fabcar/javascript/wallet 2019-08-03T08:45:31.027Z - error: [Channel.js]: Channel:mychannel received discovery error:access denied
2019-08-03T08:45:31.028Z - error: [Channel.js]: Error: Channel:mychannel Discovery error:access denied
2019-08-03T08:45:31.040Z - error: [Channel.js]: Channel:mychannel received discovery error:access denied
2019-08-03T08:45:31.040Z - error: [Channel.js]: Error: Channel:mychannel Discovery error:access denied
2019-08-03T08:45:31.042Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Channel:mychannel Discovery error:access denied at Channel._discover (/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:1272:11) at async Channel._initialize (/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:291:32) at async Channel.initialize (/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:244:14) at async Network._initializeInternalChannel (/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:105:5) at async Network._initialize (/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:130:3) at async Gateway.getNetwork (/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/gateway.js:287:3) at async main (/home/fabric-samples/fabcar/javascript/query.js:33:25) Failed to evaluate transaction: Error: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Channel:mychannel Discovery error:access denied at Channel._discover (/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:1272:11) at async Channel._initialize (/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:291:32) at async Channel.initialize (/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:244:14) at async Network._initializeInternalChannel (/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:105:5) at async Network._initialize (/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:130:3) at async Gateway.getNetwork (/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/gateway.js:287:3) at async main (/home/fabric-samples/fabcar/javascript/query.js:33:25)
Upvotes: 1
Views: 2135
Reputation: 899
this can happen due to the peer leaving the channel or some error related to it.
try to list the peers that are in the channel and see if yours is there
peer channel list
If not add again
peer join channel -b <my-channel-name>.block
Upvotes: 0
Reputation: 1360
try removing the wallet and re-enrolling the admin and user. In the /fabcar/javascript directory:
rm -r ./wallet
node enrollAdmin.js
node registerUser.js
node query.js
If that doesn't work, you can try the instructions in: https://hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html and stop the network (in the /first-network directory):
./byfn.sh down
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images | grep fabcar | awk '{print $3}')
Upvotes: 4