← Back to issue list

snapcraft does not properly surface an error message during the pip presence checking on the second and subsequent runs

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1882124
Type
issue
State
open
Author
~dmitriis
Labels
—
Created
Updated
Closed
—

Current evaluation

Legacy core18 Python pip check hid the underlying distutils traceback; the affected plugin path was removed with core18 support, making the report obsolete.

Suggested action: close stale

Reason: The failure came from the removed `snapcraft/plugins/_python/_pip.py` `_is_pip_installed` path. Current Snapcraft contains neither that module nor the function, and history shows commit 40136ea9b removed core18 support, so the affected subsystem is no longer present rather than merely inactive.

Evaluated by: mr-cal-bot

Impact: 12 Quick Win: 2 Complexity: 18 Confidence: 96 Actionability: 25

Issue body

I ran into https://bugs.launchpad.net/snapcraft/+bug/1864589 from distutils.util import strtobool modulenotfounderror: no module named 'distutils.util' However, while debugging this and retrying I only got this printed in the error message which was confusing because snapcraft expects this to fail: Failed to run '/root/stage/usr/bin/python3 -m pip': Exited with code 1. I managed to trace what's going on underneath and it looks like the real exception is not properly displayed but it is about the same issue as in lp: #1864589 A full PDB trace: https://paste.ubuntu.com/p/ykfm7TgVjm/ The real exception that gets raised: > /snap/snapcraft/x1/lib/python3.6/site-packages/snapcraft/plugins/_python/_pip.py(231)_is_pip_installed() -> raise e (Pdb) output.lower() 'traceback (most recent call last):\n file "/root/stage/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main\n "__main__", mod_spec)\n file "/root/stage /usr/lib/python3.6/runpy.py", line 85, in _run_code\n exec(code, run_globals)\n file "/root/parts/openstack-projects/install/lib/python3.6/site-packages/pip/__mai n__.py", line 23, in <module>\n from pip._internal.cli.main import main as _main # isort:skip # noqa\n file "/root/parts/openstack-projects/install/lib/python3.6 /site-packages/pip/_internal/cli/main.py", line 10, in <module>\n from pip._internal.cli.autocompletion import autocomplete\n file "/root/parts/openstack-projects /install/lib/python3.6/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>\n from pip._internal.cli.main_parser import create_main_parser\n fi le "/root/parts/openstack-projects/install/lib/python3.6/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>\n from pip._internal.cli import cmdop tions\n file "/root/parts/openstack-projects/install/lib/python3.6/site-packages/pip/_internal/cli/cmdoptions.py", line 19, in <module>\n from distutils.util impo rt strtobool\nmodulenotfounderror: no module named \'distutils.util\''

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 12
Quick Win: 2
Complexity: 18
Confidence: 96
Actionability: 25
close stale Legacy core18 Python pip check hid the underlying distutils traceback; the affected plugin path was removed with core18 support, making the report obsolete.
stealth/space-bunny-alpha
Impact: 20
Quick Win: 8
Complexity: 10
Confidence: 93
Actionability: 45
close stale Legacy pip presence checking hid the underlying pip traceback on repeat runs; that Snapcraft implementation has since been removed and the Python plugin now delegates to craft-parts.
stealth/space-bunny-alpha
Impact: 23
Quick Win: 18
Complexity: 12
Confidence: 92
Actionability: 88
close resolved Legacy Python plugin hid the underlying pip traceback, showing only 'Exited with code 1'. The code was removed with core18 support, but no direct fix commit is identified.
qwen/qwen3.8-27b
Impact: 20
Quick Win: 13
Staleness: 95
Complexity: 35
Confidence: 58
Support Request: 0
close stale Snapcraft's pip presence check swallows the real exception (ModuleNotFoundError: distutils.util) on second/subsequent runs, showing only 'Exited with code 1'. Legacy plugin code, Python 3.6 era, untriaged and inactive ~6 years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 90
Support Request: 10
close stale snapcraft fails to surface the real ModuleNotFoundError during pip checks, showing only a generic exit code 1. Untriaged, inactive for ~6 years, likely obsolete due to Python 3.12 distutils removal.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 30
Confidence: 90
Support Request: 10
close stale Unlabeled bug report from 6 years ago regarding snapcraft failing to surface the actual ModuleNotFoundError during pip checks. No maintainer response or activity since creation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 30
Confidence: 85
Support Request: 10
close stale Snapcraft fails to surface the actual ModuleNotFoundError during pip checks, showing only a generic exit code 1. Unaddressed for over 6 years.

Update history

Date Change
created

Related work

  • Related To: snapcraft (launchpad)#1864589 (confidence 99%)

    The reporter explicitly links this to #1864589 and identifies the same underlying `distutils.util` import failure.

Related issues

Issue Project State Summary Similarity
#1820843 re-running snapcraft when override-build dirty fails complaining about pip snapcraft (launchpad) closed Bug report about core18 python plugin failing with "No module named pip" on dirty rebuilds of an override-build part was closed as stale in Aug 2026; the python plugin has since changed substantially.
73%