0 sub-policies were satisfied, but this policy requires 1 of the ‘Admins‘

2023-10-09 08:10

本文主要是介绍0 sub-policies were satisfied, but this policy requires 1 of the ‘Admins‘,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

  • 前情提要
  • 问题分析
  • 参考链接

前情提要

今天在使用peer来创建通道的时候,报了如下的错误

2021-07-02 10:27:43.446 CST [common.deliver] Handle -> WARN 01a Error reading from 192.168.81.134:46572: rpc error: code = Canceled desc = context canceled
2021-07-02 10:27:43.447 CST [comm.grpc.server] 1 -> INFO 01b streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.81.134:46572 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=6.21135ms
2021-07-02 10:27:45.623 CST [cauthdsl] deduplicate -> ERRO 01c Principal deserialization failure (MSP OrdererMSP is unknown) for identity 0
2021-07-02 10:27:45.623 CST [orderer.common.broadcast] ProcessMessage -> WARN 01d [channel: mychannel] Rejecting broadcast of config message from 192.168.81.134:46578 because of error: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied
2021-07-02 10:27:45.623 CST [comm.grpc.server] 1 -> INFO 01e streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=192.168.81.134:46578 grpc.code=OK grpc.call_duration=2.682517ms

问题分析

对百度和google进行一番搜查:(0 sub-policies were satisfied, but this policy requires 1 of the ‘Admins’ sub-policies to be)

网上说有如下几个办法,都不是对的,至少对于我不是正确的:

  • 1、解决方案: configtx.yaml Capabilities段落不正确,参考官方版本;实际上,我觉得这个加不加都无所谓,最后成功的configtx.json我也没写这个段
  • 2、原因通过configtxgen命令生成创世区块时使用的通道名与创建通道时使用的通道名一样;我在创建创世块.block文件的时候并未带上-channelID name,使用的命令为…/bin/configtxgen -profile configtx.json -profile TwoOrgsOrdererGenesis -outputBlock ./genesis.block;默认会自动选择testchild的

正确应该排查的原因有如下三个

  • 1、配置文件中orderer的LocalMSPID是否一致,比如我用的是OrdererMSP,但在configtx.json中写的却是OrderersMSP(也是这个没有定义成模板导致的问题)
  • 2、一个就是我生成genesis.block的时候,并未指定配置文件;错误的时候使用: …/bin/configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./genesis.block -channelID mychannel;正确的应该为:…/bin/configtxgen -profile configtx.json -profile TwoOrgsOrdererGenesis -outputBlock ./genesis.block
  • 3、检查一下configtx.json文件,因为我是web后端自己生成的configtx.json,这个configtx.json用的是配置文件的形式,在异步调用的时候有些参数是@4打头的,自己没处理好异步,模板还没被替换过来,就被用来生成genesis.block了,当然会报错

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HoH4DcP9-1625194395625)(B6FD26D5EF694CFFB009B661744AB487)]

最后吐槽一下orderer的日志,咋什么都报:

ERRO 01c Principal deserialization failure (MSP OrdererMSP is unknown) for identity 0
2021-07-02 10:27:45.623 CST [orderer.common.broadcast] ProcessMessage -> WARN 01d [channel: mychannel] Rejecting broadcast of config message from 192.168.81.134:46578 because of error: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied

上面的问题也报的这个提示,当一个节点没有权限的时候也提示的这个。

最后贴一下我最终生成的configtx.json

