Skip to content

Commit e35fdb2

Browse files
committed
Fix issue: Sentry causes failures in 2.9.2
Fix issue aws#121. The issue is caused because we are trying to initialize the DB before installing the requirements. This causes this line in Airflow code base to fail because `sentry_sdk` isn't installed yet: https://github.com/apache/airflow/blob/2.9.2/airflow/sentry.py#L58 To fix this issue, I moved the installation of PIP requirements before the DB initialization. This is unrelated to this issue, but when creating a process to install the requirements, there is no need to pass the environment variables we craft for Airflow processes, as what we simply just running a pip install command.
1 parent 104560a commit e35fdb2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

images/airflow/2.9.2/python/mwaa/entrypoint.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ async def install_user_requirements(cmd: str, environ: dict[str, str]):
259259

260260
pip_process = Subprocess(
261261
cmd=["safe-pip-install", "-r", requirements_file, *extra_args],
262-
env=environ,
263262
process_logger=subprocess_logger,
264263
conditions=[
265264
TimeoutCondition(USER_REQUIREMENTS_MAX_INSTALL_TIME),
@@ -683,6 +682,7 @@ async def main() -> None:
683682
# being captured and sent to the service hosting.
684683
logger.debug(f"Environment variables: %s", environ)
685684

685+
await install_user_requirements(command, environ)
686686
await airflow_db_init(environ)
687687
if os.environ.get("MWAA__CORE__AUTH_TYPE", "").lower() == "testing":
688688
# In "simple" auth mode, we create an admin user "airflow" with password
@@ -691,7 +691,6 @@ async def main() -> None:
691691
# production environments.
692692
await create_airflow_user(environ)
693693
create_queue()
694-
await install_user_requirements(command, environ)
695694

696695
# Export the environment variables to .bashrc and .bash_profile to enable
697696
# users to run a shell on the container and have the necessary environment

0 commit comments

Comments
 (0)