Hyperledger fabric Error : mychannel received discovery error:access denied - hyperledger-fabric

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

First, delete files inside the wallet directory:
sudo rm -r * // inside wallet directory
node enrollAdmin.js && node registerUser.js
node query.js // you will get output

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

Make sure you have "mychannel" channel in network.

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

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.

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...

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

Related

Hyperledger Febric Error : Channel:mychannel received discovery error:access denied

I was trying to run fabric-samples/asset-transfer-basic/application-javascript/app.js file
but got discovery error.
It is showing discovery error after I gave command "node app.js"
Delete
user.id
appUser.id
identities from your /home/pritam/fabric-samples/asset-transfer-basic/application-javascript/wallet directory.
The error that occurred is already documented in the app.js file that exists under the asset-transfer-basic directory:
// NOTE: If you see kind an error like these:
/*
2020-08-07T20:23:17.590Z - error: [DiscoveryService]: send[mychannel] - Channel:mychannel received discovery error:access denied
******** FAILED to run the application: Error: DiscoveryService: mychannel error: access denied
OR
Failed to register user : Error: fabric-ca request register failed with errors [[ { code: 20, message: 'Authentication failure' } ]]
******** FAILED to run the application: Error: Identity not found in wallet: appUser
*/
// Delete the /fabric-samples/asset-transfer-basic/application-javascript/wallet directory
// and retry this application.
//
// The certificate authority must have been restarted and the saved certificates for the
// admin and application user are not valid. Deleting the wallet store will force these to be reset
// with the new certificate authority.

hyperledger explorer not starting with Fabcar app

Hyperledger Explorer is not starting with Fabcar sample application. I have configured config.json and change connection profile to fabcar. I am using default connection setting available in connection-profile/fabcar.jason.But while starting blockchain explorer it giving me below error.
2019-11-30T09:44:53.671Z - error: [Channel.js]: Error: 2 UNKNOWN: Stream removed
Error : Failed to connect client peer, please check the configuration and peer status
Did you start a network before? If so, try to remove the crypto-config and channel-artifacts folders and rerun. When you start a network should not be crypto material from other before

Error while running invoke.js in ibm blockchain platform using vscode?

I have been using IBM blockchain platform using vs code. Everything is working fine, I can connect to fabric local, but the main problem is while I run invoke.js
Connected to Fabric gateway.
2019-10-24T03:40:03.358Z - error: [Channel.js]: Channel:mychannel received discovery error:access denied
2019-10-24T03:40:03.358Z - error: [Channel.js]: Error: Channel:mychannel Discovery error:access denied
2019-10-24T03:40:03.358Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
Error processing transaction. Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
at Network._initializeInternalChannel (/home/cybrosys/VSCodeLocalNetwork/node_modules/fabric-network/lib/network.js:112:12)
Disconnect from Fabric gateway.
done

Error - chaincode exists

I'm getting this error when trying to start running my chaincode:
Command: composer network start -c adminCardLessor -n block-aviation-network -V 0.0.1 -A admin -C ./credentials/lessor/admin-pub.pem -f delete_me.card
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: chaincode exists block-aviation-network)
I successfully installed my chaincode on each of my peers but can seem to start it due to the above error...
Does anyone have any experience with this error or how to resolve it?
Because the chaincode already exists on the network, you can only upgrade it, because I am assuming the network is not starting because you made some changes. Look toward questions such as How to upgrade a chaincode after modification? and then try starting the network. This should solve your problem.

Hyperledger Composer: install error (Error: Error trying to start business network. Error: No valid responses from any peers.)

When I try to install business network on Fabric, I get the error:
Error: Error trying install business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 14 UNAVAILABLE: EOF
Response from attempted peer comms was an error: Error: 14 UNAVAILABLE: EOF
Logs of peer1 of org1:
Most likely, this is because of wrong setting up a Fabric. Can anybody tell me what I did wrong?
The problem is solved. I just had to configure TLS in peers like so:
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
And set valid key in CA-contaner configuration:
- FABRIC_CA_SERVER_TLS_KEYFILE=[Here path to key]
The same path must be specified after --ca.keyfile in command: field.
I was also getting similar error-
Installing business network. This may take a minute...
Error: Error trying install business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 14 UNAVAILABLE: Connect Failed
Command failed
The solution work for me is, I have to start the initial setup script commands as part of development environment installation.
$ ./startFabric.sh
$ ./createPeerAdminCard.sh
And then run the command to install the business network-
$ composer network install --card PeerAdmin#hlfv1 --archiveFile tutorial-network#0.0.1.bna
I had the same error, but my fault was wrong env value for
- CORE_PEER_LOCALMSPID=
in docker-compose.yaml for every peer.

Resources