Azure on Kubernetes Service: Failed to set anchor peer(s) for the orderer and peer organizations on the specified channel.

ascii-c 31 Reputation points
2020-06-15T02:39:16.597+00:00

Hi,

I have encountered error executing the Setting anchor peer(s) command following the steps here.
https://video2.skills-academy.com/en-us/azure/blockchain/templates/hyperledger-fabric-consortium-azure-kubernetes-service

./azhlf channel setAnchorPeers -c $CHANNEL_NAME -p <anchorPeersList> -o $PEER_ORG_NAME -u $PEER_ADMIN_IDENTITY

edex_dev@Azure:~/azhlfTool$ ./azhlf channel setAnchorPeers -c $CHANNEL_NAME -p peer1 -o $PEER_ORG_NAME -u $PEER_ADMIN_IDENTITY  
Preparing anchor peers list...  
Retrieving channel's latest configuration block...  
2020-06-15T01:51:05.002Z - error: [Channel.js]: Channel:echannel received discovery error:access denied  
2020-06-15T01:51:05.003Z - error: [Channel.js]: Error: Channel:echannel Discovery error:access denied  
2020-06-15T01:51:05.748Z - error: [Channel.js]: Channel:echannel received discovery error:access denied  
2020-06-15T01:51:05.748Z - error: [Channel.js]: Error: Channel:echannel Discovery error:access denied  
2020-06-15T01:51:05.749Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Channel:echannel Discovery error:access denied  
Error: Unable to initialize channel. Attempted to contact 2 Peers. Last error was Error: Channel:echannel Discovery error:access denied  
    at Network._initializeInternalChannel (/home/edex_dev/azhlfTool/node_modules/fabric-network/lib/network.js:112:12)  
    at <anonymous>  
If no one peer joined the requested channel - provide --ordererOrg parameter to command.  
edex_dev@Azure:~/azhlfTool$ echo $CHANNEL_NAME  
echannel  
edex_dev@Azure:~/azhlfTool$ echo $PEER_ORG_NAME  
Org1  
edex_dev@Azure:~/azhlfTool$ echo $PEER_ADMIN_IDENTITY  
admin.Org1  

Prior to this, the I was unable to import organization connection profile, admin user identity, and MSP using

./azhlf adminProfile import fromAzure -o $ORDERER_ORG_NAME -g $ORDERER_ORG_RESOURCE_GROUP -s $ORDERER_ORG_SUBSCRIPTION
./azhlf connectionProfile import fromAzure -g $ORDERER_ORG_RESOURCE_GROUP -s $ORDERER_ORG_SUBSCRIPTION -o $ORDERER_ORG_NAME
./azhlf msp import fromAzure -g $ORDERER_ORG_RESOURCE_GROUP -s $ORDERER_ORG_SUBSCRIPTION -o $ORDERER_ORG_NAME

./azhlf adminProfile import fromAzure -g $PEER_ORG_RESOURCE_GROUP -s $PEER_ORG_SUBSCRIPTION -o $PEER_ORG_NAME
./azhlf connectionProfile import fromAzure -g $PEER_ORG_RESOURCE_GROUP -s $PEER_ORG_SUBSCRIPTION -o $PEER_ORG_NAME
./azhlf msp import fromAzure -g $PEER_ORG_RESOURCE_GROUP -s $PEER_ORG_SUBSCRIPTION -o $PEER_ORG_NAME

edex_dev@Azure:~/azhlfTool$ ./azhlf connectionProfile import fromAzure -g $ORDERER_ORG_RESOURCE_GROUP -s $ORDERER_ORG_SUBSCRIPTION -o $ORDERER_ORG_NAME  
Trying to find requested resource in Azure Blockchain Service...  
Could not find Azure blockchain Hyperledger Fabric member OrdererOrg in resource group test-dev-hlf1  
Fallback to marketplace based application...  
Retrieving information about marketplace based application...  
Retrieving Connection profile from application...  
Connection profile for OrdererOrg imported to /home/edex_dev/azhlfTool/stores/connectionprofiles/OrdererOrg.json.  
edex_dev@Azure:~/azhlfTool$  

