airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-2665) No BASH will cause the dag to fail
Date Mon, 29 Oct 2018 17:31:14 GMT


ASF GitHub Bot commented on AIRFLOW-2665:

ashb closed pull request #3799: [AIRFLOW-2665] Use shlex to split args and remove shell true

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/executors/ b/airflow/executors/
index 291d6e1277..2212933f66 100644
--- a/airflow/executors/
+++ b/airflow/executors/
@@ -46,8 +46,10 @@
 import multiprocessing
 import subprocess
+import shlex
 import time
 from builtins import range
 from airflow.executors.base_executor import BaseExecutor
@@ -82,8 +84,11 @@ def execute_work(self, key, command):
         if key is None:
             return"%s running %s", self.__class__.__name__, command)
+        if isinstance(command, list):
+            command = " ".join(command)
+        args = shlex.split(command)
-            subprocess.check_call(command, close_fds=True)
+            subprocess.check_call(args, close_fds=True)
             state = State.SUCCESS
         except subprocess.CalledProcessError as e:
             state = State.FAILED


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> No BASH will cause the dag to fail
> ----------------------------------
>                 Key: AIRFLOW-2665
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Christian Barra
>            Priority: Major
>              Labels: easy-fix
> If you are a running airflow in a system where bash is not available the dags will fail,
with no logs inside the UI (you have to scroll through the local logs).
> How to replicate this? just use an alpine based image:
> ```
> [2018-06-22 21:05:20,659] \{} INFO - Processing DAG_1
>  [2018-06-22 21:05:20,667] \{} INFO - LocalWorker running airflow
run DAG_1 stackoverflow 2018-06-22T21:05:19.384402 --local -sd /usr/local/airflow/dags/
>  /bin/sh: exec: line 1: bash: not found
>  [2018-06-22 21:05:20,671] \{} ERROR - Failed to execute task Command
'exec bash -c 'airflow run DAG_1 my_task 2018-06-22T21:05:19.384402 --local -sd /usr/local/airflow/dags/''
returned non-zero exit status 127..
>  /bin/sh: exec: line 1: bash: not found
> ```

This message was sent by Atlassian JIRA

View raw message