fabric2 sdk遇到的问题

  1. 2021-09-11T09:01:44.057551180Z 2021-09-11 09:01:44.056919 I | http: TLS handshake error from 10.0.7.12:63563: tls: failed to verify client certificate: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "bsnca")

  2. 加入通道失败:

genesis block retrieval failed: Orderer Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection on target [order2.23x.orderglobalnode.bsnbase.com:17052]: waiting for connection failed: context deadline exceeded

===》 重新发送报文

  1. 链码审批失败:
 sending approve transaction proposal failed: Transaction processing for endorser [peer1.orgbnode.bsnbase.com:10051]: Endorser Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection on target [peer1.orgbnode.bsnbase.com:10051]: connection is in TRANSIENT_FAILURE

=====》

  1. 查询通道失败
could not get chConfig cache reference: QueryBlockConfig failed: no channel peers configured for channel [netchannel])!

===>需要在config.ymal中配置通道netchannel信息

Received error response from txn proposal processing: Transaction processing for endorser [peer2.orgbnode.bsnbase.com:20051]: Chaincode status Code: (404) UNKNOWN. Description: namespace hllcc000001 is not defined

===》 通道块高不同步导致的,(查看通道块高, 节点时间不能相差15分钟)

6.  ```text
sending approve transaction proposal failed: Multiple errors occurred: - Transaction processing for endorser [peer1.orgbnode.bsnbase.com:10051]: Chaincode status Code: (500) UNKNOWN. Description: Failed to authorize invocation due to failed ACL check: Failed deserializing proposal creator during channelless check policy with policy [Admins]: [expected MSP ID OrgbNodeMSP, received OrgaNodeMSP] - Transaction processing for endorser [peer2.orgbnode.bsnbase.com:20051]: Chaincode status Code: (500) UNKNOWN. Description: Failed to authorize invocation due to failed ACL check: Failed deserializing proposal creator during channelless check policy with policy [Admins]: [expected MSP ID OrgbNodeMSP, received OrgaNodeMSP]]

===>

Transaction processing for endorser [10.0.51.156:10051]: Chaincode status Code: (500) UNKNOWN. Description: failed to invoke backing implementation of 'InstallChaincode': chaincode already successfully installed

==> 对链码tar.gz hash256后的值相同,导致的

OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown

8. ```text
Chaincode status Code: (500) UNKNOWN. Description: failed to invoke backing implementation of 'ApproveChaincodeDefinitionForMyOrg': attempted to redefine uncommitted sequence (2) for namespace cc_app0003202110201900559583399_01 with unchanged content

==>存在当前最新的合约没有commit,无法进行新的approve,只需要将最新的commit后再进行这次新的approve即可。

failed: Orderer Server Status Code: (400) BAD_REQUEST. Description: Attempted to include member NanjingtxyNodeMSP which is not in the
consortium

==> 在创世块genenis.blok文件中没有包含NanjingtxyNodeMSP组织

10. ```text
"create channel failed: create channel failed: SendEnvelope failed: calling orderer 'order2.23x.orderglobalnode.bsnbase.com:17052' failed: Orderer Server Status Code: (400) BAD_REQUEST. Description: error validating channel creation transaction for new channel 'hllgj', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied"

==> admin证书不对

11 ```text
bash-5.1# peer lifecycle chaincode approveformyorg --tls true --cafile certs/ordererOrganizations/ordernode.bsnbase.com/orderers/order1.23x.ordernode.bsnbase.com/tls/server.crt --channelID app0001202110231510201337440 --name cc_app0001202110231510201337440_01 --version 1.0.0.1 --package-id cc_app0001202110231510201337440_01:262bdbe25aa9258565912d1f9103444023e901f71ba01e63ad6bf6663f2b59c2 --sequence 1
2021-10-23 08:24:07.955 UTC [cli.lifecycle.chaincode] setOrdererClient -> INFO 001 Retrieved channel (app0001202110231510201337440) orderer endpoint: order1.23x.ordernode.bsnbase.com:17051
Error: proposal failed with status: 500 - failed to invoke backing implementation of 'ApproveChaincodeDefinitionForMyOrg': could not serialize chaincode parameters to state: could not deserialize metadata for namespace namespaces/cc_app0001202110231510201337440_01#1: could not query metadata for namespace namespaces/cc_app0001202110231510201337440_01#1: GET_STATE failed: transaction ID: ce539e689920198ea328d9cb7c90782ca945126721c89ed9bc3ec3591d20dbb1: private data matching public hash version is not available. Public hash version = {BlockNum: 1, TxNum: 0}, Private data version = <nil>

