diff --git a/src/autoupdate_impl.py b/src/autoupdate_impl.py index ed15a0b8..f7dd6ebe 100644 --- a/src/autoupdate_impl.py +++ b/src/autoupdate_impl.py @@ -113,12 +113,15 @@ def check_updates(context: AutoUpdateContext) -> bool: log.warning(f"{e.command}: {e.stderr}") else: raise e - p = subprocess.run(f"{sys.executable} -m pip install -r requirements.txt", shell=True) + p = subprocess.run(f"{sys.executable} -m pip install -r requirements.txt", shell=True, capture_output=True) if p.returncode != 0: mail.send( secret_config.admin_email_list, "Autoupdate error", - get_autoupdate_error_message(f"Failed to fetch requirements.txt. Return code: {p.returncode}")) + get_autoupdate_error_message( + f"Failed to fetch requirements.txt. Return code: {p.returncode}\n" + f"stdout:\n{p.stdout}\n" + f"stderr:\n{p.stderr}\n")) minibot_response = "WalBot automatic update is in progress. Please, wait..." subprocess.call(f"{sys.executable} walbot.py startmini --message '{minibot_response}' --nohup &", shell=True) p = subprocess.run(f"{sys.executable} walbot.py stop", shell=True)