4

Getting the following error while running query.js of the fabric sample fabcar.

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
Bibek Koirala
  • 330
  • 6
  • 20
Ranjit Chavan
  • 47
  • 1
  • 6
  • Are there any errors in the Peer logs or the Order log - perhaps the channel was not created successfully? In your question you might want to cover the steps you took before the errors occurred, and list some info about your environment including the Fabric version you are using. – R Thatcher Aug 05 '19 at 10:51
  • This error also occurs when the peer you are with is not a participant in mychannel. – Prayag k Nov 26 '19 at 06:48

7 Answers7

13
  1. First, delete files inside the wallet directory:

    sudo rm -r *  // inside wallet directory
    
  2. node enrollAdmin.js && node registerUser.js
    
  3. node query.js  // you will get output 
    
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Debasis Das
  • 549
  • 3
  • 8
6

Did you follow the register and enroll step ?

node enrollAdmin.js && node registerUser.js && node query.js

If yes :

First delete the folder wallet.

In fabcar directory run : ./startFabric.sh javascript

Repeat the register and enroll step: node enrollAdmin.js && node registerUser.js && node query.js

jdc
  • 384
  • 4
  • 15
2

Make sure you have "mychannel" channel in network.

2

Just delete the ./wallet directory and execute app.js again.

ashkan96
  • 21
  • 2
0

1) Check whether you have executed the "node enrollAdmin.js" and "node registerUser.js" files.

2) Then check the wallet folder inside the directory "/fabric-samples/fabcar/javascript" if it contains 2 files "admin.id" and "user1.id".

3) Then just delete that 2 files and perform the 2 above mentioned file execution again. Then the error will be solved.

AVG
  • 36
  • 4
0

I solved the problem: Error message: [DiscoveryService]: send[mychannel] - Channel:mychannel received discovery error:access denied.

By fixing the chaincodeName and channelName values to be the correct values...

Russo
  • 2,186
  • 2
  • 26
  • 42
-1

This can also happen when the peer leaves 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 your channel is not listed, add again

peer join channel -b .block

here .block is you genesis block

Ismail
  • 1,188
  • 13
  • 31