===》 需要配置 引导节点
  - CORE_PEER_GOSSIP_USELEADERELECTION=false
      - CORE_PEER_GOSSIP_ORGLEADER=true
      - CORE_PEER_GOSSIP_BOOTSTRAP=peer2.23x.organode.bsnbase.com:20051

12: 启动链码时报错:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 33881b9768ec4836ea5c243e536b0ab47f896b831b5570c57a8fbc5582c06fce: could not launch chaincode basic_1.0:3f11e6bf3bd16a30a6b434e227c679df6593537c1a48cbf3f61b0b33ad83a4b5: error starting container: error starting container: API error (404): network peer_default not found"

===》
image.png

CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE值需要改为当前目录

  1. 2022-04-15 06:52:55.516 UTC [orderer.common.server] Main -> PANI 005 Failed validating bootstrap block: initializing channelconfig failed:
    could not create channel Consortiums sub-group config: setting up the MSP manager failed: CA Certificate is not valid,
    (SN: 271246016204178110621990395059041613998044757805): could not obtain certification chain: the supplied identity is not valid: x509:
    certificate has expired or is not yet valid: current time 2022-04-15T06:52:55Z is before 2022-04-15T07:49:00Z

==> - CORE_PEER_GOSSIP_USELEADERELECTION=false
- CORE_PEER_GOSSIP_ORGLEADER=true

14 bash-5.1# peer channel create -o orderer1.orderer.czw444555566222.bsnbase.com:7050 -c asdsad -f /opt/blocktx/asdsad.tx --tls true --cafile /certs/ordererOrganizations/orderer.czw444555566222.bsnbase.com/orderers/orderer1.orderer.czw444555566222.bsnbase.com/tls/tlscacerts/tls-ca-orderer-czw444555566222-bsnbase-com-7054.pem
2022-04-18 11:07:40.686 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'asdsad': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application be at version 0, but it is currently at version 1

==> 通道重复创建

  1. fabric 链码审批阶段报: MVCC_READ_CONFLICT
    确认:
    export CORE_PEER_GOSSIP_USELEADERELECTION=true
    export CORE_PEER_GOSSIP_ORGLEADER=false

16:
order节点共识出问题:
Rejecting broadcast of config message from 10.233.65.3:39858 with SERVICE_UNAVAILABLE: rejected by Configure: no Raft leader

解决办法:

order之间通讯有问题,检查

17:
提交链码是报错:
sending commit transaction proposal failed: Transaction processing for endorser [peer2.node2.default.bsnbase.com:7051]: Chaincode status Code: (500) UNKNOWN. Description: failed to invoke backing implementation of 'CommitChaincodeDefinition': chaincode definition not agreed to by this org (Node2MSP)

  1. 2021-11-03 15:01:27 [EROR] [RedNGWMS/services/fabricR1MgmService/core/nodemgmt/nodemgmt.go:120] create channel failed: SendEnvelope failed: calling orderer 'order2.ordernode.bsnbase.com:17052' failed: Orderer Server Status Code: (400) BAD_REQUEST. Description: error applying config update to existing channel 'app0001202111031402362936334': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application be at version 0, but it is currently at version 1
    ===> 究其原因:还是通道重复创建,但也可能是order 通讯有问题,可重启order

19:
newChannel end : {"code":0,"msg":"create channel failed:org.hyperledger.fabric.sdk.exception.TransactionException: Channel app0001202301160843140396277, send transaction failed on orderer OrdererClient{id: 131, channel: app0001202301160843140396277, name: order1.ordernode.lnjzbsn.com, url: grpcs://192.168.30.26:17051}. Reason: Channel app0001202301160843140396277 orderer order1.ordernode.lnjzbsn.com status returned failure code 400 (BAD_REQUEST) during orderer next"}============
==>时间peer和order不同步

20:安装链码
Chaincode status Code: (500) UNKNOWN. Description: failed to invoke backing implementation of 'InstallChaincode': chaincode already successfully installed

