New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Exit bench init early if Frappe or other apps installed incorrectly #1083
Conversation
pip_install_code = exec_cmd("{pip} install {quiet} -U -e {app} {no_cache}".format( | ||
pip=pip_path, quiet=quiet_flag, app=app_path, no_cache=cache_flag)) | ||
if pip_install_code: | ||
sys.exit(pip_install_code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a screenshot of how this would execute now, after this change?
Co-authored-by: gavin <gavin18d@gmail.com>
@gavindsouza About screenshot, I documented a lot of the diagnosis process here: https://about.lovia.life/docs/infrastructure/erpnext/install-erpnext-on-ubuntu-vm/#Troubleshooting_3_psycopg2 So this was what happened: My patch stopped the execution if an error happened, since it doesn't make sense to continue....... which will throw another error anyway (with even more confusing error). By stopping early, it's easier for user to figure out what went wrong, fix it, then they can retry. |
@ceefour I get that part. I wasn't able to replicate failing dependency setups and I'd like to see how bench would exit with the proposed fix. Can you show me a replicable screenshot so that there are no unknowns before we go ahead with this change? Also, there's an indentation error. Can you fix that? |
One way that happened to me is low disk space.. So to reproduce it:
|
@@ -174,7 +174,13 @@ def install_app(app, bench_path=".", verbose=False, no_cache=False, restart_benc | |||
app_path = os.path.join(bench_path, "apps", app) | |||
cache_flag = "--no-cache-dir" if no_cache else "" | |||
|
|||
exec_cmd("{pip} install {quiet} -U -e {app} {no_cache}".format(pip=pip_path, quiet=quiet_flag, app=app_path, no_cache=cache_flag)) | |||
pip_install_code = exec_cmd( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ceefour Indentation error
Now, bench exits whenever any |
Thank youuu @gavindsouza |
Fixes #1082
What type of a PR is this?
Detect if command failed, then exit with status 1.
In
bench/app.py
install_app()
->bench.utils.exec_cmd()