← Back to issue list

Exception raised when trying to operate on a snap that I don't own nor collaborate with

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1743428
Type
issue
State
open
Author
~nataliabidart
Labels
Created
Updated
Closed

Current evaluation

Ugly traceback (KeyError in StoreReleaseError.__str__) when snapcraft release fails due to missing package_upload permission on a snap the user does not own; reported against snapcraft 2.35, no maintainer activity in ~8.6 years.

Suggested action: close stale

Reason: The issue targets snapcraft 2.35 code paths (snapcraft/storeapi/, snapcraft/_store.py, snapcraft/cli/store.py) that no longer exist in the current codebase, which uses a completely rewritten snapcraft/store/ client. The affected version is long unsupported, the issue has zero comments or labels, and a near-identical report (LP #1761488, same 'StoreReleaseError: <exception str() failed>' in 2.39.2) was closed without resolution.

Impact: 20 Quick Win: 15.0 Staleness: 95 Complexity: 25 Confidence: 85 Support Request: 10

Issue body

While doing some testing about proper snap access via the Store APIs, I used snpacraft to try to release a revision to a channel, for a snap I don't own nor I collaborate with. Snapcraft failed, but the errors is ugly and an end-user would not understand what went wrong. Example: snapcraft release isdtest-only 1 edge Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/snapcraft/cli/_errors.py", line 55, in exception_handler echo.error(str(exception)) File "/usr/lib/python3/dist-packages/snapcraft/internal/errors.py", line 33, in __str__ return self.fmt.format([], **self.__dict__) KeyError: '"status"' Original exception was: Traceback (most recent call last): File "/usr/bin/snapcraft", line 9, in <module> load_entry_point('snapcraft==2.35', 'console_scripts', 'snapcraft')() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/lib/python3/dist-packages/snapcraft/cli/__main__.py", line 19, in <module> run(prog_name='snapcraft') File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/store.py", line 156, in release snapcraft.release(snap_name, revision, channels.split(',')) File "/usr/lib/python3/dist-packages/snapcraft/_store.py", line 534, in release channels = store.release(snap_name, revision, release_channels) File "/usr/lib/python3/dist-packages/snapcraft/storeapi/__init__.py", line 240, in release self.sca.snap_release, snap_name, revision, channels) File "/usr/lib/python3/dist-packages/snapcraft/storeapi/__init__.py", line 181, in _refresh_if_necessary return func(*args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/storeapi/__init__.py", line 627, in snap_release raise errors.StoreReleaseError(data['name'], response) snapcraft.storeapi.errors.StoreReleaseError: <exception str() failed> The response returned from the store in this case is: (Pdb) print(response.json()) {'detail': 'Permission is required: package_upload', 'type': 'devportal:v1:macaroon-permission-required', 'title': 'Macaroon missing required permission.', 'permission': 'package_upload', 'status': 403, 'error_list': [{'message': 'Permission is required: package_upload', 'code': 'macaroon-permission-required'}]}

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 20
Quick Win: 15.0
Staleness: 95
Complexity: 25
Confidence: 85
Support Request: 10
close stale Ugly traceback (KeyError in StoreReleaseError.__str__) when snapcraft release fails due to missing package_upload permission on a snap the user does not own; reported against snapcraft 2.35, no maintainer activity in ~8.6 years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 25
Confidence: 90
Support Request: 10
close stale Snapcraft crashes with an unhandled KeyError when releasing a snap without upload permissions, instead of showing a clear 403 error message. Untriaged and inactive for over 8 years.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 20
Confidence: 85
Support Request: 10
close stale Unhandled KeyError when running snapcraft release on a snap without permissions, causing a traceback instead of a user-friendly message. Issue is over 8 years old with no activity or maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 100
Complexity: 20
Confidence: 90
Support Request: 10
close stale Unhandled KeyError when formatting a 403 permission error during snap release. Reported 8.5 years ago for deprecated snapcraft 2.35 with no maintainer activity or labels.
qwen3.6-35b-moe-q4
Staleness: 98
Complexity: 20
Confidence: 90
Support Request: 10
close stale Unhandled KeyError when running snapcraft release on a snap without permissions, causing ugly stack traces. Issue is completely inactive for over 8 years on a legacy version.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: snapcraft#1761488 (confidence 55%)

    LP bug 1761488 reports the identical 'StoreReleaseError: <exception str() failed>' during snapcraft release in 2.39.2; closed without resolution. Ref is a LaunchPad bug ID, not a GitHub issue, hence lower confidence.

Related issues

Issue Project State Summary Similarity
#1947067 Getting error trying to release a snap snapcraft (launchpad) open User reports 'You do not have permissions to modify this Snap' error when releasing a snap, despite having been granted permission. No labels, no comments, no activity for ~5 years. Store-side permission issue, not a snapcraft bug.
74%
#1761488 snapcraft 2.39.2 failed to release a snap: snapcraft.storeapi.errors.StoreReleaseError: <exception str() failed> snapcraft (launchpad) closed Closed without resolution. The report details a StoreReleaseError during snapcraft 2.39.2 release attempts. With zero maintainer comments and significant age, the issue was likely abandoned. No fix or workaround was provided.
73%