Setting a default track to a track that does not exist returns an undocumented 400
Metadata
Current evaluation
Snapcraft added client-side track validation in canonical/snapcraft#3278 (commit 262f118ad); Snap Store support for choosing the reserved latest track remained unavailable.
Resolution: closed resolved
Reason: Merged PR #3278 queried the channel map before changing the default track, allowing Snapcraft to handle invalid track names client-side. The closing comment noted that setting latest was still unsupported by the Snap Store.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Hello,
I am in the process of implementing being able to set a default track from snapcraft, while testing against staging I ran into the following:
ubuntu@snapcraft-dev:~/snapcraft$ snapcraft tracks candycane
Name Status Creation-Date Version-Pattern
latest active - -
candybar default 2019-10-17T14:11:59Z -
x active 2020-08-21T20:30:00Z x\..*
ubuntu@snapcraft-dev:~/snapcraft$ snapcraft set-default-track candycane x
Default track for 'candycane' set to 'x'.
ubuntu@snapcraft-dev:~/snapcraft$ snapcraft set-default-track candycane foo
Received 400: 'Select a valid choice. The given value is not one of the available choices.'
ubuntu@snapcraft-dev:~/snapcraft$ snapcraft set-default-track candycane latest
Received 400: 'Select a valid choice. The given value is not one of the available choices.'
Describing,
- setting to a valid user created (on behalf of the Snap Store admin) track works just as expected
- setting to a non existent track returns a 400, this is not documented on https://dashboard.snapcraft.io/docs/api/snap.html#managing-snap-metadata and I wonder if this should be a 404. It also returns a strange message
- trying to set to latest returns a 400 as well. The latest agreement is that this operation should be possible.
The important bit is to know what the actual error code to commit to is to correctly capture and return a nicer Snapcraft message to the user.
Thanks
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Snapcraft added client-side track validation in canonical/snapcraft#3278 (commit 262f118ad); Snap Store support for choosing the reserved latest track remained unavailable. | |
| stealth/space-bunny-alpha | — | closed resolved | Client-side track validation was added in canonical/snapcraft#3278 (commit 262f118ad); setting the reserved latest track remained unsupported by the Snap Store. | |
| stealth/space-bunny-alpha | — | closed stale | Unable to verify the closed issue's resolution or maintainer rationale from the supplied information. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The report highlighted undocumented 400 errors for invalid track names and latest, but received no comments or code changes. Likely abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution or comments. The undocumented 400 error for invalid or latest default tracks was not addressed, indicating the issue was likely abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The report detailed an undocumented 400 error when setting a default track to a non-existent or latest track, but received no maintainer comments or action. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The report details undocumented 400 errors when assigning invalid or latest default tracks, but received no comments or labels. Appears abandoned or superseded without a fix. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#3278
(confidence 99%)
Merged as commit 262f118ad and added the client-side validation described in the closing comment.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3278 cli: client side check for setting default tracks | snapcraft | merged | Merged client-side validation for set-default-track, rejecting invalid track names before contacting the Snap Store. Merged as 262f118ad. |