snapcraft status crashing "TypeError: Can't convert 'NoneType' object to str implicitly"
Metadata
Current evaluation
Store cleanup removed the conflicting name-dispute record, and snapcore/snapcraft#2115 (12828eba2) added a missing-snap-ID guard for snapcraft status.
Resolution: closed resolved
Reason: Removing the conflicting record fixed links and lpshipit, which a reporter confirmed. PR #2115 was merged as commit 12828eba2 to handle the condition without dumping a traceback.
Evaluated by: mr-cal-bot
No scores available.
Issue body
root@snapcrafters:~# snapcraft version
snapcraft, version 2.40
root@snapcrafters:~# snap info links
name: links
summary: Web browser running in text mode
publisher: snapcrafters
contact: https://github.com/snapcrafters/links/issues
description: |
Links is a text mode WWW browser, similar to Lynx. It displays tables, frames,
downloads on background, uses HTTP/1.1 keepalive connections.
snap-id: XwrNY1ywHBH1BLx60DcXsPOU0xketHwh
channels:
stable: 2.12-1 (2) 1MB -
candidate: ↑
beta: ↑
edge: 2.15 (3) 1MB -
root@snapcrafters:~# snapcraft status links
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 9, in <module>
load_entry_point('snapcraft==2.40', '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 43, 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 247, in status
snapcraft.status(snap_name, series, arch)
File "/usr/lib/python3/dist-packages/snapcraft/_store.py", line 717, in status
status = store.get_snap_status(snap_name, series, arch)
File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_store_client.py", line 194, in get_snap_status
self.sca.snap_status, snap_id, series, arch)
File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_store_client.py", line 85, in _refresh_if_necessary
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/storeapi/_sca_client.py", line 281, in snap_status
url = 'snaps/' + snap_id + '/state'
TypeError: Can't convert 'NoneType' object to str implicitly
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Store cleanup removed the conflicting name-dispute record, and snapcore/snapcraft#2115 (12828eba2) added a missing-snap-ID guard for snapcraft status. | |
| stealth/space-bunny-alpha | — | closed resolved | Crash on `snapcraft status` for snaps with a missing store snap-id: store-side fix removed the conflicting name-dispute record (closed for links/lpshipit), and PR #2115 (commit 12828eba2) merged a CLI guard validating snap IDs, per LP #1763721. | |
| stealth/space-bunny-alpha | — | closed resolved | The status crash was fixed by checking for a missing snap ID in the store client, preventing None from being concatenated into the state URL. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in canonical/snapcraft#2115, merged as commit 12828eba2: snapcraft status now validates snap IDs and avoids the NoneType crash. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed and resolved. The crash was fixed by adding null checks for the snap ID in the store client to prevent implicit string conversion errors. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by validating snap_id before string concatenation to prevent crashes when querying snap status. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#2115
(confidence 99%)
Merged commit 12828eba2 validates snap IDs before store API use.
-
Superseded By:
project#1778493
(confidence 90%)
Tracked the Store-side duplicate records for revoked and approved names.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1627865 Snapcraft errors when releasing a snap | snapcraft (launchpad) | closed | Resolved by improving snapcraft's error handling to check HTTP status codes before JSON decoding, alongside a fix for the underlying store race condition (bug #1610948). | |
| #1761488 snapcraft 2.39.2 failed to release a snap: snapcraft.storeapi.errors.StoreReleaseError: <exception str() failed> | snapcraft (launchpad) | closed | Root cause was Mozilla-side (passing a string instead of a list of channels to _store.push); Snapcraft's unprintable StoreReleaseError was fixed by commit ef350b47 and PR #2056 (merged as 1f90b2a9), shipped in 2.41. |