Build error in code

I am getting following error. Is this due to go version issue or something ?

2024-04-02 13:00:09.815 IST [leveldbhelper] Get → ERRO 010 Error retrieving leveldb key [byte{0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x74, 0x61, 0x6c, 0x6c, 0x6d, 0x73, 0x70, 0x69, 0x64, 0x73, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x74, 0x65, 0x73, 0x74, 0x73, 0x0, 0x6e, 0x1, 0x3}]: leveldb: closed

2024-04-02 13:00:21.623 IST [kvlegetActiveLedgerIDsdger] → ERRO 17e Error getting ledger ids from idStore: leveldb: closed

2024-04-02 13:00:23.454 IST [kvledger] getActiveLedgerIDs → ERRO 19a Error unmarshalling ledger metadata: unexpected EOF
2024-04-02 13:00:23.454 IST [kvledger] getLedgerMetadata → ERRO 19b Error unmarshalling ledger metadata: unexpected EOF
2024-04-02 13:00:23.772 IST [kvledger] openIDStore → ERRO 19c The db at path [/tmp/kvledger656871058/ledgerProvider] contains data in unexpected format. expected data format = [2.0] (byte{0x32, 0x2e, 0x30}), data format = (byte(nil)).
2024-04-02 13:00:23.774 IST [kvledger] func1 → ERRO 19d Please execute the ‘peer node upgrade-dbs’ command to upgrade the database format: unexpected format. db info = [leveldb for channel-IDs at [/tmp/kvledger656871058/ledgerProvider]], data format = , expected format = [2.0]

2024-04-02 13:01:41.137 IST [kvledger] updateLedgerStatus → ERRO 941 LedgerID [dummy] does not exist
2024-04-02 13:01:41.430 IST [kvledger] updateLedgerStatus → ERRO 942 LedgerID [dummy] does not exist
2024-04-02 13:01:41.745 IST [kvledger] getLedgerMetadata → ERRO 943 Error unmarshalling ledger metadata: unexpected EOF
2024-04-02 13:01:42.014 IST [kvledger] getLedgerMetadata → ERRO 944 Error unmarshalling ledger metadata: unexpected EOF

2024-04-02 13:02:07.152 IST [lockbasedtxmgr] RemoveStaleAndCommitPvtDataOfOldBlocks → DEBU a65 Constructing unique pvtData by removing duplicate entries
— FAIL: TestGenerateSnapshotErrors (9.52s)
— FAIL: TestGenerateSnapshotErrors/block_store_returns_error (1.46s)
Error Trace: snapshot_test.go:239
Error: “leveldb: closed\ninternal leveldb error while obtaining db iterator\*DBHandle).GetIterator\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/common/ledger/util/leveldbhelper/leveldb_provider.go:240\*blockIndex).exportUniqueTxIDs\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/common/ledger/blkstorage/blockindex.go:276\*BlockStore).ExportTxIds\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/common/ledger/blkstorage/blockstore.go:100\*kvLedger).generateSnapshot\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/core/ledger/kvledger/snapshot.go:60\\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/core/ledger/kvledger/snapshot_test.go:235\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1595\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650” does not contain “fabric/common/ledger/blkstorage/blockindex.go”
Test: TestGenerateSnapshotErrors/block_store_returns_error
— FAIL: TestGenerateSnapshotErrors/config_history_mgr_returns_error (1.38s)
Error Trace: snapshot_test.go:249
Error: “leveldb: closed\ninternal leveldb error while obtaining db iterator\*DBHandle).GetIterator\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/common/ledger/util/leveldbhelper/leveldb_provider.go:240\*db).getNamespaceIterator\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/core/ledger/confighistory/db_helper.go:114\*Retriever).ExportConfigHistory\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/core/ledger/confighistory/mgr.go:233\*kvLedger).generateSnapshot\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/core/ledger/kvledger/snapshot.go:64\\n\t/home/manisha/Downloads/fabric/demoTh/fabric-2.2.14/core/ledger/kvledger/snapshot_test.go:245\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1595\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650” does not contain “fabric/core/ledger/confighistory/mgr.go”
Test: TestGenerateSnapshotErrors/config_history_mgr_returns_error
2024-04-02 13:02:07.833 IST [leveldbhelper] openDBAndCheckFormat → INFO a66 DB is empty Setting db format as 2.0

Hi @Manisha_Mahapatra,

Welcome to the forum.

It looks like your code tries to access a closed leveldb instance. Without seeing the code that triggers this error, troubleshooting this error is difficult.

I’m trying to build the development environment for hyperledger fabric from : GitHub - hyperledger/fabric: Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy., fabric 2.2.14
While running make command I am getting leveldb: closed error.
As the architecture code has been implemented in golang, so I am hoping to get some support on this issue.
command used : make dist-clean all

Aw, sorry, I lost track of this conversation.

If the error occurs when following the steps for building the Hyperledger Fabric environment, then it’s likely that some prerequisites have not been met.

If the problem was in the code, everyone who tries building that environment would stumble upon this error. However, I did not find an issue in the repo about this particular error.

I think the best next step is to reach out to the Hyperledger Fabric team or community for help.