0

I was trying to make fabric network with 3 orgs(each has 3 peers) and 2 orderer nodes working with kafka&zookeeper but when I up orderer and check log there are errors like "Failed to initialize local MSP: Setup error: nil conf reference" after make localMSP.

|──directories
|     └──────artifacts
|     |   └──────channel.tx
|     |   └──────genesis.block
|     |
|     └──────bin
|     |   └──────crypto-config
|     |   |      └──────...
|     |   └──────...
|     |
|     └──────network
|         └──────docker-compose-mq.yaml
|         └──────docker-compose-orderer.yaml

docker-compose-mq.yaml

version: '2'

networks:
  blockchain_network:

services:
  kafka0:
    container_name: kafka0.example.com
    image: hyperledger/fabric-kafka:0.4.14
    restart: always
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
      - KAFKA_MESSAGE_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_REPLICA_FETCH_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
      - KAFKA_BROKER_ID=0
      - KAFKA_MIN_INSYNC_REPLICAS=2
      - KAFKA_DEFAULT_REPLICATION_FACTOR=3
    ports:
      - '9092'
    networks:
      - blockchain_network

  kafka1:
    container_name: kafka1.example.com
    image: hyperledger/fabric-kafka:0.4.14
    restart: always
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
      - KAFKA_MESSAGE_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_REPLICA_FETCH_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
      - KAFKA_BROKER_ID=1
      - KAFKA_MIN_INSYNC_REPLICAS=2
      - KAFKA_DEFAULT_REPLICATION_FACTOR=3
    ports:
      - '9092'
    networks:
      - blockchain_network

  kafka2:
    container_name: kafka2.example.com
    image: hyperledger/fabric-kafka:0.4.14
    restart: always
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
      - KAFKA_MESSAGE_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_REPLICA_FETCH_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
      - KAFKA_BROKER_ID=2
      - KAFKA_MIN_INSYNC_REPLICAS=2
      - KAFKA_DEFAULT_REPLICATION_FACTOR=3
    ports:
      - '9092'
    networks:
      - blockchain_network

  kafka3:
    container_name: kafka3.example.com
    image: hyperledger/fabric-kafka:0.4.14
    restart: always
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
      - KAFKA_MESSAGE_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_REPLICA_FETCH_MAX_BYTES=103809024 # 99 * 1024 * 1024 B
      - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
      - KAFKA_BROKER_ID=3
      - KAFKA_MIN_INSYNC_REPLICAS=2
      - KAFKA_DEFAULT_REPLICATION_FACTOR=3
    ports:
      - '9092'
    networks:
      - blockchain_network

  zookeeper0:
    container_name: zookeeper0
    image: hyperledger/fabric-zookeeper:0.4.14
    restart: always
    ports:
      - '2181'
      - '2888'
      - '3888'
    environment:
      - ZOO_MY_ID=1
      - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888
    networks:
    - blockchain_network

  zookeeper1:
    container_name: zookeeper1
    image: hyperledger/fabric-zookeeper:0.4.14
    restart: always
    ports:
      - '2181'
      - '2888'
      - '3888'
    environment:
      - ZOO_MY_ID=2
      - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888
    networks:
    - blockchain_network

  zookeeper2:
    container_name: zookeeper2
    image: hyperledger/fabric-zookeeper:0.4.14
    restart: always
    ports:
      - '2181'
      - '2888'
      - '3888'
    environment:
      - ZOO_MY_ID=3
      - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888
    networks:
    - blockchain_network

docker-compose-orderer.yaml

version: '2'
networks:
  blocckchain_network:

services:
  orderer0.example.com:
    container_name: orderer0.example.com
    image: hyperledger/fabric-orderer:1.4.0
    environment:
      - FABRIC_LOGGING_SPEC=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
      - ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
      - ORDERER_KAFKA_VERBOSE=true
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    ports:
      - 7050:7050
    networks:
      - blocckchain_network
    volumes:
        - ../artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
        - ../bin/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp:/var/hyperledger/orderer/msp
        - ../bin/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls:/var/hyperledger/orderer/tls

  orderer1.example.com:
    container_name: orderer1.example.com
    image: hyperledger/fabric-orderer:1.4.0
    environment:
      - FABRIC_LOGGING_SPEC=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
      - ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
      - ORDERER_KAFKA_VERBOSE=true
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    ports:
      - 8050:7050
    networks:
      - blocckchain_network
    volumes:
        - ../artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
        - ../bin/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp:/var/hyperledger/orderer/msp
        - ../bin/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls:/var/hyperledger/orderer/tls

nam
  • 15
  • 5

2 Answers2

0

I have seen very similar errors in my Orderer and Peers logs and did a lot of checking of Volume mapping but the solution for me was to delete Fabric 1.4.2 docker images and replace them with 1.4.3. (Making sure that the 1.4.3 images also have the tag "latest".

The reason for the error is a new 1.4.3 feature regarding the Admin identity of a peer - it is explained here and here in other Stack Overflow posts.

R Thatcher
  • 5,550
  • 1
  • 7
  • 15
  • Thanks, I removed docker image and change them to fabric 1.4.3 image.then, it works now. – nam Oct 10 '19 at 14:51
0

Had the same message most of today. Working with someone else that had the network running and had confirmed it was my machine only with this error... turned out to be stale docker images.

This fix may/may not work for you but its one option if all else above fails.

Remove all/relevant docker images and start from fresh.

Docker images (verify image Ids) I'm using right now:

$ docker images

REPOSITORY                            TAG          IMAGE ID            CREATED             SIZE
dev-peer0.org1.example.com-docume...  latest       185ef6801c2b        9 minutes ago       165MB
hyperledger/fabric-couchdb            latest       d369d4eaa0fd        45 hours ago        261MB
hyperledger/fabric-tools              latest       18ed4db0cd57        2 months ago        1.55GB
hyperledger/fabric-ca                 latest       c18a0d3cc958        2 months ago        253MB
hyperledger/fabric-ccenv              latest       3d31661a812a        2 months ago        1.45GB
hyperledger/fabric-orderer            latest       b666a6ebbe09        2 months ago        173MB
hyperledger/fabric-peer               latest       fa87ccaed0ef        2 months ago        179MB
hyperledger/fabric-baseos             amd64-0.4.15 9d6ec11c60ff        7 months ago        145MB

docker images to list docker images

docker rmi [IMAGE_ID] to remove unwanted docker images (hint: remove any versions of the images above so new ones can be downloaded).

docker rmi -f [IMAGE_ID] If for any reason an image does not get removed, you can force remove it

Assuming your docker-compose.yml pulls images consistent with the above, it should work.

Rob Evans
  • 2,822
  • 1
  • 9
  • 15