{"record":{"id":"1d3b8bc0afacb370","repo":"hyperledger/fabric","slug":"as-another-peer-node-command-is-executing-wait-fo-1d3b8b","errorCode":null,"errorMessage":"as another peer node command is executing, wait for that command to complete its execution or terminate it before retrying","messagePattern":"as another peer node command is executing, wait for that command to complete its execution or terminate it before retrying","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/transientstore/store.go","lineNumber":280,"sourceCode":"\t\t}\n\t}\n\n\treturn nil\n}\n\n// Drop removes a transient storage associated with an input channel/ledger.\n// This function must be invoked while the peer is shut down.  To recover from partial deletion\n// due to a crash, the storage will be marked with an UNDER_DELETION status in the a system\n// namespace db.  At the next peer startup, transient storage marked with UNDER_DELETION will\n// be scrubbed from the system.\nfunc Drop(providerPath, ledgerID string) error {\n\tlogger.Infow(\"Dropping ledger from transient storage\", \"ledgerID\", ledgerID, \"providerPath\", providerPath)\n\n\t// Ensure the routine is invoked while the peer is down.\n\tlockPath := filepath.Join(filepath.Dir(providerPath), transientStorageLockName)\n\tlock := leveldbhelper.NewFileLock(lockPath)\n\tif err := lock.Lock(); err != nil {\n\t\treturn errors.New(\"as another peer node command is executing,\" +\n\t\t\t\" wait for that command to complete its execution or terminate it before retrying\")\n\t}\n\tdefer lock.Unlock()\n\n\t// Set up a StoreProvider\n\tprovider, err := newStoreProvider(providerPath, lock)\n\tif err != nil {\n\t\treturn errors.WithMessagef(err, \"constructing provider from path [%s]\", providerPath)\n\t}\n\tdefer provider.Close()\n\n\t// Mark the storage as UNDER_DELETION so that it can be purged if an error occurred during the drop\n\terr = provider.markStorageForDelete(ledgerID)\n\tif err != nil {\n\t\treturn errors.WithMessagef(err, \"marking storage [%s] for deletion\", ledgerID)\n\t}\n\n\t// actually delete the storage.","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/transientstore/store.go#L262-L298","documentation":"The transient store cleanup for a dropped ledger uses a file lock (transientStorageLockName) next to the provider path to guarantee it only runs while the peer is down. If another process holds that lock, Drop fails with this error telling you to wait for or terminate the other peer command.","triggerScenarios":"Running `peer node unjoin`/drop of transient storage while another peer node command (start, package drop, etc.) is running and holds the file lock.","commonSituations":"Running peer maintenance commands in parallel; a stale/uncleaned lock file left by a crashed peer process; automation scripts that don't wait for peer shutdown.","solutions":["Wait for the currently running peer command to complete, or terminate it, then retry","Verify no peer process is running (check process list), then remove the stale lock file next to the provider path and retry","Ensure deployment tooling serializes peer node commands"],"exampleFix":"// before\npeer node unjoin -c mychannel &\npeer node unjoin -c otherchannel  # fails: lock held\n// after\npeer node unjoin -c mychannel\npeer node unjoin -c otherchannel  # sequential execution","handlingStrategy":"retry","validationCode":"// check no peer process holds the lock before running\n// e.g.: pgrep -f 'peer node' || echo 'no peer running'","typeGuard":null,"tryCatchPattern":"err := store.Drop(ledgerID)\nif err != nil && strings.Contains(err.Error(), \"another peer node command is executing\") {\n    // wait/backoff then retry once peer commands have finished\n}","preventionTips":["Never run peer node commands concurrently on the same peer","Use tooling that serializes peer operations","After a crashed peer, check for and clear stale lock files","Ensure peer is fully stopped before unjoin/drop operations"],"tags":["fabric","transientstore","file-lock","concurrency"],"backgroundTag":"file-lock-contention","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}