← Back to issue list

Failed to upload snap created with `assumes: - command-chain`

View original Github issue

Metadata

Project
snapcraft
Number
#4931
Type
issue
State
open
Author
chanchiwai-ray
Labels
Status: Triaged Type: Bug
Created
Updated
Closed
—

Current evaluation

Declaring `assumes: [command-chain]` in snapcraft.yaml duplicates the entry, producing a snap.yaml rejected by snap-review. Still unfixed at HEAD; fix PR #6445 was closed unmerged.

Suggested action: keep open

Reason: Maintainer @mr-cal already acknowledged this as a genuine bug ('Snapcraft tries to be helpful and appends command-chain to assumes but it doesn't check if it is already there') and it is labelled Status: Triaged / Type: Bug. I confirmed the root cause is still live in code at HEAD: snapcraft/meta/snap_yaml.py:473 does `total_assumes = sorted(project.assumes + list(assumes))`, concatenating the user list with the computed set, so a user-declared `command-chain` yields `['command-chain', 'command-chain']` and lint-snap-v2 rejects the upload. Critically, the last comment claims #6445 fixes this, but that PR was closed without merging and git history for snap_yaml.py shows no dedup commit, so the bug persists. The impact is moderate — it blocks store upload (fails at the last step after a full build) but has a documented one-line workaround, which is why it is not app-breaking for the broader user base. Fix is trivial (`sorted(set(project.assumes) | assumes)`), so complexity is very low and actionability is very high: exact root-cause line, existing test file, and an already-written PR to resurrect.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 36 Complexity: 12 Confidence: 90 Actionability: 92

Issue body

### Bug Description When the snap is built with the following section: ```yaml assumes: - command-chain ``` The snap cannot be uploaded to snap store with the following error: ``` $ review-tools.snap-review -v tempest_39.0.0_amd64.snap Errors ------ - lint-snap-v2:snap_schema Error found while validating snap.json::$.assumes: ['command-chain', 'command-chain'] has non-unique elements ``` ### To Reproduce The bug can be reproduce using the tempest snap as an example: https://github.com/canonical/snap-tempest/blob/main/snap/snapcraft.yaml I believe other snap with ```yaml assumes: - command-chain ``` will also fail to upload ### Environment using `snapcraft 8.3.1 12136 latest/stable/… canonical✓ classic` ### snapcraft.yaml ```shell See "To Reproduce" section ``` ### Relevant log output ```shell Errors ------ - lint-snap-v2:snap_schema Error found while validating snap.json::$.assumes: ['command-chain', 'command-chain'] has non-unique elements ``` ### Additional context An inspection of `/snap/tempest/current/meta/snap.yaml` showed that somehow `assumes` contains a duplicated `command-chain` ``` cat /snap/tempest/current/meta/snap.yaml ``` ```yaml name: tempest version: 39.0.0 summary: OpenStack Integration Test Suite description: | Tempest is a set of integration tests to be run against a live OpenStack cluster. Tempest has batteries of tests for OpenStack API validation, Scenarios, and other specific tests useful in validating an OpenStack deployment. license: Apache-2.0 architectures: - amd64 base: core22 assumes: - command-chain - command-chain apps: tempest: command: bin/tempest completer: usr/share/bash-completion/completions/tempest plugs: - network-observe - network - home environment: TESTS: $SNAP_DATA/tempest_test_lists command-chain: - bin/tempest-wrapper discover: command: bin/discover-tempest-config plugs: - home - network environment: SSL_CERT_FILE: $OS_CACERT confinement: strict grade: stable environment: LD_LIBRARY_PATH: ${SNAP_LIBRARY_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}:$SNAP/lib PATH: $SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 45
Quick Win: 36
Complexity: 12
Confidence: 90
Actionability: 92
keep open Declaring `assumes: [command-chain]` in snapcraft.yaml duplicates the entry, producing a snap.yaml rejected by snap-review. Still unfixed at HEAD; fix PR #6445 was closed unmerged.
stealth/space-bunny-alpha
Impact: 42
Quick Win: 31
Complexity: 15
Confidence: 86
Actionability: 88
keep open Snapcraft duplicates 'command-chain' in snap.yaml assumes when the project also declares it, so the store review tool rejects the snap. Triaged, still present in code; fix PR #6445 was closed unmerged.
stealth/space-bunny-alpha
Impact: 45
Quick Win: 40
Complexity: 10
Confidence: 96
Actionability: 98
keep open Snapcraft duplicates explicitly declared command-chain in snap.yaml, causing store upload rejection; fix PR #6445 is open and not present in the inspected code.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 57
Complexity: 10
Confidence: 90
Actionability: 90
keep open Snapcraft duplicates 'command-chain' in snap.yaml assumes when user explicitly lists it alongside apps with command_chain
qwen/qwen3.8-27b
Impact: 45
Quick Win: 40
Staleness: 65
Complexity: 10
Confidence: 80
Support Request: 5
keep open Snapcraft duplicates 'command-chain' in assumes when user already lists it, causing snap store upload to fail schema validation. Triaged and confirmed as bug; fix not yet merged. Last activity 461 days ago.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 30
Confidence: 85
Support Request: 10
keep open Bug: Snapcraft duplicates 'command-chain' in assumes field during build, causing upload validation failure. Triaged, valid, awaiting fix or timeline.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 15
Confidence: 90
Support Request: 5
keep open Snapcraft duplicates command-chain in the assumes field during build, causing snap store upload validation to fail. Issue is triaged, acknowledged by maintainers, and has an internal ticket, but remains unfixed.

Update history

Date Change
updated
updated

Related work

  • Blocked By: snapcraft#6445 (confidence 92%)

    PR 'fix(meta): don't duplicate assumes already declared by the project' targets this exact defect but was closed without merging; referenced in the issue's final comment as the resolution, yet the code is unchanged at HEAD. The issue remains blocked pending a merged fix or a reopened PR.

Related issues

Issue Project State Summary Similarity
#2864 meta: assume command-chain fix for prepending snapcraft-runner snapcraft merged Merged #2864 in commit 94e9ef908, correcting assumes detection when snapcraft-runner is prepended via command-chain and adding test coverage.
72%