Welcome to the Linux Foundation Forum!

Lab 4: Instantiat chaincode problem: peer container crash with Getting block information from block

Hello

I'm struggling with some errors after start to use couchdb, now everything seems to work well, I install the chaincode but when I try to instantiate it start to give me errors like

  1. $ peer chaincode install -n ccForAll -p github.com/sacc -v 1.0
  2. 2019-11-02 01:07:14.215 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
  3. 2019-11-02 01:07:14.240 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
  4. 2019-11-02 01:07:14.260 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
  5. 2019-11-02 01:07:14.261 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
  6. 2019-11-02 01:07:15.407 UTC [chaincodeCmd] install -> INFO 005 Installed remotely response:<status:200 payload:"OK" >
  7.  
  8. $ peer chaincode instantiate -n ccForAll -v 1.0 -o orderer.example.com:7050 -C allarewelcome -c '{"Args":["Mach","50"]}'
  9. Error: error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [allarewelcome] creator org [Org1MSP]

when I try to see if peers are in channel, it seems that they are not, maybe because of a container restart, but now the problem is bigger when I try to join channel I have this crach container problem :(

  1. $ docker exec -it peer0.org1.example.com bash
  2. # check first that we are not parte of the channel
  3. $ peer channel list
  4. # fetch genesis block
  5. $ peer channel fetch oldest allarewelcome.block -c allarewelcome --orderer orderer.example.com:7050
  6. # ls allarewelcome.block
  7. allarewelcome.block
  8. # setup CORE_PEER_MSPCONFIGPATH
  9. $ export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin\@org1.example.com/msp
  10. # add peer to channel
  11. $ peer channel join -b allarewelcome.block

logs

  1. peer1.org1.example.com | 2019-11-02 02:00:40.969 UTC [endorser] callChaincode -> INFO 028 [][137f1239] Entry chaincode: name:"cscc"
  2. peer1.org1.example.com | 2019-11-02 02:00:40.971 UTC [ledgermgmt] CreateLedger -> INFO 029 Creating ledger [allarewelcome] with genesis block
  3. peer1.org1.example.com | 2019-11-02 02:00:41.033 UTC [fsblkstorage] newBlockfileMgr -> INFO 02a Getting block information from block storage
  4. peer1.org1.example.com | panic: runtime error: invalid memory address or nil pointer dereference
  5. peer1.org1.example.com | panic: runtime error: invalid memory address or nil pointer dereference
  6. peer1.org1.example.com | [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xcecbb6]
  7. peer1.org1.example.com |
  8. peer1.org1.example.com | goroutine 310 [running]:
  9. peer1.org1.example.com | github.com/hyperledger/fabric/core/chaincode/shim.(*Handler).triggerNextState(0xc00053d320, 0x0, 0xc00053a4e0)
  10. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/handler.go:35 +0x26
  11. peer1.org1.example.com | github.com/hyperledger/fabric/core/chaincode/shim.(*Handler).handleTransaction.func1.1(0xc00053d320, 0xc0004ebeb0, 0xc00053a4e0)
  12. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/handler.go:247 +0x42
  13. peer1.org1.example.com | panic(0x106e340, 0x1e32280)
  14. peer1.org1.example.com | /opt/go/src/runtime/panic.go:513 +0x1b9
  15. peer1.org1.example.com | github.com/hyperledger/fabric/core/ledger/kvledger.(*Provider).openInternal(0xc0000beb80, 0xc000046dd0, 0xd, 0x0, 0x0, 0x0, 0x27)
  16. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/kvledger/kv_ledger_provider.go:157 +0xf5
  17. peer1.org1.example.com | github.com/hyperledger/fabric/core/ledger/kvledger.(*Provider).Create(0xc0000beb80, 0xc0002a8cc0, 0x27, 0xc0004eb7a8, 0x1, 0x1)
  18. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/kvledger/kv_ledger_provider.go:117 +0x102
  19. peer1.org1.example.com | github.com/hyperledger/fabric/core/ledger/ledgermgmt.CreateLedger(0xc0002a8cc0, 0x0, 0x0, 0x0, 0x0)
  20. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledger_mgmt.go:97 +0x17b
  21. peer1.org1.example.com | github.com/hyperledger/fabric/core/peer.CreateChainFromBlock(0xc0002a8cc0, 0x1378f60, 0xc00000edc0, 0x1383c80, 0xc0004dc6e0, 0x1, 0x1)
  22. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/peer/peer.go:436 +0x7b
  23. peer1.org1.example.com | github.com/hyperledger/fabric/core/scc/cscc.joinChain(0xc0000466e0, 0xd, 0xc0002a8cc0, 0x1378f60, 0xc00000edc0, 0x1383c80, 0xc0004dc6e0, 0x0, 0x0, 0x0, ...)
  24. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/scc/cscc/configure.go:236 +0x79
  25. peer1.org1.example.com | github.com/hyperledger/fabric/core/scc/cscc.(*PeerConfiger).InvokeNoShim(0xc0004dcc30, 0xc0002cf7a0, 0x2, 0x2, 0xc0003f1db0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
  26. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/scc/cscc/configure.go:164 +0x692
  27. peer1.org1.example.com | github.com/hyperledger/fabric/core/scc/cscc.(*PeerConfiger).Invoke(0xc0004dcc30, 0x1390b60, 0xc0005986e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
  28. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/scc/cscc/configure.go:120 +0x29b
  29. peer1.org1.example.com | github.com/hyperledger/fabric/core/chaincode/shim.(*Handler).handleTransaction.func1(0xc00053d320, 0xc00053a4e0, 0xc0000bf300)
  30. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/handler.go:273 +0x4eb
  31. peer1.org1.example.com | created by github.com/hyperledger/fabric/core/chaincode/shim.(*Handler).handleTransaction
  32. peer1.org1.example.com | /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/handler.go:242 +0x53
  33. peer1.org1.example.com exited with code 2

any help will be great, thanks guys :)

K

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Posts: 11

    update:

    I forget to mention that now I can't even launch this basic command,
    it seems that my network breaks again just to try to follow the pdf instructions,
    and I can't always restart from start :(

    1. $ docker exec -it peer1.org1.example.com bash
    2.  
    3. root@4a58a9c918a7:/opt/gopath/src/github.com/hyperledger/fabric# peer channel fetch oldest allarewelcome.block -c allarewelcome --orderer orderer.example.com:7050
    4. 2019-11-02 02:15:11.839 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    5. 2019-11-02 02:15:11.842 UTC [cli.common] readBlock -> INFO 002 Received block: 0
    6.  
    7. root@4a58a9c918a7:/opt/gopath/src/github.com/hyperledger/fabric# ls
    8. allarewelcome.block
    9.  
    10. root@4a58a9c918a7:/opt/gopath/src/github.com/hyperledger/fabric# peer channel list
    11. 2019-11-02 02:10:39.343 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
    12. Error: Failed sending proposal, got rpc error: code = Unavailable desc = transport is closing

    thanks

  • Posts: 11

    Hello

    aftre some debug, I have luck
    it seems that channel data allarewelcome_ is lost in couchdb,
    I drop all couchdb volumes and start service stack
    and recreate it and it with above commands, and now peer channel list starts to work again :)

    1. # Create the channel
    2. docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c allarewelcome -f /etc/hyperledger/configtx/allarewelcome.tx
    3. # Join peer0.org1.example.com to the channel.
    4. docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel join -b allarewelcome.block

    now it seems that it instantiate the chaincode :)

    1. $ peer chaincode instantiate -n ccForAll -v 1.0 -o orderer.example.com:7050 -C allarewelcome -c '{"Args":["Mach","50"]}'
    2. 2019-11-02 02:35:19.769 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    3. 2019-11-02 02:35:19.781 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    4. 2019-11-02 02:35:19.785 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
    5. 2019-11-02 02:35:19.785 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
    6.  
    7. $ peer chaincode list --installed
    8. Get installed chaincodes on peer:
    9. Name: ccForAll, Version: 1.0, Path: github.com/sacc, Id: ebccdb27247faa8febc6cdb17a288dafcdb21d6484cfafcbcf8a46eacbf9dbfd
    10.  
    11. $ peer chaincode list --instantiated -C allarewelcome
    12. Get instantiated chaincodes on channel allarewelcome:
    13. Name: ccForAll, Version: 1.0, Path: github.com/sacc, Escc: escc, Vscc: vscc
  • @koakh said:
    Hello

    aftre some debug, I have luck
    it seems that channel data allarewelcome_ is lost in couchdb,
    I drop all couchdb volumes and start service stack
    and recreate it and it with above commands, and now peer channel list starts to work again :)

    1. # Create the channel
    2. docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c allarewelcome -f /etc/hyperledger/configtx/allarewelcome.tx
    3. # Join peer0.org1.example.com to the channel.
    4. docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel join -b allarewelcome.block

    now it seems that it instantiate the chaincode :)

    1. $ peer chaincode instantiate -n ccForAll -v 1.0 -o orderer.example.com:7050 -C allarewelcome -c '{"Args":["Mach","50"]}'
    2. 2019-11-02 02:35:19.769 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    3. 2019-11-02 02:35:19.781 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    4. 2019-11-02 02:35:19.785 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
    5. 2019-11-02 02:35:19.785 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
    6.  
    7. $ peer chaincode list --installed
    8. Get installed chaincodes on peer:
    9. Name: ccForAll, Version: 1.0, Path: github.com/sacc, Id: ebccdb27247faa8febc6cdb17a288dafcdb21d6484cfafcbcf8a46eacbf9dbfd
    10.  
    11. $ peer chaincode list --instantiated -C allarewelcome
    12. Get instantiated chaincodes on channel allarewelcome:
    13. Name: ccForAll, Version: 1.0, Path: github.com/sacc, Escc: escc, Vscc: vscc

    Hi @koakh ,
    Could you please explain in more detail what you did here as I have the exact same error:

    it seems that channel data allarewelcome_ is lost in couchdb,
    I drop all couchdb volumes and start service stack
    and recreate it and it with above commands, and now peer channel list starts to work again :)

  • Seems to be an error with the couchDb containers?

    [info] 2019-11-26T10:28:38.398968Z nonode@nohost <0.195.0> -------- Apache CouchDB has started on http://any:5986/
    [info] 2019-11-26T10:28:38.399538Z nonode@nohost <0.7.0> -------- Application couch started on node nonode@nohost
    [info] 2019-11-26T10:28:38.399838Z nonode@nohost <0.7.0> -------- Application ets_lru started on node nonode@nohost
    [info] 2019-11-26T10:28:38.428548Z nonode@nohost <0.7.0> -------- Application rexi started on node nonode@nohost
    [info] 2019-11-26T10:28:38.441617Z nonode@nohost <0.201.0> -------- open_result error {not_found,no_db_file} for _nodes
    [warning] 2019-11-26T10:28:38.441655Z nonode@nohost <0.271.0> -------- creating missing database: _nodes
    [info] 2019-11-26T10:28:38.470566Z nonode@nohost <0.201.0> -------- open_result error {not_found,no_db_file} for _dbs
    [warning] 2019-11-26T10:28:38.470600Z nonode@nohost <0.285.0> -------- creating missing database: _dbs
    [warning] 2019-11-26T10:28:38.470639Z nonode@nohost <0.284.0> -------- creating missing database: _dbs
    [info] 2019-11-26T10:28:38.478597Z nonode@nohost <0.7.0> -------- Application mem3 started on node nonode@nohost
    [info] 2019-11-26T10:28:38.478957Z nonode@nohost <0.7.0> -------- Application fabric started on node nonode@nohost
    [info] 2019-11-26T10:28:38.529437Z nonode@nohost <0.7.0> -------- Application chttpd started on node nonode@nohost
    [notice] 2019-11-26T10:28:38.553132Z nonode@nohost <0.322.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:395) <= mem3_shards:load_shards_from_disk/1(line:370) <= mem3_shards:load_shards_from_disk/2(line:399) <= mem3_shards:for_docid/3(line:86) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
    [error] 2019-11-26T10:28:38.555361Z nonode@nohost emulator -------- Error in process <0.323.0> with exit value:
    {database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,395}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,370}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,399}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,86}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training