You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git is now only available at build time and not also at app run time.
If your app needs Git at run time for other purposes, install it using the APT buildpack:
Add the buildpack (if you are not already using it), with: heroku buildpacks:add --index 1 heroku-community/apt
Create a file named Aptfile in the root of your app source code, containing the package name git on its own line.
Add export GIT_EXEC_PATH=/app/.apt/usr/lib/git-core to any Bash scripts that call Git at run time, so that Git can find the custom installation. (This step is only necessary until heroku/heroku-buildpack-apt#137 is fixed, and prevents a git: 'remote-https' is not a git command error.)
Logs
Since I didn't do any of the steps above as part of the upgrade process to Heroku Stack-24, here's the error logs I got:
Starting process with command `python3 hubcap.py` by user [email protected]
Starting process with command `python3 hubcap.py`
State changed from starting to up
Traceback (most recent call last):
File ""/app/.heroku/python/lib/python3.9/site-packages/git/__init__.py"", line 89, in <module>
refresh()
File ""/app/.heroku/python/lib/python3.9/site-packages/git/__init__.py"", line 76, in refresh
if not Git.refresh(path=path):
File ""/app/.heroku/python/lib/python3.9/site-packages/git/cmd.py"", line 392, in refresh
raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()
All git commands will error until this is rectified.
This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception
Example:
export GIT_PYTHON_REFRESH=quiet
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ""/app/hubcap.py"", line 6, in <module>
from hubcap import package
File ""/app/hubcap/package.py"", line 7, in <module>
from git import Repo
File ""/app/.heroku/python/lib/python3.9/site-packages/git/__init__.py"", line 91, in <module>
raise ImportError(""Failed to initialize: {0}"".format(exc)) from exc
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()
All git commands will error until this is rectified.
This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception"
Example:
export GIT_PYTHON_REFRESH=quiet
Process exited with status 1
State changed from up to complete
The text was updated successfully, but these errors were encountered:
Reason
Starting with Heroku Stack-24, if
git
is needed at runtime, then it has to be installed using the APT buildpack.hupcap.py
definitely needsgit
at run time!Instructions
https://devcenter.heroku.com/articles/heroku-24-stack#upgrading-to-heroku-24
Logs
Since I didn't do any of the steps above as part of the upgrade process to Heroku Stack-24, here's the error logs I got:
The text was updated successfully, but these errors were encountered: