当前位置: 首页 > 知识库问答 >
问题:

错误:得到意外状态:禁止--隐式策略评估失败

秦承允
2023-03-14

我试图用3个org制作网络(每个有3个对等点),用Kafka和zookeeper在fabric 1.4.3中制作两个订货者节点。

然后,当我用

docker exec cli peer channel create -o orderer0.example.com:7050 -c $CHANNEL_NAME -f $ARTIFACTS_DIR/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

cli中出现以下错误

Error: got unexpected status: FORBIDDEN -- implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied

这是orderer0的docker日志

2019-10-12 09:01:16.513 UTC [orderer.consensus.kafka] setupChannelConsumerForChannel -> INFO 011 [channel: channel.first] Setting up the channel consumer for this channel (start offset: -2)...
2019-10-12 09:01:16.524 UTC [orderer.consensus.kafka] startThread -> INFO 012 [channel: channel.first] Channel consumer set up successfully
2019-10-12 09:01:16.543 UTC [orderer.consensus.kafka] startThread -> INFO 013 [channel: channel.first] Start phase completed successfully
2019-10-12 09:01:18.537 UTC [orderer.common.broadcast] ProcessMessage -> WARN 014 [channel: channel.first] Rejecting broadcast of config message from 172.18.0.29:35290 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
2019-10-12 09:01:18.537 UTC [comm.grpc.server] 1 -> INFO 015 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.18.0.29:35290 grpc.code=OK grpc.call_duration=1.888934ms
2019-10-12 09:01:18.541 UTC [common.deliver] Handle -> WARN 016 Error reading from 172.18.0.29:35288: rpc error: code = Canceled desc = context canceled
2019-10-12 09:01:18.542 UTC [comm.grpc.server] 1 -> INFO 017 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.18.0.29:35288 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=10.552989ms

双生子

|──directories
|     └──────artifacts
|     |   └──────channel.tx
|     |   └──────genesis.block
|     |
|     └──────bin
|     |   └──────crypto-config
|     |   |      └──────...
|     |   └──────...
|     |
|     └──────network
|         └──────docker-compose-mq.yaml
|         └──────docker-compose-orderer.yaml
|         └──────...

我在这里读到了一些像我一样的解决方案,但我还没有解决它。

这是我的configtx.yaml部分

Organizations:
    - &OrdererOrg
        Name: OrdererOrg
        ID: OrdererMSP
        MSPDir: ./crypto-config/ordererOrganizations/example.com/msp

        Policies:
            Readers:
                Type: Signature
                Rule: "OR('OrdererMSP.member')"
            Writers:
                Type: Signature
                Rule: "OR('OrdererMSP.member')"
            Admins:
                Type: Signature
                Rule: "OR('OrdererMSP.admin')"
    - &Org1
        Name: Org1MSP
        ID: Org1MSP

        MSPDir: ./crypto-config/peerOrganizations/org1.example.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:
            - Host: peer0.org1.example.com
              Port: 7051

这是docker-compose-cli.yaml

cli:
    container_name: cli
    image: hyperledger/fabric-tools:1.4.3
    tty: true
    stdin_open: true
    environment:
      - SYS_CHANNEL=$SYS_CHANNEL
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      #- FABRIC_LOGGING_SPEC=DEBUG
      - FABRIC_LOGGING_SPEC=INFO
      - CORE_PEER_ID=cli
      - CORE_PEER_ADDRESS=peer0.org1.example.com
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
        - /var/run/:/host/var/run/
        - ../chaincode/:/opt/gopath/src/github.com/chaincode
        - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
        - ../artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
        - ../chaincode:/opt/gopath/src/github.com/hyperledger/fabric/chaincode
        #- ./:/etc/hyperledger/fabric

crypto-config.yaml

OrdererOrgs:
  - Name: Orderer
    Domain: example.com
    EnableNodeOUs: true
    Specs:
      - Hostname: orderer
    Template:
      Count: 2

PeerOrgs:
  - Name: Org1
    Domain: org1.example.com
    EnableNodeOUs: true
    Template:
      Count: 3
    Users:
      Count: 1

docker-compose-orderer.yaml

version: '2'
networks:
  blockchain_network:

services:
  orderer0.example.com:
    container_name: orderer0.example.com
    image: hyperledger/fabric-orderer:1.4.3
    environment:
      - ORDERER_GENERAL_LOGLEVEL=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
      - ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
      - ORDERER_KAFKA_VERBOSE=true
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    volumes:
        - ../artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
        - ./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp:/var/hyperledger/orderer/msp
        - ./crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls:/var/hyperledger/orderer/tls
    ports:
      - 7050:7050
    networks:
      - blockchain_network

  # orderer1 is same with upside

我想知道为什么会出现这种错误,以及如何解决它们。

共有1个答案

查飞星
2023-03-14

configtx.yaml中的通道配置是什么?

您是否尝试在客户端bash中运行peer命令(我不确定与MSP相关的环境变量是否像使用“Docker Exec”那样处于活动状态)?

docker exec -it cli bash
peer channel create -o orderer0.example.com:7050 -c $CHANNEL_NAME -f $ARTIFACTS_DIR/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
 类似资料:
  • Spring我是新来的。我试图在我的数据库中添加一个新目标。在我添加spring security之前,它是有效的,但现在如果我单击添加新目标,我有一个问题: 出现意外错误(类型=禁止,状态=403)。被禁止的 我的goat-add.html: WebSecurity配置类: 我的控制器: 我读到这个问题可以是如果不使用csrf,但我不明白我怎么能解决它。 所有代码:https://github.

  • 我正在做一个spring boot项目,其中包括thymeleaf,spring security。当我执行以下操作时效果很好:显示产品列表、显示产品详细信息、添加新产品、更新现有产品。 但当我执行-删除产品时,会出现以下错误: 白标错误页面 此应用程序没有/error的显式映射,因此您将其视为一种回退。 18 16:59:16BDT 2019 出现意外错误(类型=禁止,状态=403)。 被禁止的

  • 出现意外错误(类型=禁止,状态=403)。访问被拒绝。当我试图从邮递员或浏览器中访问URL时,我收到了一个错误,即出现了一个意外错误(类型=禁止,状态=403)。访问被拒绝。 1) 网络安全类:- 2) 身份验证筛选器类:- 3)控制器类:- 4) 服务实现类:-

  • 我目前正在实现安全与Spring Boot到我的小API作为一个项目到学校当然没什么大不了的,但我想管理一些角色和东西。我一直在尝试添加. antMatcher(url). hasRole(一些角色)。...更多的蚂蚁匹配器... 当测试登录实际上显示一个错误(类型=禁止,状态=403)。 下面是一些代码 只是一个控制器,显示我的控制面板CRUD我的动物: p 我希望你们能帮助我,我是新来的。

  • 我已将以下策略附加到IAM用户: 现在,有了附加了上述策略的IAM用户的访问凭据,我试图运行以下命令: 其中,文件policy.json的内容为: 我得到了一个 调用PutBucket策略操作时发生错误(AccessDended):拒绝访问 现在我想知道为什么? 用户的策略语句允许对资源执行: 这就是我试图用我的上述政策所做的。那么,为什么访问被拒绝?

  • 我有基本授权,它基于Spring启动安全性: 当我尝试在授权后添加新帖子时,我会收到这条消息: 在我的控制器中: 然而,读操作从我的控制器工作得很好,但积垢操作我没有访问权。 我的依赖性如下: 知道吗?提前谢谢!