{"Organizations": [{"Name": "OrderersMSP","ID": "OrderersMSP","MSPDir": "./crypto-config/ordererOrganizations/zeng.com/msp","Policies": {"Readers": {"Type": "Signature","Rule": "OR('OrderersMSP.member')"},"Writers": {"Type": "Signature","Rule": "OR('OrderersMSP.member')"},"Admins": {"Type": "Signature","Rule": "OR('OrderersMSP.admin')"}}},{"Name": "Org1MSP","ID": "Org1MSP","MSPDir": "./crypto-config/peerOrganizations/org1.zeng.com/msp","Policies": {"Readers": {"Type": "Signature","Rule": "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"},"Writers": {"Type": "Signature","Rule": "OR('Org1MSP.admin', 'Org1MSP.client')"},"Admins": {"Type": "Signature","Rule": "OR('Org1MSP.admin')"}},"AnchorPeers": []},{"Name": "Org2MSP","ID": "Org2MSP","MSPDir": "./crypto-config/peerOrganizations/org2.zeng.com/msp","Policies": {"Readers": {"Type": "Signature","Rule": "OR('Org2MSP.admin', 'Org2MSP.peer', 'Org2MSP.client')"},"Writers": {"Type": "Signature","Rule": "OR('Org2MSP.admin', 'Org2MSP.client')"},"Admins": {"Type": "Signature","Rule": "OR('Org2MSP.admin')"}},"AnchorPeers": []}],"Orderer": {"OrdererType": "solo","Addresses": ["orderer.zeng.com:7050"],"BatchTimeout": "2s","BatchSize": {"MaxMessageCount": 10,"AbsoluteMaxBytes": "99 MB","PreferredMaxBytes": "512 KB"},"Organizations": null,"Policies": {"Readers": {"Type": "ImplicitMeta","Rule": "ANY Readers"},"Writers": {"Type": "ImplicitMeta","Rule": "ANY Writers"},"Admins": {"Type": "ImplicitMeta","Rule": "MAJORITY Admins"},"BlockValidation": {"Type": "ImplicitMeta","Rule": "ANY Writers"}}},"Application": {"Organizations": null},"Profiles": {"TwoOrgsOrdererGenesis": {"Orderer": {"OrdererType": "solo","Addresses": ["orderer.zeng.com:7050"],"BatchTimeout": "2s","BatchSize": {"MaxMessageCount": 10,"AbsoluteMaxBytes": "99 MB","PreferredMaxBytes": "512 KB"},"Organizations": {"Name": "OrderersMSP","ID": "OrderersMSP","MSPDir": "./crypto-config/ordererOrganizations/zeng.com/msp","Policies": {"Readers": {"Type": "Signature","Rule": "OR('OrderersMSP.member')"},"Writers": {"Type": "Signature","Rule": "OR('OrderersMSP.member')"},"Admins": {"Type": "Signature","Rule": "OR('OrderersMSP.admin')"}}},"Policies": {"Readers": {"Type": "ImplicitMeta","Rule": "ANY Readers"},"Writers": {"Type": "ImplicitMeta","Rule": "ANY Writers"},"Admins": {"Type": "ImplicitMeta","Rule": "MAJORITY Admins"},"BlockValidation": {"Type": "ImplicitMeta","Rule": "ANY Writers"}}},"Consortiums": {"SampleConsortium": {"Organizations": [{"Name": "Org1MSP","ID": "Org1MSP","MSPDir": "./crypto-config/peerOrganizations/org1.zeng.com/msp","AnchorPeers": []},{"Name": "Org2MSP","ID": "Org2MSP","MSPDir": "./crypto-config/peerOrganizations/org2.zeng.com/msp","AnchorPeers": []}]}}},"TwoOrgsChannel": {"Consortium": "SampleConsortium","Application": {"Organizations": [{"Name": "Org1MSP","ID": "Org1MSP","MSPDir": "./crypto-config/peerOrganizations/org1.zeng.com/msp","AnchorPeers": []},{"Name": "Org2MSP","ID": "Org2MSP","MSPDir": "./crypto-config/peerOrganizations/org2.zeng.com/msp","AnchorPeers": []}]}}}
}

参考链接

  • 成功解决0 sub-policies were satisfied, but this policy requires 1 of the ‘Writers‘ sub-policies to be sa
  • Error: got unexpected status: FORBIDDEN — Failed to reach implicit threshold of 1 sub-policies, required 1 remaining: permission denied
  • hyperledger fabric在创建peer通道时出现this policy requires 1 of the ‘Writers’ sub-policies to be
  • 踩坑总结(七)

这篇关于0 sub-policies were satisfied, but this policy requires 1 of the ‘Admins‘的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/171504

相关文章

【uva】11536-Smallest Sub-Array(区间移动问题)

一个区间移动的问题,1A了,感觉没什么好说的。。 13975926 11536 Smallest Sub-Array Accepted C++ 0.809 2014-08-01 11:00:20 #include<cstdio>#include<cstring>#include<iostream>using namespace std;#define INF 1 << 30

【Python报错已解决】`AttributeError: move_to requires a WebElement`

