Skip to content

Many issues when deploy a fabric 2.5.4 network using the playbooks in minikube #2659

@johannww

Description

@johannww

Describe the bug
When trying to deploy a Fabric 2.5.4 network I found a series of bugs and inconsistencies.

  1. The first bug happens at the fabric-genesis stage:
    - name: Create Value files for Genesis
    include_role:
    name: "{{ playbook_dir }}/../../shared/configuration/roles/create/job_component"
    vars:
    name: "{{ org.name | lower }}"
    component_ns: "{{ org.name | lower }}-net"
    component_name: "genesis"
    consensus: "{{ network.consensus }}"
    type: "fabric_genesis"


    ...
    bevel_alpine_version: latest
    fabric_tools_image: bevel-fabric-tools

    alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }}
    fabricTools: {{ docker_url }}/{{ fabric_tools_image }}

This issue is fixed with:

image:
  alpineUtils: {{ docker_url }}/bevel-alpine:{{ charts.bevel_alpine_version }}
  fabricTools: {{ docker_url }}/{{ charts.fabric_tools_image }}
  1. The fabric-genesis operation tries to update a helm repo. However, no repo is added by default:

So, I tried to add the bevel chart repo extensively mentioned in the documentation. It did not work

helm repo add bevel https://hyperledger.github.io/bevel
Error: looks like "https://hyperledger.github.io/bevel" is not a valid chart repository or cannot be reached: failed to fetch https://hyperl
edger.github.io/bevel/index.yaml : 404 Not Found

So I commented and it worked. I have finally executed the ./platforms/shared/configuration/site.yaml playbook.

    # update_repo_cache: true
  1. Now, I use the playbook platforms/hyperledger-fabric/configuration/add-new-channel.yaml to add a new channel. The bevel_alpine_version and fabric_tools_image appeared again, so I applied the same prior fix:
    fabricTools: {{ docker_url }}/{{ fabric_tools_image }}
    alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }}

I could successfully create the channel.

  1. I also tried to create a channel using the ./platforms/hyperledger-fabric/configuration/create-join-channel.yaml. However, this playbook seems to be outdated, considering the changes introduced by [fabric] Ansible decoupling for create/crypto/orderer role #1712

After commenting this nonexistent playbooks, there it was the problem related to the bevel_alpine_version and fabric_tools_image again:

fabricTools: {{ docker_url }}/{{ fabric_tools_image }}
alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }}

fabricTools: {{ docker_url }}/{{ fabric_tools_image }}
alpineUtils: {{ docker_url }}/bevel-alpine:{{ bevel_alpine_version }}

To Reproduce
Steps to reproduce the behavior:

  1. Build the bevel container
  2. Create a fabric 2.5.4 network file with gitops, vault, no proxy. Containing 2 orgs.
  3. Run the bevel container and execute:
mkdir build
# cp ./platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml build/network.yaml
cp ~/.kube/config build/config

# setup vault
docker run --network=host -p 8200:8200 --name vault hashicorp/vault:1.13.1
export VAULT_ADDR='http://192.168.25.5:8200'
export VAULT_TOKEN="hvs.vkv1OoBqgXgVDAIMmo2TskCB"
vault secrets enable -version=2 -path=secretsv2 kv

docker build -t hyperledger/bevel:johann .
docker run -it --rm --network=host -v $(pwd):/home/bevel \
    -w /home/bevel --name bevel hyperledger/bevel:johann /bin/bash
# EDIT the network.yaml file to set the correct values for your environment

# COMMANDS INSIDE THE CONTAINER
git config --global --add safe.directory /home/bevel
export PATH=/root/bin:$PATH
export KUBECONFIG=/home/bevel/build/config
export VAULT_ADDR='http://192.168.25.5:8200'
ajv validate -s ./platforms/network-schema.json -d ./build/network.yaml 

# GENERATES ISSUES 1 and 2:
ansible-playbook -vv ./platforms/shared/configuration/site.yaml \
    --inventory-file=./platforms/shared/inventory/ \
    -e "@./build/network.yaml" \
    -e 'ansible_python_interpreter=/usr/bin/python3'

# GENERATES ISSUE 3
ansible-playbook -vv ./platforms/hyperledger-fabric/configuration/add-new-channel.yaml \
    --inventory-file=./platforms/shared/inventory/ \
    -e "@./build/network.yaml" \
    -e 'ansible_python_interpreter=/usr/bin/python3'


# GENERATES ISSUE 4
ansible-playbook -vv ./platforms/hyperledger-fabric/configuration/create-join-channel.yaml \
    --inventory-file=./platforms/shared/inventory/ \
    -e "@./build/network.yaml" \
    -e 'ansible_python_interpreter=/usr/bin/python3'

Expected behavior
Fabric 2.5.4 network is created, before channel is created and successfully joined.

Screenshots
Issues:

  1. Image
    Image
  2. Image
    Image
  3. Image

Environment (please complete the following information):

  • arch linux
  • 6.12.21-1-lts

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfabricRelated to the Hyperledger Fabric DLT Platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions