← Back to issue list

TypeError: load() missing 1 required positional argument: 'Loader'

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1948597
Type
issue
State
open
Author
~kenneth-loafman
Labels
fatal snapcraft
Created
Updated
Closed
—

Current evaluation

Snapcraft 2.43.1 deb crashes with "TypeError: load() missing 1 required positional argument: 'Loader'" in states/_state.py; Loader-less yaml.load call since fixed, and the reporter confirmed their core18 CI image was the trigger.

Suggested action: close resolved

Reason: The exact failing call (states/_state.py `yaml.load(f.read())` with no Loader, requiring PyYAML >= 5.1) was changed by commit 2e6ed7fd1 "yaml: replace yaml.safe_load() with CSafeLoader (#2218)" — pickaxe on `yaml.load(f.read())` and the file history for snapcraft/internal/states/_state.py both return that commit, and the current tree has no Loader-less yaml.load calls. The affected snapcraft 2.x/core18 deb code no longer exists at all (removed in ffb164b7a "chore: remove snapcraft_legacy"), and the reporter's last comment concludes the failure came from their Docker core18 image needing snapcraft installed, not from duplicity. Impact is limited because Ubuntu 18.04/core18 and the 2.x deb are EOL.

Evaluated by: mr-cal-bot

Impact: 28 Quick Win: 17 Complexity: 15 Confidence: 78 Actionability: 70

Issue body

Bad ending while trying to build duplicity snap on GitLab. Sorry, an error occurred in Snapcraft: We would appreciate it if you created a bug report at https://launchpad.net/snapcraft/+filebug with the above text included. Traceback (most recent call last):   File "/usr/bin/snapcraft", line 11, in <module>     load_entry_point('snapcraft==2.43.1+18.4.1', 'console_scripts', 'snapcraft')()   File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__     return self.main(*args, **kwargs)   File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main     rv = self.invoke(ctx)   File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke     return _process_result(sub_ctx.command.invoke(sub_ctx))   File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke     return ctx.invoke(self.callback, **ctx.params)   File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke     return callback(*args, **kwargs)   File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 136, in snap     project = _execute(steps.PRIME, parts=[], **kwargs)   File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 35, in _execute     lifecycle.execute(step, project_config, parts)   File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute     executor.run(step, part_names)   File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 196, in run     self._create_meta(step, processed_part_names)   File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 354, in _create_meta     common.env = self.config.snap_env()   File "/usr/lib/python3/dist-packages/snapcraft/internal/project_loader/_config.py", line 289, in snap_env     dependency_paths |= part.get_primed_dependency_paths()   File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 885, in get_primed_dependency_paths     state = self.get_prime_state()   File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 144, in get_prime_state     self._prime_state = cast(states.PrimeState, self.get_state(steps.PRIME))   File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 148, in get_state     return states.get_state(self.plugin.statedir, step)   File "/usr/lib/python3/dist-packages/snapcraft/internal/states/_state.py", line 96, in get_state     state = yaml.load(f.read()) TypeError: load() missing 1 required positional argument: 'Loader'

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 28
Quick Win: 17
Complexity: 15
Confidence: 78
Actionability: 70
close resolved Snapcraft 2.43.1 deb crashes with "TypeError: load() missing 1 required positional argument: 'Loader'" in states/_state.py; Loader-less yaml.load call since fixed, and the reporter confirmed their core18 CI image was the trigger.
stealth/space-bunny-alpha
Impact: 20
Quick Win: 12
Complexity: 15
Confidence: 72
Actionability: 70
close not a bug PyYAML 6 TypeError crashing snapcraft 2.43.1 deb state loading on core18; reporter traced it to their GitLab Docker image lacking Snapcraft, not a snapcraft defect. Untriaged upstream, idle since 2022.
stealth/space-bunny-alpha
Impact: 22
Quick Win: 14
Complexity: 12
Confidence: 76
Actionability: 72
close stale Snapcraft 2.43 deb on core18 crashes with "load() missing 1 required positional argument: 'Loader'" (PyYAML 6) in internal/states/_state.py. Reporter worked around it via Docker image; the legacy code path has since been deleted from the tree.
stealth/space-bunny-alpha
Impact: 35
Quick Win: 24
Complexity: 22
Confidence: 93
Actionability: 89
close not a bug Snapcraft 2.43.1 crashed in the reporter’s core18 GitLab image while loading PyYAML state; investigation attributed it to the CI image rather than Duplicity.
stealth/space-bunny-alpha
Impact: 25
Quick Win: 20
Complexity: 10
Confidence: 96
Actionability: 88
close stale Snapcraft 2.43.1 crashes in a core18 Docker build due to a PyYAML Loader API mismatch; the legacy code path has since been removed from current Snapcraft.
stealth/space-bunny-alpha
Impact: 24
Quick Win: 19
Complexity: 12
Confidence: 94
Actionability: 88
close resolved Snapcraft 2.43.1 crashes in state loading under incompatible PyYAML. The faulty call was removed after the legacy state package was deleted, so it no longer affects current Snapcraft.
qwen/qwen3.8-27b
Impact: 15
Quick Win: 13
Staleness: 95
Complexity: 15
Confidence: 80
Support Request: 10
close stale Snapcraft 2.43.1 crashes during snap build with PyYAML TypeError (load() missing Loader) in internal/states/_state.py. No maintainer interaction for ~4.5 years; the affected code path no longer exists in the current codebase.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 90
Support Request: 10
close stale Snapcraft 2.43.1 crashes with a PyYAML load() missing Loader argument error during snap builds. Issue has been inactive for over 4 years and affects a long-deprecated version.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 10
Confidence: 95
Support Request: 10
close stale Reports a PyYAML yaml.load() TypeError during Snapcraft 2.43.1 builds. Unaddressed for over 4 years. The error stems from Python 3.8+ breaking changes in PyYAML, and the affected Snapcraft version is long obsolete.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 90
Support Request: 0
close stale Snapcraft 2.43.1 build fails with PyYAML load() missing Loader argument. Over 4 years old, no maintainer interaction, and references a long-deprecated version.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#2218 (confidence 85%)

    Commit 2e6ed7fd1 (PR #2218) is the change that introduced an explicit Loader/CSafeLoader for state-file YAML loading, addressing the reported TypeError.

Related issues

No related issues found above the similarity threshold.