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

Ledger corrupt when start peer then stop peer without processing blocks

    XMLWordPrintable

Details

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

    Description

      I am running the end-to-end v1 trial with CLI (and RocksDB), see the attachment in Binh's forum email:
      https://lists.hyperledger.org/pipermail/hyperledger-fabric/2016-October/000421.html

      The attachment at the bottom is:
      http://lists.hyperledger.org/pipermail/hyperledger-fabric/attachments/20161022/d3860afb/attachment.obj

      When I deploy chaincode and invoke chaincode all is good.
      I stop peer server with Ctrl-C.
      I re-start peer with:
      CORE_PEER_COMMITTER_LEDGER_ORDERER=0.0.0.0:5151 CORE_LOGGING_LEVEL=DEBUG peer node start

      Everything works fine if I do at least one invoke. If I do no invokes and stop the peer, the ledger appears to get corrupt. I cannot start the peer again. Upon peer start I get error in stdout:

      ...
      20:14:38.596 [kvledger] indexBlock -> DEBU 0a1 Indexing block [blockNum=43, blockHash=[]byte

      {0xac, 0x4a, 0xe3, 0xd3, 0xf4, 0x99, 0xcc, 0xec, 0x74, 0x70, 0x51, 0x7a, 0xae, 0x88, 0xe3, 0xe2, 0x88, 0xe1, 0x9, 0x82, 0x89, 0xa9, 0xc8, 0xe7, 0x96, 0x52, 0x26, 0x60, 0xeb, 0xd5, 0x7a, 0x4e, 0xc2, 0x96, 0x2, 0xf3, 0xdf, 0xd2, 0x27, 0x53, 0xcc, 0xd3, 0x5f, 0xdb, 0xb2, 0x83, 0xa2, 0x66, 0x22, 0xc8, 0x8, 0x12, 0x5d, 0x4c, 0x94, 0x37, 0x4a, 0x4b, 0x60, 0xd1, 0xf6, 0x39, 0xf5, 0xd4}

      ]
      20:14:38.596 [kvledger] nextBlockBytesAndPlacementInfo -> DEBU 0a2 current file [0]
      20:14:38.596 [kvledger] nextBlockBytesAndPlacementInfo -> DEBU 0a3 blockbytes [0]. Err:unexpected end of blockfile
      20:14:38.596 [kvledger] retrieveSerBlockByNumber -> DEBU 0a4 retrieveSerBlockByNumber() - blockNum = [44]
      panic: Could not retrieve last block form file: Entry not found in index

      Full stdout for working scenarios and then broken scenario is attached.

      Ledger in corrupt state from /var/hyperledger/production dir is too large to attach, find it here:
      https://drive.google.com/file/d/0B-qNtwPcxZjPTGxEdS1CN3hsb3M/view?usp=sharing

      Attachments

        Activity

          People

            manish-sethi Manish Sethi
            denyeart David Enyeart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: