hyperledger-labs / minifabric

Do fabric network the right and easy way.
Apache License 2.0
302 stars 164 forks source link

Errors when standing up default network #79

Closed jebediahelliott closed 4 years ago

jebediahelliott commented 4 years ago

I'm using Ubuntu 20.04 via WSL2 and I'm suspicious that might be what is causing my issue. I'm getting errors when running minifab up.

jebediah@LAPTOP-JCOAIPDG:~/mywork
$ ./minifab up
./minifab: line 3: ifconfig: command not found
Minifab Execution Context:
    FABRIC_RELEASE=2.2.0
    CHANNEL_NAME=mychannel
    PEER_DATABASE_TYPE=golevel
    CHAINCODE_LANGUAGE=go
    CHAINCODE_NAME=simple
    CHAINCODE_VERSION=1.0
    CHAINCODE_INIT_REQUIRED=true
    CHAINCODE_PARAMETERS="init","a","200","b","300"
    CHAINCODE_PRIVATE=false
    CHAINCODE_POLICY=
    TRANSIENT_DATA=
    BLOCK_NUMBER=newest
    EXPOSE_ENDPOINTS=false
    CURRENT_ORG=org0.example.com
    HOST_ADDRESSES=
    WORKING_DIRECTORY: /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/c1fc46b4522403cc7f4e9a72da23916c7a417aacd87c2d2f5942580aa28cf48f
...
# Preparing for the following operations: *********************
  verify options, download images, generate certificates, start network, network status, channel create, channel join, anchor update, profile generation, cc install, cc approve, cc commit, cc initialize, discover
.................
# Running operation: ******************************************
  verify options
.
# Running operation: ******************************************
  download images
............
# Running operation: ******************************************
  generate certificates
................
# Create ca self signed certificate ***************************
  All items completed
    non-zero return code
    non-zero return code

# STATS *******************************************************
minifab: ok=72  failed=1

real    0m9.937s
user    0m9.556s
sys     0m1.376s

If I run minifab up a second time I get different errors

jebediah@LAPTOP-JCOAIPDG:~/mywork
$ ./minifab up
./minifab: line 3: ifconfig: command not found
Minifab Execution Context:
    FABRIC_RELEASE=2.2.0
    CHANNEL_NAME=mychannel
    PEER_DATABASE_TYPE=golevel
    CHAINCODE_LANGUAGE=go
    CHAINCODE_NAME=simple
    CHAINCODE_VERSION=1.0
    CHAINCODE_INIT_REQUIRED=true
    CHAINCODE_PARAMETERS="init","a","200","b","300"
    CHAINCODE_PRIVATE=false
    CHAINCODE_POLICY=
    TRANSIENT_DATA=
    BLOCK_NUMBER=newest
    EXPOSE_ENDPOINTS=false
    CURRENT_ORG=org0.example.com
    HOST_ADDRESSES=
    WORKING_DIRECTORY: /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/c1fc46b4522403cc7f4e9a72da23916c7a417aacd87c2d2f5942580aa28cf48f
...
# Preparing for the following operations: *********************
  verify options, download images, generate certificates, start network, network status, channel create, channel join, anchor update, profile generation, cc install, cc approve, cc commit, cc initialize, discover
.................
# Running operation: ******************************************
  verify options
.
# Running operation: ******************************************
  download images
............
# Running operation: ******************************************
  generate certificates
..
# Running operation: ******************************************
  start network
..........
# Create env file for all nodes *******************************
  All items completed

    AnsibleUndefinedVariable: 'dict object' has no attribute 'org0.example.com'
    AnsibleUndefinedVariable: 'dict object' has no attribute 'org1.example.com'

# STATS *******************************************************
minifab: ok=67  failed=1

real    0m11.621s
user    0m10.926s
sys     0m1.877s

And a third run will produce these errors

jebediah@LAPTOP-JCOAIPDG:~/mywork
$ ./minifab up
./minifab: line 3: ifconfig: command not found
Minifab Execution Context:
    FABRIC_RELEASE=2.2.0
    CHANNEL_NAME=mychannel
    PEER_DATABASE_TYPE=golevel
    CHAINCODE_LANGUAGE=go
    CHAINCODE_NAME=simple
    CHAINCODE_VERSION=1.0
    CHAINCODE_INIT_REQUIRED=true
    CHAINCODE_PARAMETERS="init","a","200","b","300"
    CHAINCODE_PRIVATE=false
    CHAINCODE_POLICY=
    TRANSIENT_DATA=
    BLOCK_NUMBER=newest
    EXPOSE_ENDPOINTS=false
    CURRENT_ORG=org0.example.com
    HOST_ADDRESSES=
    WORKING_DIRECTORY: /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/c1fc46b4522403cc7f4e9a72da23916c7a417aacd87c2d2f5942580aa28cf48f
...
# Preparing for the following operations: *********************
  verify options, download images, generate certificates, start network, network status, channel create, channel join, anchor update, profile generation, cc install, cc approve, cc commit, cc initialize, discover
.......
# Running operation: ******************************************
  verify options
.
# Running operation: ******************************************
  download images
............
# Running operation: ******************************************
  generate certificates
..
# Running operation: ******************************************
  start network
......
# Create env file for all nodes *******************************
  All items completed

[WARNING]: Failure using method (v2_runner_on_failed) in callback plugin
(<ansible.plugins.callback.minifab.CallbackModule object at 0x7fcec74f91c0>):
unsupported operand type(s) for +: 'dict_keys' and 'dict_keys'

# STATS *******************************************************
minifab: ok=53  failed=1

real    0m9.688s
user    0m9.234s
sys     0m1.483s

If I run minifab cleanup and then minifab up again, this pattern is repeated. I'm not sure if it's relevant, but I noticed that in the execution context my HOST_ADDRESSES does not have a value but in the youtube demo there is a value. Please let me know if there is any other information I can provide. Thanks!

litong01 commented 4 years ago

ubuntu 20.04 does not have ifconfig, install ifconfig using this command

sudo apt install net-tools

Then you should be ok.

litong01 commented 4 years ago

@jebediahelliott I think you can either do that or you should simply use the windows version of the minifabric which does not at all require you use ubuntu running on windows. Simply run the same command in a native windows prompt. You should be fine.

jebediahelliott commented 4 years ago

@litong01 Thank you, I was able to get things going using the windows prompt. I did discover that if there are any spaces in the names of the directory structure (C:\Users\Your Name\mywork) that you get errors. I did still have errors on the LInux side though, here is the output:

jebediah@LAPTOP-JCOAIPDG:~/mywork
$ ./minifab up
Minifab Execution Context:
    FABRIC_RELEASE=2.2.0
    CHANNEL_NAME=mychannel
    PEER_DATABASE_TYPE=golevel
    CHAINCODE_LANGUAGE=go
    CHAINCODE_NAME=simple
    CHAINCODE_VERSION=1.0
    CHAINCODE_INIT_REQUIRED=true
    CHAINCODE_PARAMETERS="init","a","200","b","300"
    CHAINCODE_PRIVATE=false
    CHAINCODE_POLICY=
    TRANSIENT_DATA=
    BLOCK_NUMBER=newest
    EXPOSE_ENDPOINTS=false
    CURRENT_ORG=org0.example.com
    HOST_ADDRESSES=172.24.72.16
    WORKING_DIRECTORY: /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/c1fc46b4522403cc7f4e9a72da23916c7a417aacd87c2d2f5942580aa28cf48f
...
# Preparing for the following operations: *********************
  verify options, download images, generate certificates, start network, network status, channel create, channel join, anchor update, profile generation, cc install, cc approve, cc commit, cc initialize, discover
.................
# Running operation: ******************************************
  verify options
.
# Running operation: ******************************************
  download images
............
# Running operation: ******************************************
  generate certificates
..........................................................................................................................................
# Use fabric tools container to create channel artifacts ******
  non-zero return code
  docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/etc/hyperledger/fabric/run/certtxgen.sh\": stat /etc/hyperledger/fabric/run/certtxgen.sh: no such file or directory": unknown.

# STATS *******************************************************
minifab: ok=201 failed=1

real    1m0.938s
user    0m58.282s
sys     0m8.544s
litong01 commented 4 years ago

@jebediahelliott that is a not supported env. You are running docker inside a windows virtual machine which always causes problem. Minifabric wont support that env. If you do have a real linux env, it will work just fine. Please close this issue. thanks.

jebediahelliott commented 4 years ago

Will do. Thanks for all of your help!