Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-6815

peer channel fetch command is not working as expected when TLS is enabled

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Medium
    • Resolution: Done
    • None
    • None
    • fabric-peer

    Description

      peer channel fetch command is not working as expected when TLS is enabled.

      Unable to write the fetched block to an outputfile, as per the help messages .

       peer channel fetch --help
       Fetch a specified block, writing it to a file.
      
       Usage:
         peer channel fetch <newest|oldest|config|(number)> [outputfile] [flags]
      
       Flags:
         -c, --channelID string   In case of a newChain command, the channel ID to create.
      

      Fails with Error: trailing args detected

      peer channel fetch 0 genesis_block.pb -o orderer.example.com:7050 -c "mychannel" --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA
      2017-10-30 21:18:55.304 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
      2017-10-30 21:18:55.304 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
      2017-10-30 21:18:55.307 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
      Error: trailing args detected
      Usage:
        peer channel fetch <newest|oldest|config|(number)> [outputfile] [flags]
      
      Flags:
        -c, --channelID string   In case of a newChain command, the channel ID to create.
      
      Global Flags:
            --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
            --logging-level string                Default logging level and overrides, see core.yaml for full syntax
        -o, --orderer string                      Ordering service endpoint
            --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
            --test.coverprofile string            Done (default "coverage.cov")
            --tls                                 Use TLS when communicating with the orderer endpoint
        -v, --version                             Display current version of fabric peer server
      

      The workaround used here is to either ignore the output file and let it write to a file true
      for example one such instance here

      peer channel fetch 0 -o orderer.example.com:7050 -c "mychannel" --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA
      

      Or to Ignore --tls option argument 'true'

      peer channel fetch 0 genesis_block.pb -o orderer.example.com:7050 -c "mychannel" --tls --cafile $ORDERER_CA
      

      Attachments

        Issue Links

          Activity

            People

              nnao Nao Nishijima
              Ratnakar Ratnakar Asara
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: