← Back to issue list

When revoking an existing validation assertion, snapcraft validate fails

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1912332
Type
issue
State
closed
Author
~nataliabidart
Labels
—
Created
Updated
Closed

Current evaluation

Validation revocation was fixed in snapcraft#3433 (commit 612d4b317), following the temporary revert of #3417 in #3422.

Resolution: closed resolved

Reason: The assertion-revision handling was corrected and validation revocation restored by merged PR snapcraft#3433, commit 612d4b317.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Recently some code was added so snapcraft validate would accept a --revoke flag so existing validations could be revoked. When used against staging or prod, this is currently failing with: 'There is already a validation assertion stored for snap-id <snapid> in this context.' This is a 409 error from the store, which in turns gets it from the snap-assertion-service. The problem is that, for a validation assertion, the primary key is: series snap-id approved-snap-id approved-snap-revision So when sending a revoked validation assertion, the primary key does not change and the assertion service fails with 409 (conflict). The fix for this is to increase the revision of the assertion, for an existing primary key. To do that, snapcraft needs: 1- Find out if there is an existing validation assertion for the given primary key curl -s -H "Accept: application/json" "https://api.snapcraft.io/api/v1/snaps/assertions/validation/16/<snap-id>/<approved-snap-id>/<approved-snap-revision>" | jq -S 2- If there is one, check if the assertion has a "revision" field, otherwise assume revision is 0 3- Create the new (revoked) assertion incrementing the revision by 1 4- Sign and push to the store Furthermore, generalizing this concept, these steps should also be applied when "unrevoking", and basically every time an assertion is being built and signed: snapcraft should try to get an existing assertion for a given assertion key, and if there is a match, craft a new one increasing the revision, to avoid the 409 from the assertion service.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Validation revocation was fixed in snapcraft#3433 (commit 612d4b317), following the temporary revert of #3417 in #3422.
stealth/space-bunny-alpha — closed resolved Revocation was fixed by merged PR canonical/snapcraft#3433 (commit 612d4b317), replacing the reverted initial implementation so validation assertions can be revoked without the store's 409 conflict.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #3433 (commit 612d4b317), which increments an existing validation assertion's revision before signing, allowing revocation without a 409 conflict.
stealth/space-bunny-alpha — closed stale Revoking an existing validation assertion returned a 409 for its unchanged assertion key. No resolving change or maintainer rationale is recorded; the old report appears closed as stale.
qwen/qwen3.6-35b-a3b — — Closed without resolution. Proposed a fix to increment assertion revisions before resubmission to prevent 409 store conflicts during validation revocation.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The proposed revision-increment logic to prevent 409 conflicts during validation revocation was not applied, leaving the issue abandoned.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The --revoke flag fails with a 409 conflict due to unchanged assertion primary keys. Proposed resolution involves querying existing assertions and incrementing their revision number before pushing updates.
qwen/qwen3.6-35b-a3b — — Abandoned. Revoking validation assertions triggered a 409 conflict due to unchanged primary keys. The proposed fix requires incrementing the assertion revision before signing to avoid conflicts, but no implementation was provided.
qwen3.6-35b-a3b-mtp-q6 — — Abandoned. Identified a 409 conflict when revoking validation assertions due to unchanged primary keys. Resolution requires incrementing the assertion revision number during creation or revocation to bypass store conflicts.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft#3433 (confidence 99%)

    Merged fix restoring validation assertion revocation.

  • Related To: snapcraft#3422 (confidence 95%)

    Reverted the initial revocation implementation before the corrected change.

  • Caused By: snapcraft#3417 (confidence 85%)

    Initial implementation of validation assertion revocation exposed the 409 conflict.

Related issues

Issue Project State Summary Similarity
#3417 Allow validation assertions to be revoked snapcraft merged PR #3417 merged as 847cd3cd4, but was reverted by #3422 (be94581c8); corrected revocation support was merged in #3433 (612d4b317).
72%
#3433 Allow revoking validation assertions (LP: #1912332) snapcraft merged Merged #3433 restored CLI support for revoking validation assertions after #3417 was reverted by #3422, resolving LP #1912332; landed as 612d4b317.
71%