← 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

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.

Suggested action: keep open

Reason: The bug is still present in current code: line 478 of snap_yaml.py does `sorted(project.assumes + list(assumes))` which concatenates the user-provided list with the computed set, producing duplicates when the user already lists 'command-chain'. A maintainer confirmed the bug and provided a workaround, but no fix has been merged. The fix is trivial (use set union instead of list concatenation) and the issue remains reproducible.

Impact: 45 Quick Win: 40.5 Staleness: 65 Complexity: 10 Confidence: 80 Support Request: 5

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
qwen/qwen3.8-27b
Impact: 45
Quick Win: 40.5
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 15
Confidence: 90
Support Request: 0
keep open Snapcraft duplicates command-chain in assumes, causing snap store upload failures. Triaged with an internal ticket created. Awaiting development fix. Workaround: remove assumes: command-chain from snapcraft.yaml.

Update history

No update history recorded yet.

Related work

  • Caused By: canonical/snapcraft#4152 (confidence 75%)

    Commit 36dca729e 'meta: include project provided assumes in snapd.yaml' introduced the `project.assumes + list(assumes)` concatenation that causes duplicates when the user already specifies command-chain.

Related issues

Issue Project State Summary Similarity
#2796 meta: ensure Snap's `assumes` is initialized as a set snapcraft merged Merged fix for SNAPCRAFT-16C that converts the assumes configuration from a list to a set during initialization. This resolves a runtime exception when using command-chain by ensuring the add method functions correctly. Includes updated unit tests.
71%