fix: gracefully handle CURRENT_USER_HAS_NOT_PINNED_CID on IPFS unpin#247
Open
livepeer-tessa wants to merge 1 commit intomainfrom
Open
fix: gracefully handle CURRENT_USER_HAS_NOT_PINNED_CID on IPFS unpin#247livepeer-tessa wants to merge 1 commit intomainfrom
livepeer-tessa wants to merge 1 commit intomainfrom
Conversation
When the task-runner attempts to unpin an asset CID via Pinata and the CID was pinned under a different account, Pinata returns HTTP 400 with reason CURRENT_USER_HAS_NOT_PINNED_CID. Previously this caused the entire asset deletion to fail and the asset to remain stuck in the deleting queue. This change detects that specific error in the Unpin client method and treats it as a no-op (logs a warning and returns nil). The asset is not pinned by the current account so there is nothing to unpin — deletion should proceed normally. Adds three unit tests covering: - CURRENT_USER_HAS_NOT_PINNED_CID → no error returned - Other 400 errors → error still propagated - Successful 200 unpin → no error Fixes: daydreamlive/scope#747 Signed-off-by: livepeer-tessa <livepeer-tessa@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the staging task-runner attempts to delete assets, it calls Pinata's
DELETE /pinning/unpin/:cidAPI. If the CID was pinned under a different service account, Pinata returns:This caused the entire asset deletion to fail, leaving 12 assets stuck in the
deletingqueue (issue daydreamlive/scope#747, detected 2026-03-26 17:31 UTC on staging).Root cause
The CID ownership mismatch likely resulted from assets being pinned under a different account (possibly due to the 8h API outage on the same day — issue #746) while the task-runner is using a different set of credentials for unpin.
Fix
In
clients/ipfs.go, detect theCURRENT_USER_HAS_NOT_PINNED_CIDerror specifically inUnpin()and returnnilinstead of propagating the error. Since the CID isn't pinned by the current account, there's nothing to unpin — we log a warning and let deletion proceed.Tests
Added
clients/ipfs_test.gowith three cases:CURRENT_USER_HAS_NOT_PINNED_CID→ no error (skips unpin gracefully)Fixes daydreamlive/scope#747