Please help pinpoint what is the problem.
Thank you.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,675 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Shruti Gupta 16 Reputation points
    2020-06-23T17:26:50.107+00:00

    Hi @asciic-7039 ,

    Thanks for reaching out to us!

    Before updating anchor peer for the peer organization on the channel, it is mandatory to join peer nodes in the channel as this command performs dynamic discovery of the network using peer nodes.

    Could you please confirm if you have joined peer nodes in the channel using the steps mentioned here, point no 4.

    If yes, then please reproduce the issue and run below steps to collect logs from the deployment. These steps can be run from azure cloud bash shell.

    1. curl https://raw.githubusercontent.com/Azure/Hyperledger-Fabric-on-Azure-Kubernetes-Service/master/scripts/AksHlfTroubleshooting.sh -o AksHlfTroubleshooting.sh; chmod 777 AksHlfTroubleshooting.sh
    2. ./AksHlfTroubleshooting.sh <myTemplateDeployment-SubscriptionID> <myTemplateDeployment-ResourceGroup> <myTemplateDeployment-aksClusterName> "peer"
      This command will create a zip file containing all the logs in the current directory.

    Once you collect the logs, please share with us to help you further.

    0 comments No comments

  2. ascii-c 31 Reputation points
    2020-06-24T01:42:27.093+00:00

    @ShrutiGupta-8111 I encountered this error though. This one detects the previous cluster, it should be westus now not australiasoutheast.

     Subscription 'dev-hlf1' not recognized.
     Subscription 'dev-hlf1' not found. Check the spelling and casing and try again.
     Connected to the cluster...
     Unable to connect to the server: dial tcp: lookup hlf01-hlf-aks-dns-0b869bc0.hcp.australiasoutheast.azmk8s.io on 168.63.129.16:53: no such host
     Unable to connect to the server: dial tcp: lookup hlf01-hlf-aks-dns-0b869bc0.hcp.australiasoutheast.azmk8s.io on 168.63.129.16:53: no such host
     Unable to connect to the server: dial tcp: lookup hlf01-hlf-aks-dns-0b869bc0.hcp.australiasoutheast.azmk8s.io on 168.63.129.16:53: no such host
     Collected organization metadata...
     Unable to connect to the server: dial tcp: lookup hlf01-hlf-aks-dns-0b869bc0.hcp.australiasoutheast.azmk8s.io on 168.63.129.16:53: no such host
     ./AksHlfTroubleshooting.sh: line 34: ((: i<=: syntax error: operand expected (error token is "<=")
     Collected hlf nodes logs...
     Unable to connect to the server: dial tcp: lookup hlf01-hlf-aks-dns-0b869bc0.hcp.australiasoutheast.azmk8s.io on 168.63.129.16:53: no such host
     Unable to connect to the server: dial tcp: lookup hlf01-hlf-aks-dns-0b869bc0.hcp.australiasoutheast.azmk8s.io on 168.63.129.16:53: no such host
     error: expected 'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]'.
     POD or TYPE/NAME is a required argument for the logs command
     See 'kubectl logs -h' for help and examples
     Collected nginx logs...
     Unable to connect to the server: dial tcp: lookup hlf01-hlf-aks-dns-0b869bc0.hcp.australiasoutheast.azmk8s.io on 168.63.129.16:53: no such host
     Collected ingress logs...
     adding: output/ (stored 0%)
     adding: output/ingress.output (deflated 57%)
     adding: output/metadata.output (deflated 31%)
     adding: output/nginx.output (deflated 57%)
     adding: output/nodes.output (deflated 52%)
    
    0 comments No comments

  3. Shruti Gupta 16 Reputation points
    2020-06-24T06:10:54.05+00:00

    Hi @asciic-7039 ,

    The script failed because of invalid argument inputs.

    Please specify subscription ID (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) instead of subscription
    name in the first argument to script.

    Regarding westus vs australiasoutheast cluster, the script reads the cluster as specified in third argument. Please verify that AKS cluster name passed to script is an intended cluster.

    Please let me know if you still face any issue while running the troubleshooting script.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.