Error: error getting endorser client for channel: endorser client failed to connect to orderer.rabbit.com:8051: failed to create new connection: context deadline exceeded
原因:CORE_PEER_ADDRESS=orderer.rabbit.com:8051 地址不对或peer节点未启动。还有一种可能就是环境变量没有设置正确,考虑设置如下环境变量重试(注意修改为你的机器路径):
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export FABRIC_CFG_PATH=/home/jaderabbit/hbxy/blockchain/conf
export CORE_PEER_TLS_ROOTCERT_FILE=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051
Error: proposal failed (err: bad proposal response 500: access denied for [JoinChain][testc2]: [Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]])
原因:CORE_PEER_MSPCONFIGPATH=crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp msp地址未设置,或设置的地址不是admin
Error: failed to create deliver client: orderer client failed to connect to 192.168.127.129:7050: failed to create new connection: context deadline exceeded
原因:orderer节点地址不对,或orderer节点未启动
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application at version 0, but got version 1
原因:通道已创建
got unexpected status: BAD_REQUEST -- error authorizing update: error validating DeltaSet: policy for [Group] /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining
原因:通常表示频道创建事务的签名者没有其中一个联盟组织的管理员权限
最常见的原因是:
a) 该身份不在组织的管理员列表中。
b) 组织证书未由组织CA链有效签署。
c) 订货人不知道身份的组织。
其他一些不太可能的可能性因为您使用的是对等二进制而不是自定义代码
a) 签名与标识或有符号字节不匹配。
b) 身份是畸形的。
Cannot run peer because error when setting up MSP of type bccsp from directory /home/wff/jaderabbit/echain1/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp: could not initialize BCCSP Factories: Failed initializing BCCSP.: Could not initialize BCCSP SW [Failed to initialize software key store: An invalid KeyStore path provided. Path cannot be an empty string.] Could not find default SW BCCSP
原因:老版viper不会报错,这是由于你是用的最新版本的viper。如果你一定要使用最新版本的viper(我也想用),这里也可以提供一个不太正式的修改方案。
新版viper修改方法:github.com/hyperledger/fabric/peer/common/common.go
// SetBCCSPKeystorePath sets the file keystore path for the SW BCCSP provider
// to an absolute path relative to the config file
func SetBCCSPKeystorePath() {
if path := config.GetPath("peer.BCCSP.SW.FileKeyStore.KeyStore"); path != "" {
viper.Set("peer.BCCSP.SW.FileKeyStore.KeyStore", path)
}
}
resource temporarily unavailable
原因:打开了相同的leveldb
error getting default signer: error obtaining the default signing identity: this MSP does not possess a valid default signing identity
原因:未初始化MSP,可以试试调用这个命令进行初始化
common.InitCmd(nil,[]string{})
proposal failed (err: bad proposal response 500: cannot create ledger from genesis block: LedgerID already exists)
原因:重复加入channel
error getting endorser and deliver clients: no endorser clients retrieved - this might indicate a bug
获取endorser客户端时,peerAddresses是空数组,须是元素为空串,长度为1的数组
Bad configuration detected: Received AliveMessage from a peer with the same PKI-ID as myself: tag:EMPTY alive_msg:<membership:<pki_id:"\206\0367dH\361\312\347\300l\035@1v\356\030\003\233*\355\241\234\262zf\352\264\367w\007\302\226" > timestamp:<inc_num:1554097615134317977 seq_num:539 > >
使用了相同的msp证书
error: chaincode fingerprint mismatch: data mismatch
安装链代码时,基本流程的工作方式如下:
peer chaincode package -n name -v 1.0 -p path_to_your_chaincode
Got error while committing(unexpected Previous block hash. Expected PreviousHash =
通道创始块配置文件和orderer里的创始块配置不匹配
error: Error constructing Docker VM Name. 'dev1-trembling--human--rabbit_02-1.0-f21065c44f48dc8183241105b2a4dac241d062f17f6678c851c9d6989df58c71' breaks Docker's repository naming rules
core.yaml中的peer.id有特殊字符
Error: error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [syschannel] creator org [Org1MSP]
没加入syschannel通道
error Entry not found in index
查询的数据不存在。最直观的可能就是你所查询的数据是脏数据,源数据已经被清除,再查询时,就会报这个错误
链码间调用无力吐槽之一,chaincode里面调用另外的chaincode时,错误是放在payload里面的。
解决方法:
args, channelID := [][]byte{[]byte(tee.MethodQueryDataByID), []byte(notificationID)}, stub.GetChannelID()
response := stub.InvokeChaincode(tee.ChaincodeName, args, channelID)
if response.Status != shim.OK {
return nil, fmt.Errorf("error invoking chaincode %s[%s] to query notification in channel: %s, error: %v",
tee.ChaincodeName, tee.MethodQueryDataByID, channelID, string(response.Payload))
}
链码间调用无力吐槽之二,不能并发调用同一个channel上的链码(ps:到底怎么想的?),因为在调用其他链码时,本身会维护一个responseMap,key是chaidID+txID,如果存在,则报错channel exists。
解决方法:老老实实一个个调用,上一个结果返回了再调用下一个。在我这里,并发难处理?不存在的。
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 2
链码升级时报错,重启peer时发现启动不了,原来我链码中引用的一个config.go的文件,此文件有一个init函数会加载同目录下的一个yaml配置文件。而fabric 的链码打包安装到docker时,并不会加载非go的文件,因此,实例化时找这个文件找不到就panic报错了。由于fabric启动docker容器失败会自动删除docker容器,因此本应该能打印出来的错误被fabric给干掉了,因此出现题干的错误。谨记:所有的链码,必须是纯go文件写的,无任何非go依赖,如c文件,yml文件等,否则必然报错报错报错,还找不到原因!!!
Description: failed to execute transaction 10eb8d06f4c8f43b3f6bacb19b97230edda4fbf87527a7e47ba3d602674c49ec: [channel syschannel] could not launch chaincode basis:20191125152021-152f4433: chaincode registration failed: container exited with 0
链码调用时报错,删除所有的docker container和images再调用依然报错,重启peer后回复正常。猜测是ip或是端口问题。留据存疑。
Error: got unexpected status: NOT_FOUND -- channel does not exist
实例化链码时报错,查询节点加入的通道peer channel list时,发现已存在。原因??未知。猜测,kafka集群未初始化topic时,就加入了通道,导致实际通道加入失败,但peer又已经记录了通道状态为已加入?
https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection
实例化链码时失败报错,原因是服务器是不联网的,并且本地的镜像版本过低,导致服务器拉取最新的镜像而联网报错。解决方案更新本地镜像,docker save/docker load。
cannot retrieve package for chaincode…, too many open files
大并发invoke chaincode时报错。
由于是生产代码,想上生产环境需要先申请才能上去,为加快查问题的速度,先从源码分析一下错误产生的原因



根据文件调用栈可以看出,fabric在invoke链码时会去检查链码的实例化策略,这是为了防止有已经部署好的链码是绕过了这个策略实例化的。由于在检查时,会去本地文件系统读取链码信息,当大量并发时,超过系统设置的文件句柄,于是报错,too many open files.
由于peer在进行链码调用时是因为要检查链码实例化策略才需要打开文件,且根据代码显示,文件未写入,且未占用句柄不关闭,所以这里的解决方案有:
root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535
error received from Discovery Server: failed constructing descriptor for chaincodes:<name:"basis" >
链码调用时报这个错,最后通过peer chaincodes list --instantiated -C mychannel测试发现,此台机器未实例化,而集群中的其他机器是实例化过的,重新实例化链码虽然不报错,但仍然无法实例化此台机器。重启此台机器的peer后,经过短暂的同步恢复正常。怀疑可能是并发实例化链码时产生实例化检查冲突导致本节点未启动实例化任务。
Transaction processing for endorser [0.0.0.0:7051]: Chaincode status Code: (500) UNKNOWN. Description: failed to execute transaction 01e3178e0d5373e276b128ec65fc002f3798c4155442c4a79fbaa6a10f688455: [channel syschannel] could not launch chaincode basis:20200814154205-bf66744e: error starting container: error starting container: API error (403): endpoint with name dev1-peer1-basis-20200814154205-bf66744e already exists in network host
docker host网络中出现了image name同名的容器,导致此错误。解决方案:将container IMAGE同名的那台机器剔除出区块链请求网络即可,或者使区块链请求只调用本机地的peer服务。
Event Server Status Code: (17) EXPIRED_CHAINCODE. Description: received invalid transaction
原因是,链码实例化的版本跟安装的不一致。检查发现,安装了两个版本的链码,但只实例化了较老版本的链码,再手动实例化最新版本的链码后问题消失。
scripts/createChannel.sh: line 40: osnadmin: command not found 或osnadmin: 未找到命令
执行./network.sh createChannel时报错,当Fabric镜像不是 2.3 或更高版本时会发生此错误。 下载 2.3 或最新版本,它应该可以工作。 早期版本不支持 OSN Admin。 还要确保您在fabric samples test-network的 2.3 分支上,或者切换到fabric-samples的release-2.2分支。
networks.test value Additional properties are not allowed ('name' was unexpected)
执行./network.sh up时发生此错误,这是docker-compose版本问题,需要升级到1.27.4版本以上。查看docker-compose版本:docker-compose --version。安装命令:sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose,如果curl命令一直很慢或者断开链接,可以使用pip安装最新版本:pip3 install docker-compose。还不行就自己去github下载把:Releases · docker/compose · GitHub,下载好了放在/usr/local/bin路径下,记得改名为docker-compose
code=500 reason= stack=rpc error: code = Internal desc = grpc: error while marshaling: string field contains invalid UTF-8
调用合约时,输入参数需要是字符串,而我使用的是经过proto编码后的字节数组直接转成的字符串string(protoBytes),导致出现此问题。解决方案:使用base64编码proto bytes,或不使用proto编码而是json编码,这两种方案各有优劣。base64编码后的proto bytes空间占用更小,但需要编码两次proto.Marshal->base64.std.Encoding,解码也需要两次base64.std.Decoding->proto.Unmarshal;json编码空间占用更大,但只需编码一次,且参数具备可读性。
经过实践,比较推荐的做法是Invoke类型的智能合约方法,输入输出采用base64+proto,这样区块链占用的空间更小,Query类型的智能合约方法,输入输出采用json编码,这样省事且更具备可读性。
给定这段代码defcreate@upgrades=User.update_all(["role=?","upgraded"],:id=>params[:upgrade])redirect_toadmin_upgrades_path,:notice=>"Successfullyupgradeduser."end我如何在该操作中实际验证它们是否已保存或未重定向到适当的页面和消息? 最佳答案 在Rails3中,update_all不返回任何有意义的信息,除了已更新的记录数(这可能取决于您的DBMS是否返回该信息)。http://ar.ru
大约一年前,我决定确保每个包含非唯一文本的Flash通知都将从模块中的方法中获取文本。我这样做的最初原因是为了避免一遍又一遍地输入相同的字符串。如果我想更改措辞,我可以在一个地方轻松完成,而且一遍又一遍地重复同一件事而出现拼写错误的可能性也会降低。我最终得到的是这样的:moduleMessagesdefformat_error_messages(errors)errors.map{|attribute,message|"Error:#{attribute.to_s.titleize}#{message}."}enddeferror_message_could_not_find(obje
我将应用程序升级到Rails4,一切正常。我可以登录并转到我的编辑页面。也更新了观点。使用标准View时,用户会更新。但是当我添加例如字段:name时,它不会在表单中更新。使用devise3.1.1和gem'protected_attributes'我需要在设备或数据库上运行某种更新命令吗?我也搜索过这个地方,找到了许多不同的解决方案,但没有一个会更新我的用户字段。我没有添加任何自定义字段。 最佳答案 如果您想允许额外的参数,您可以在ApplicationController中使用beforefilter,因为Rails4将参数
我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test
我是rails的新手,想在form字段上应用验证。myviewsnew.html.erb.....模拟.rbclassSimulation{:in=>1..25,:message=>'Therowmustbebetween1and25'}end模拟Controller.rbclassSimulationsController我想检查模型类中row字段的整数范围,如果不在范围内则返回错误信息。我可以检查上面代码的范围,但无法返回错误消息提前致谢 最佳答案 关键是您使用的是模型表单,一种显示ActiveRecord模型实例属性的表单。c
我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file
我克隆了一个rails仓库,我现在正尝试捆绑安装背景:OSXElCapitanruby2.2.3p173(2015-08-18修订版51636)[x86_64-darwin15]rails-v在您的Gemfile中列出的或native可用的任何gem源中找不到gem'pg(>=0)ruby'。运行bundleinstall以安装缺少的gem。bundleinstallFetchinggemmetadatafromhttps://rubygems.org/............Fetchingversionmetadatafromhttps://rubygems.org/...Fe
在Cooper的书BeginningRuby中,第166页有一个我无法重现的示例。classSongincludeComparableattr_accessor:lengthdef(other)@lengthother.lengthenddefinitialize(song_name,length)@song_name=song_name@length=lengthendenda=Song.new('Rockaroundtheclock',143)b=Song.new('BohemianRhapsody',544)c=Song.new('MinuteWaltz',60)a.betwee
我是Google云的新手,我正在尝试对其进行首次部署。我的第一个部署是RubyonRails项目。我基本上是在关注thisguideinthegoogleclouddocumentation.唯一的区别是我使用的是我自己的项目,而不是他们提供的“helloworld”项目。这是我的app.yaml文件runtime:customvm:trueentrypoint:bundleexecrackup-p8080-Eproductionconfig.ruresources:cpu:0.5memory_gb:1.3disk_size_gb:10当我转到我的项目目录并运行gcloudprevie
我有两个Rails模型,即Invoice和Invoice_details。一个Invoice_details属于Invoice,一个Invoice有多个Invoice_details。我无法使用accepts_nested_attributes_forinInvoice通过Invoice模型保存Invoice_details。我收到以下错误:(0.2ms)BEGIN(0.2ms)ROLLBACKCompleted422UnprocessableEntityin25ms(ActiveRecord:4.0ms)ActiveRecord::RecordInvalid(Validationfa