티스토리 뷰
Blockchain/Blockchain 네트워크 구성
[Blockchain 네트워크 구성] Chaincode instantiate / upgrade 시 “timeout expired” 오류 해결 방법
miiingo 2018. 8. 30. 17:57반응형
오류 파악
cli 컨테이너에서 체인코드를 설치하고 난 뒤, instantiate 또는 upgrade 명령을 수행했을 때 다음과 같은 오류가 발생하는 경우가 있습니다.
root@f2f9e3cad3e5:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode upgrade -o orderer.org1.honeybee.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/honeybee.com/orderers/orderer.org1.honeybee.com/msp/tlscacerts/tlsca.honeybee.com-cert.pem -C honeybeechannel -n tracecc -v 2.0 -c '{"Args":[""]}' -P "OR ('org1MSP.member','org2MSP.member','org3MSP.member','org4MSP.member','org5MSP.member','org6MSP.member')"
2018-08-30 08:07:02.148 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-08-30 08:07:02.149 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 805249d44eda6fc358855a04cb9d75b43d6a2179029d76d57989bdb18c0cb9c2: timeout expired while starting chaincode tracecc:2.0 for transaction 805249d44eda6fc358855a04cb9d75b43d6a2179029d76d57989bdb18c0cb9c2
로그 확인
원인을 파악하기 위해 컨테이너들의 로그를 확인해봅니다.
orderer.org1.honeybee.com 컨테이너 로그 확인
orderer 컨테이너에는 명령을 수행하는 동안 별다른 로그가 나타나지 않았습니다.
peer0.org1.honeybee.com 컨테이너 로그 확인
peer0.org1.honeybee.com 컨테이너에서는 다음과 같은 두 가지 오류가 발생했습니다.
2018-08-30 08:12:02.185 UTC [chaincode] Launch -> ERRO 4ac start failed: timeout expired while starting chaincode tracecc:2.0 for transaction 805249d44eda6fc358855a04cb9d75b43d6a2179029d76d57989bdb18c0cb9c2
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).start
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:106
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:58
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:117
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:227
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:179
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:131
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:173
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:287
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:501
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:31
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:112
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:923
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1148
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:637
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
2018-08-30 08:12:02.185 UTC [endorser] SimulateProposal -> ERRO 4ad [honeybeechannel][805249d4] failed to invoke chaincode name:"lscc" , error: timeout expired while starting chaincode tracecc:2.0 for transaction 805249d44eda6fc358855a04cb9d75b43d6a2179029d76d57989bdb18c0cb9c2
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).start
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:106
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:58
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:117
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:227
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:179
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:131
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:173
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:287
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:501
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:31
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:112
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:923
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1148
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:637
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
failed to execute transaction 805249d44eda6fc358855a04cb9d75b43d6a2179029d76d57989bdb18c0cb9c2
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:181
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:131
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:173
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:287
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:501
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:31
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:112
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:923
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1148
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:637
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
로그의 내용으로 보면 체인코드 상에 문제가 있는 것 같습니다.
오류 해결
체인코드 수정
우선, 체인코드에서 문제가 되는 부분을 수정해줍니다.
체인코드를 배포할 때에는 기본적으로 코드에 문제가 없는지 검증을 거친 후, 오류가 없을 경우에만 정상적으로 배포가 되는데 이 경우에는 체인코드에 문제가 있어서 배포가 정상적으로 이루어지지 않은 것으로 보입니다.
체인코드 재설치
체인코드 수정이 완료되면 버전을 변경해 모든 피어에 체인코드를 설치해줍니다.
여기에서는 해당 채널에 참여중인 12개의 피어에 모두 체인코드를 설치해 주었습니다.
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer1.org1.honeybee.com:7056 \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer0.org2.honeybee.com:7051 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.honeybee.com/users/Admin@org2.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org2MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.honeybee.com/peers/peer0.org2.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer1.org2.honeybee.com:7056 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.honeybee.com/users/Admin@org2.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org2MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.honeybee.com/peers/peer1.org2.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer0.org3.honeybee.com:7051 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.honeybee.com/users/Admin@org3.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org3MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.honeybee.com/peers/peer0.org3.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer1.org3.honeybee.com:7056 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.honeybee.com/users/Admin@org3.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org3MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.honeybee.com/peers/peer1.org3.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer0.org4.honeybee.com:7051 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.honeybee.com/users/Admin@org4.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org4MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.honeybee.com/peers/peer0.org4.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer1.org4.honeybee.com:7056 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.honeybee.com/users/Admin@org4.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org4MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org4.honeybee.com/peers/peer1.org4.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer0.org5.honeybee.com:7051 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org5.honeybee.com/users/Admin@org5.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org5MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org5.honeybee.com/peers/peer0.org5.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer1.org5.honeybee.com:7056 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org5.honeybee.com/users/Admin@org5.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org5MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org5.honeybee.com/peers/peer1.org5.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer0.org6.honeybee.com:7051 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org6.honeybee.com/users/Admin@org6.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org6MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org6.honeybee.com/peers/peer0.org6.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
CORE_PEER_ADDRESS=peer1.org6.honeybee.com:7056 \
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org6.honeybee.com/users/Admin@org6.honeybee.com/msp \
CORE_PEER_LOCALMSPID="org6MSP" \
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org6.honeybee.com/peers/peer1.org6.honeybee.com/tls/ca.crt \
peer chaincode install -l node -v 3.0 -n tracecc -p /opt/gopath/src/github.com/chaincode/trace-chaincode/node/
체인코드 배포
설치가 완료되면 해당 체인코드에 대해 instantiate 또는 upgrade 명령을 실행합니다.
여기에서는 해당 체인코드가 이미 instantiate된 상태였기 때문에 upgrade 명령을 수행하였습니다.
peer chaincode upgrade -o orderer.org1.honeybee.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/honeybee.com/orderers/orderer.org1.honeybee.com/msp/tlscacerts/tlsca.honeybee.com-cert.pem -C honeybeechannel -n tracecc -v 3.0 -c '{"Args":[""]}' -P "OR ('org1MSP.member','org2MSP.member','org3MSP.member','org4MSP.member','org5MSP.member','org6MSP.member')"
peer chaincode list --instantiated -C honeybeechannel
다음과 같이 체인코드가 정상적으로 업그레이드된 것을 확인할 수 있습니다.
반응형
'Blockchain > Blockchain 네트워크 구성' 카테고리의 다른 글
[fabric-rest] TIMEOUT 오류 발생 및 해결 방안 (0) | 2018.11.30 |
---|---|
[blockchain-explorer] Blockchain-explorer 실행 PORT 변경 (0) | 2018.11.12 |
[Blockchain 네트워크 구성] Apache JMeter를 이용한 Hyperledger fabric-rest API 성능 테스트 (0) | 2018.07.20 |
[Blockchain 네트워크 구성] Peer-to-Peer 연결 오류 해결 (0) | 2018.07.19 |
[Blockchain 네트워크 구성] Hyperledger Fabric v1.2 Private Data 저장 오류 해결 (0) | 2018.07.13 |
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 빅데이터 기초
- 하이퍼레저 인디
- 빅데이터 강의
- 하이퍼레저 패브릭
- ubuntu
- 빅데이터 교육
- codility
- Hyperledger Fabric v1.1
- ambrosus
- 코테
- Hyperledger Indy
- Hyperledger Fabric v1.2
- Hyperledger Fabric
- Blockchain
- 블록 체인
- docker
- 어서와 데이터는 처음이지
- 블록체인
- 암브로셔스
- 코딩테스트
- Private Data
- 직딩잇템
- 하이퍼레저 페브릭
- 문제풀이
- javascript
- 코딜리티
- 기초 of 기초 데이터 개념
- DOCs
- 알고리즘
- 빅데이터
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
글 보관함