← Back to issue list

Building classic snap without core snap installed succeeds, but creates snap that doesn't run

View original Launchpad issue

Metadata

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

Current evaluation

Snapcraft 2.39.x crashes with TypeError building a classic snap without the core snap installed, as get_core_dynamic_linker() returns None during patchelf. No comments or labels; 2.x series is EOL and the code path no longer exists in the current codebase.

Suggested action: close stale

Reason: The issue has had zero comments or labels and no activity for ~3079 days, and it targets snapcraft 2.39.x, a long-EOL 2.x release. The current repo layout shows the old snapcraft/internal/ tree (elf.py, pluginhandler) from the traceback has been replaced by the rewritten snapcraft/elf and snapcraft/parts modules, so the reported code path no longer exists and the problem is no longer reproducible in current versions.

Impact: 40 Quick Win: 26.0 Staleness: 95 Complexity: 35 Confidence: 65 Support Request: 10

Issue body

Using the 2.39.2 deb, building a classic snap without the core snap installed results in: Priming python3 Traceback (most recent call last): File "/usr/bin/snapcraft", line 9, in <module> load_entry_point('snapcraft==2.39.3', '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 1037, in invoke return Command.invoke(self, 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/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/_runner.py", line 72, in run ctx.forward(lifecyclecli.commands['snap']) File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward return self.invoke(cmd, **kwargs) 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/lifecycle.py", line 139, in snap project_options, directory=directory, output=output) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_packer.py", line 46, in snap execute('prime', project_options) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute _Executor(config, project_options).run(step, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 185, in run self._run_step(step, part, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 222, in _run_step getattr(part, step)() File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 578, in prime elf_patcher.patch(elf_file=elf_file) File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 392, in patch elf_file_path=elf_file.path) File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 297, in wrapper return f(*args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/internal/elf.py", line 407, in _run_patchelf subprocess.check_call(cmd) File "/usr/lib/python3.5/subprocess.py", line 576, in check_call retcode = call(*popenargs, **kwargs) File "/usr/lib/python3.5/subprocess.py", line 557, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1490, in _execute_child restore_signals, start_new_session, preexec_fn) TypeError: Can't convert 'NoneType' object to str implicitly This traces back to project_options.get_core_dynamic_linker() returning None in the pluginhandler.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 26.0
Staleness: 95
Complexity: 35
Confidence: 65
Support Request: 10
close stale Snapcraft 2.39.x crashes with TypeError building a classic snap without the core snap installed, as get_core_dynamic_linker() returns None during patchelf. No comments or labels; 2.x series is EOL and the code path no longer exists in the current codebase.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 40
Confidence: 90
Support Request: 10
close stale Snapcraft 2.39.x crashes with a TypeError during the prime step when building a classic snap without the core snap installed. Issue is over 8 years old with no maintainer interaction.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 45
Confidence: 95
Support Request: 10
close stale Bug report from 2016 describing a TypeError when building classic snaps without the core snap installed. Issue is completely inactive and applies to a legacy snapcraft version.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 35
Confidence: 90
Support Request: 10
close stale Bug in snapcraft 2.39 where building a classic snap without the core snap causes a TypeError during the prime step. Issue is over 8 years old with no activity and targets a deprecated version.
qwen3.6-35b-moe-q4
Staleness: 98
Complexity: 20
Confidence: 95
Support Request: 5
close stale Crash in snapcraft 2.39.x during prime step when core snap is missing. Issue is over 8 years old, references a deprecated version, and lacks maintainer engagement or labels.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft (launchpad)#1650946 (confidence 70%)

    Same root cause: missing core snap leaves core_dynamic_linker unset during classic snap builds; that bug was closed/abandoned without a fix.

  • Related To: snapcraft (launchpad)#1736861 (confidence 50%)

    Another classic-snap patchelf build failure in the 2.x era, closed without resolution.

Related issues

Issue Project State Summary Similarity
#1650946 unhelpful error when building a classic snap: classic confinement requires the core_dynamic_linker to be set snapcraft (launchpad) closed Abandoned due to age and zero comments. The request to improve error messaging for missing core_dynamic_linker in classic snaps received no resolution.
77%
#1736861 classic snap fails to build with "cannot find section" snapcraft (launchpad) closed Closed without comments or resolution. The snapcraft 2.37 regression causing patchelf failures in classic snaps was abandoned or resolved in a subsequent release.
76%
#1665081 building a classic snap does'nt remove /snap/core/current snapcraft (launchpad) closed Closed as fixed. Snapcraft now removes /snap/core/current after building classic snaps, resolving the directory conflict that blocked core snap installation.
72%
#1760897 Classic confined snap started segfaulting after 2.40 upgrade snapcraft (launchpad) open 2018 report that a classic confined snap (kubernetes-test) segfaults when built with snapcraft 2.40 due to patchelf/ELF buildid stripping; reporter found a no-patchelf workaround. No maintainer response in 8+ years; affected version long superseded.
72%
#1660302 foreign architecture builds doesn't work with classic snaps snapcraft (launchpad) open Cross-arch builds (--target-arch) of classic snaps fail because the build environment lacks the core snap. Reported 2016 against snapcraft 2.x; 0 comments, no maintainer response; codebase since fully rewritten.
71%