最近在联调fabirc网络遇到了很多坑,主要是对fabric不够熟悉,所以解决问题的时候即使看到了错误信息,也不能很快的确定具体是那里出现了问题,而且问题确实谷歌不到,所以简单记录一下。
CA Certificate is not valid, (SN: 234551506279605485472670524472959491447): could not obtain certification chain: the supplied identity is not valid: x509: certificate has expired or is not yet valid"
证书过期,错误提示的已经很明显了,但是仔细看错误信息显示过期时间还没到(这里我没把错误截全),但是还重新生成了证书,依然出现过期的错误。
解决办法:
Error: proposal failed (err: bad proposal response 500)
加入通道的时候出现这个错误,往往是重复加入channel了,这个问题主要是吃亏在没仔细分析错误志,出现问题还是先不要复制粘贴百度。
解决办法:
使用fabric-go-sdk 实例化时报错:users not found
读取config.yml文件来创建一个sdk 的实例发生的error,排除自己方法传参无误,配置文件的用户名和orgname 也没有问题,谷歌也查不到,只能对着源码中的示例一个个去对比,对比哪里缺少用户信息的配置。
解决办法:
organizations
org1:
users:
Admin:
cert:
path: ****.pem
User1:
cert:
path: ****.pem
sending deploy transaction proposal failed: Transaction processing for endorser [peer0.org-maggie.ansible-example.ee-chain.com:7051]: Endorser Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection timed out [peer0.org-maggie.ansible-example.ee-chain.com:7051]
sdk 实例化链码时出现的错误:先去看了另一台机器上的7051端口的进程是不是正常启动的,确认了hosts 文件也没有问题,仔细想想peer节点部署都是ansible统一处理的,如果有问题的话,之前的步骤应该是不会成功的。而且为什么是其中一台机器链接正常的。
解决办法:
peer0.org-maggie.ansible-example.ee-chain.com:7051
对应的机器配置entityMatchers:
peer:
- pattern: (\w*)org-martin(\w*)
urlSubstitutionExp: 47.96.230.111:7051
eventUrlSubstitutionExp: 47.96.230.111:7053
sslTargetOverrideUrlSubstitutionExp: peer0.org-martin.ansible-example.ee-chain.com
mappedHost: peer0.org-martin.ansible-example.ee-chain.com
- pattern: (\w*)org-maggie(\w*)
urlSubstitutionExp: 121.196.210.111:7051
eventUrlSubstitutionExp: 121.196.210.111:7053
sslTargetOverrideUrlSubstitutionExp: peer0.org-maggie.ansible-example.ee-chain.com
mappedHost: peer0.org-maggie.ansible-example.ee-chain.com
orderer:
- pattern: (\w*)org-martin(\w*)
urlSubstitutionExp: 47.96.230.111:7050
sslTargetOverrideUrlSubstitutionExp: orderer0.org-martin.ansible-example.ee-chain.com
mappedHost: orderer0.org-martin.ansible-example.ee-chain.com
sending deploy transaction proposal failed: Transaction processing for endorser [121.196.210.111:7051]: Endorser Client Status Code: (23) CHAINCODE_NAME_NOT_FOUND. Description: cannot get package for chaincode (scc:1.0)
实例化链码链码时出现的问题:基于上一个坑,配置文件没错的情况下,错误信息是某台机器上没有这个包
解决办法:
还有一部分问题,过程中没有记录,不愿破坏现在的测试网络,所以就没有复盘,下次记录:P
原理问题之后复习了fabirc 的理论知识在做补充
环境问题
网络连接问题:
证书问题:
链码问题:
[][]byte{[]byte("init"), []byte("A"), []byte("100"), []byte("B"), []byte("200")}
的形式配置文件问题:
entityMatchers,organizations,orderers,peers
这类的复数的形式配置项的还是老老实实全部都填上另外重要的事情说三遍!
仔细看错误日志!
仔细看错误日志!
仔细看错误日志!