Improve the error message when bundled pip cannot be found #1720
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Python stdlib bundles a copy of pip, which the buildpack uses to bootstrap the real pip installation. This copy of pip should always exist, and thus not finding it is treated as an internal error.
However, via Honeycomb I discovered one app that manages to hit this case regardless, and when it does so, the error message is not the "internal error" error message, but instead a Bash unbound variable error like:
My guess for why pip is not being found in this case is that the app's Git repo may have a broken/EOL Python install committed to it (which doesn't include the
ensurepip
module), which tricks the cache restoration into thinking it can re-use the cache.I will be adding an explicit warning/error for finding an existing
.heroku/python/
directory in the app in a later PR, however, for now this change:(a) fixes the display of the internal error message,
(b) adds more debugging output to the error message so that I can confirm my theory as to the root cause for this app.
Towards #1710.
GUS-W-17386432.