🎬 鸽芷咕:个人主页  🔥 个人专栏: 《C++干货基地》《粉丝福利》 ⛺️生活的理想,就是为了理想的生活! 文章目录 引言:一、问题描述:1.1 报错示例:1.2 报错分析:1.3 解决思路: 二、解决方法:2.1 方法一:正确获取并传递WebElement对象2.2 步骤二:使用find_element_by_*方法直接获取元素 三、其

#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version

昨天编译文件时出现了Building MFC application with /MD[d] (CRT dll version)requires MFC shared dll version~~~~的错误。   在网上很容易找到了解决的方案,公布如下:   对着你的项目点击右键,依次选择:属性、配置属性、常规,然后右边有个“项目默认值”,下面有个MFC的使用,选择“在共享 DLL 中使

出现 E: Sub-process /usr/bin/dpkg returned an error code (1) 解决方法 (全面分析)

目录 前言1. 问题所示2. 原理分析2.1 第一阶段2.2 第二阶段 3. 解决方法4. 彩蛋4.1 错误不提示,直接卸载4.2 卸载后还是无错误提示 前言 3年前遇到过一个类似的,但是轻松解决,推荐阅读:ubuntu:E: dpkg was interrupted, you must manually run ‘sudo dpkg --configure…解决方法 这回发

第十五章 WS-Policy 配置类详细信息 - 配置 XData 块的详细信息(二)

文章目录 第十五章 WS-Policy 配置类详细信息 - 配置 XData 块的详细信息(二)`<method>``<request>``<response>` 第十五章 WS-Policy 配置类详细信息 - 配置 XData 块的详细信息(二) <method> <method> 元素将策略与父 <service> 元素指定的 Web 服务或客户端内的特定 Web 方法

Learning Policies for Adaptive Tracking with Deep Feature Cascades

Learning Policies for Adaptive Tracking with Deep Feature Cascades ICCV17 shotlight 作者:Chen Huang, CMU postdoctor,导师 Deva Ramanan summary 文章主要贡献在于速度与精度的权衡(AUC 0.638,fps 23),通过强化学习策略,来控制网络的深度,使得精度和

强化学习实践(二):Dynamic Programming(Value \ Policy Iteration)

强化学习实践(二):Dynamic Programming(Value \ Policy Iteration) 伪代码Value IterationPolicy IterationTruncated Policy Iteration 代码项目地址 伪代码 具体的理解可以看理论学习篇,以及代码中的注释,以及赵老师原著 Value Iteration Policy Itera

综述翻译:Machine Learning-Based Cache Replacement Policies: A Survey 2021

摘要: 虽然在提高命中率方便有了广泛进展,设计一个模拟Belady‘s 算法的缓存替换策略依旧很有挑战。现存的标准静态替换策略并不适合动态的内存访问模式,而计算机程序的多样性加剧了这个问题。有几个因素影响缓存策略的设计,如硬件升级,内存开销,内存访问模式,模型延时等。 用机器学习的算法解决缓存替换的问题取得了令人惊讶的结果,并朝着具有成本效应的解决方案发展。在本文中,我们回顾了一些基于机器学习

Pytorch:Tensor基本运算【add/sub/mul/div:加减乘除】【mm/matmul:矩阵相乘】【Pow/Sqrt/rsqrt:次方】【近似:floor...】【裁剪:clamp】

一、基本运算:加减乘除 1、乘法 1.1 a * b:element-wise 对应元素相乘 a * b:要求两个矩阵维度完全一致,即两个矩阵对应元素相乘,输出的维度也和原矩阵维度相同 1.2 torch.mul(a, b):element-wise 对应元素相乘 torch.mul(a, b):是矩阵a和b对应位相乘,a和b的维度必须相等,比如a的维度是(1, 2),b的维度是(1,

(转)事务PROPAGATION_REQUIRES_NEW不起作用

最近在做事务添加时  发现自己的事务没有新建 其二  注意  事务的注解  应该在 内层的事务上面 一、描述 Spring遇到嵌套事务时,当被嵌套的事务被定义为“PROPAGATION_REQUIRES_NEW”时, 内层Service的方法被调用时,外层方法的事务被挂起; 内层事务相对于外层事务是完全独立的,有独立的隔离性等等。 二、实验 但实验时却遇到一个奇怪的问题: 1、当Service