← Back to issue list

Python exception when stage dir does not exist

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1814430
Type
issue
State
closed
Author
~tim-sueberkrueb
Labels
—
Created
Updated
Closed

Current evaluation

Missing stage-directory handling was fixed in recent Snapcraft versions, according to maintainer ~mr-cal; no specific resolving PR or commit was identified.

Resolution: closed resolved

Reason: Maintainer ~mr-cal confirmed on 2026-07-23 that the exception was fixed in recent Snapcraft versions. The supplied issue history contains no linking PR or commit SHA.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When a folder specified with the `stage` key does not actually exist, this Python exception is thrown: ``` # cat /tmp/tmpryszj5if/trace.txt Traceback (most recent call last): File "/snap/snapcraft/2374/bin/snapcraft", line 11, in <module> load_entry_point('snapcraft==3.0.1', 'console_scripts', 'snapcraft')() File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/cli/__main__.py", line 81, in run run_snapcraft(prog_name="snapcraft") File "/snap/snapcraft/2374/lib/python3.5/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/snap/snapcraft/2374/lib/python3.5/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/snap/snapcraft/2374/lib/python3.5/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/snap/snapcraft/2374/lib/python3.5/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/snap/snapcraft/2374/lib/python3.5/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 236, in snap _execute(steps.PRIME, parts=[], pack_project=True, output=output, **kwargs) File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 94, in _execute lifecycle.execute(step, project_config, parts) File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 80, in execute executor.run(step, part_names) File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 134, in run self._handle_step(part_names, part, step, current_step, cli_config) File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 148, in _handle_step getattr(self, "_run_{}".format(current_step.name))(part) File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 212, in _run_stage self._run_step(step=steps.STAGE, part=part, progress="Staging") File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 267, in _run_step getattr(part, step.name)() File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 689, in stage self._runner.stage() File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/_runner.py", line 84, in stage "override-stage", self._override_stage_scriptlet, self._stagedir File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/_runner.py", line 137, in _run_scriptlet scriptlet_name, function_call.strip() File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/_runner.py", line 193, in _handle_builtin_function function(**function_args) File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 711, in _do_stage fixup_func=fixup_func, File "/snap/snapcraft/2374/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 1064, in _migrate_files os.remove(dst) IsADirectoryError: [Errno 21] Is a directory: '/root/stage/lib' ``` The expected behavior is for snapcraft to handle the exception or prevent it beforehand and print a nice error message.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Missing stage-directory handling was fixed in recent Snapcraft versions, according to maintainer ~mr-cal; no specific resolving PR or commit was identified.
stealth/space-bunny-alpha — closed resolved Fixed in recent Snapcraft versions; maintainer mr-cal confirmed the missing stage-directory exception was resolved.
stealth/space-bunny-alpha — closed stale The missing-stage-directory exception was closed without a fix or resolution; the matching Launchpad bug was also closed as unaddressed (#1814430).
qwen3.6-35b-a3b-mtp-q6 — — Closed without fix or resolution. The unhandled IsADirectoryError when a stage directory is missing was not addressed.
qwen/qwen3.6-35b-a3b
Staleness: 100
Complexity: 15
Confidence: 95
Support Request: 10
close stale Reports an IsADirectoryError in snapcraft 3.0.1 when a stage directory is missing. Inactive for over 7 years with no maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 5
close stale Reports an unhandled IsADirectoryError crash in snapcraft v3.0.1 when a stage directory does not exist. No maintainer response or activity in over 7 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 35
Confidence: 85
Support Request: 5
close stale Reports an IsADirectoryError when a stage directory is missing, requesting a user-friendly error message instead of a Python traceback. Issue is over 7 years old with no maintainer response.

Update history

Date Change
created

Related issues

Issue Project State Summary Similarity
#1717413 snapcraft snap with an unexisting dir shows a traceback snapcraft (launchpad) closed Missing-directory handling was fixed to return a clear SnapcraftEnvironmentError instead of a traceback; Launchpad bug #1717413 is closed as Fixed.
71%