{"record":{"id":"b29b57c60d6dafe2","repo":"hyperledger/fabric","slug":"errchannelpendingremoval","errorCode":"ErrChannelPendingRemoval","errorMessage":"channel pending removal","messagePattern":"channel pending removal","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"orderer/common/types/errors.go","lineNumber":31,"sourceCode":"// Deprecated: system channel no longer supported\nvar ErrSystemChannelExists = errors.New(\"system channel exists\")\n\n// ErrSystemChannelNotSupported is returned when trying to join with a system channel config block.\nvar ErrSystemChannelNotSupported = errors.New(\"system channel not supported\")\n\n// ErrChannelAlreadyExists is returned when trying to join a app channel that already exists (when the system channel does not\n// exist), or when trying to join the system channel when it already exists.\nvar ErrChannelAlreadyExists = errors.New(\"channel already exists\")\n\n// ErrAppChannelsAlreadyExists is returned when trying to join a system channel (that does not exist) when application channels\n// already exist.\nvar ErrAppChannelsAlreadyExists = errors.New(\"application channels already exist\")\n\n// ErrChannelNotExist is returned when trying to remove or list a channel that does not exist\nvar ErrChannelNotExist = errors.New(\"channel does not exist\")\n\n// ErrChannelPendingRemoval is returned when trying to remove or list a channel that is being removed.\nvar ErrChannelPendingRemoval = errors.New(\"channel pending removal\")\n\n// ErrChannelRemovalFailure is returned when a removal attempt failure has been recorded.\nvar ErrChannelRemovalFailure = errors.New(\"channel removal failure\")\n\n// ErrChannelNotReady is returned when trying to update a channel that is a follower\nvar ErrChannelNotReady = errors.New(\"channel is not ready, he is a follower\")\n","sourceCodeStart":13,"sourceCodeEnd":38,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/types/errors.go#L13-L38","documentation":"ErrChannelPendingRemoval is returned when joining, updating, fetching, or removing a channel that is currently in the process of being removed. The removal is asynchronous; the channel is in a transient 'removing' state and further operations are rejected with HTTP 409 Conflict.","triggerScenarios":"POST (join) or PUT (update) to /participation/v1/channels/<id> while a prior DELETE for that channel is still completing; FetchBlock/JoinChannel racing with an in-flight removal.","commonSituations":"Scripts that DELETE and immediately re-JOIN a channel without waiting for removal to finish; concurrent operators acting on the same channel; retries hitting a channel mid-removal.","solutions":["Poll 'osnadmin channel list' until the channel disappears, then perform the join/update","Retry the operation after a delay (removal is transient)","Check removal status: the REST API reports channel status (removing) — wait for it to clear","Serialize automation so join/update commands never run concurrently with removal"],"exampleFix":"// before\nosnadmin channel remove --channelID mychannel\nosnadmin channel join --channelID mychannel --config-block app.block  # 409 pending removal\n// after\nosnadmin channel remove --channelID mychannel\nuntil ! osnadmin channel list | grep -q mychannel; do sleep 2; done\nosnadmin channel join --channelID mychannel --config-block app.block","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if errors.Is(err, types.ErrChannelPendingRemoval) {\n    time.Sleep(2 * time.Second)\n    // retry join/update, or wait until channel disappears from list\n}","preventionTips":["Wait for removal to complete (poll channel list) before rejoining","Avoid concurrent join/update/delete on the same channel","Add retry-with-backoff around osnadmin calls in automation"],"tags":["fabric","orderer","channel-participation","conflict","race-condition","http-409"],"backgroundTag":"resource-locked-conflict","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}