==》链码唯一性是通过 Label+hash256(源码) 来确认的
1.检查节点上是否安装:peer lifecycle chaincode queryinstalled
2. 检查链码包中的metadata.json中的信息

21: order节点启动时报: panic: Error opening leveldb: resource temporarily unavailable
==》order 节点所使用的/var/hyperledger/production 被其他应用占用

  1. 安装链码时,节点上报错:


    image.png

==》

23: order节点日志报: 2023-06-06 02:57:14.051 UTC [common.deliver] deliverBlocks -> WARN 1192 [channel: syschannel] Client 192.168.0.1:33910 is not authorized: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied

==》说明当前请求的组织,没有访问权限,检查order的Policies 策略是否是只能order自己进行reader
将msp目录改为order的msp目录即可

24.问题
+fabric2.5 error validating proposal: access denied: channel [] creator org unknown, creator is malformed


image.png

==》 可能是节点没有获取到节点msp证书,
在启动脚本里加上 - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp

25,Peer Identity cannot be validated. No MSP found able to do that.


image.png

=》出现这个问题, 一般是锚节点未加入到通道的原因

  1. 问题:Error: Failed sending proposal, got rpc error: code = Unknown desc = error validating proposal: access denied: channel [] creator org unknown, creator is malformed

==>一般是没有正确配置MSP路径导致的。检查CORE_PEER_MSPCONFIGPATH

27:
问题: gRPC Transport Status Code: (2) Unknown Description: error validating proposal: access denied: channel [ar120412137881] creator org [Node1MSP]

==》 问题一般是由于客户端 使用证书不对导致的, 检查客户端证书链是否正确、查看证书的Subject属性的是否是OU=client以及其他

28: 安装链码时失败:
peer lifecycle chaincode install test.tar.gz

2023-09-01 09:56:20.938 CST [comm.grpc.server] 1 -> INFO8392e9b unary call completed grpc.service=discovery.Diseovery grpc.method=Discover grpc.request_deadline=2023-09-01T09:56:35.925+08:
2ms
2023-09-01 09:56:20.986 CST [chaincode.platform] funcl -ERRO 8392e9c docker build failed: Error returned frombpuild: 1 "main.go:4:2: cannot find package "." in
main.go:6:2: cannot find package "." in:
/chaincode/input/src/chaincode/chaincode
/chaincode/input/src/chaincode/vendor/github.com/hyperledger/fabric-contract-api-go/contractapi
2023-09-01 09:56:20.986 CST (dockercontroller) buildimage -> ERRO 8392e9d Error building image: docker build failled: Error returned from build: 1 "main.go:4:2: cannot find package
main.go:6:2: cannot find package "." in:
/chaincode/input/src/chaincode/chaincode
/chaincode/input/src/chaincode/vendor/github.com/hyperledger/fabric-contract-api-go/contractapi
2023-09-01 09:56:20.987 CST (dockercontroller) buildimage -> ERR10 8392e9e Build Output:
2023-09-01 09:56:20.989 CST [endorser] callChaincode ->INFO 8392e9f finished chaincode:_lifecycle duration:1606ms channel txID=6ba80df3
2023-09-01 09:56:20.989 CST (comm.grpc.server) 1 -> INFO8392ea0 unary call completed grpc.service=protos.Endorseer grpc.method=ProcessProposal grpc.request_deadline=202309-01T09:59:19.311+
266032s

问题原因是:安装链码时,给点的链码包 test.tar.gz, 不符合规范,main函数必须在项目中所有链码的上级或同级,打包路径为main函数所在同级文件夹,具体请查看https://hyperledger-fabric.readthedocs.io/zh_CN/latest/chaincode_lifecycle.html?highlight=code.tar.gz#null, 查看打包完后的包和规定是否一致

  1. 安装链码时:mkdir /tmp/go-build3540660860: permission denied


    image.png

==》 是由于ccenv的问题,删掉image重新拉取

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 213,864评论 6 494
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,175评论 3 387
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 159,401评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,170评论 1 286
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,276评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,364评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,401评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,179评论 0 269
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,604评论 1 306
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,902评论 2 328
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,070评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,751评论 4 337
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,380评论 3 319
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,077评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,312评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,924评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,957评论 2 351

推荐阅读更多精彩内容