raphaelauv edited a comment on issue #17037:
URL: https://github.com/apache/airflow/issues/17037#issuecomment-881919794


   for the **docker** provider
   
   apache-airflow-providers-docker==2.1.0rc1
   
   **still failing for docker in docker**
   
   I tried with 
   
   airflow 2.1.2
   
   ```python
   t3 = DockerOperator(
       api_version='auto',
       docker_url="unix://var/run/docker.sock",
       command='/bin/sleep 30',
       image='centos:latest',
       network_mode='bridge',
       task_id='docker_op_tester',
       dag=dag,
   )
   ```
   
   give
   
   ```
   Traceback (most recent call last):
     File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 
268, in _raise_for_status
       response.raise_for_status()
     File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 
953, in raise_for_status
       raise HTTPError(http_error_msg, response=self)
   requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: 
http+docker://localhost/v1.41/containers/create
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/docker/operators/docker.py",
 line 253, in _run_image
       return self._run_image_with_mounts(self.mounts + [tmp_mount], 
add_tmp_variable=True)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/docker/operators/docker.py",
 line 272, in _run_image_with_mounts
       self.container = self.cli.create_container(
     File "/usr/local/lib/python3.9/site-packages/docker/api/container.py", 
line 430, in create_container
       return self.create_container_from_config(config, name)
     File "/usr/local/lib/python3.9/site-packages/docker/api/container.py", 
line 441, in create_container_from_config
       return self._result(res, True)
     File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 
274, in _result
       self._raise_for_status(response)
     File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 
270, in _raise_for_status
       raise create_api_error_from_http_exception(e)
     File "/usr/local/lib/python3.9/site-packages/docker/errors.py", line 31, 
in create_api_error_from_http_exception
       raise cls(e, response=response, explanation=explanation)
   docker.errors.APIError: 400 Client Error for 
http+docker://localhost/v1.41/containers/create: Bad Request ("invalid mount 
config for type "bind": bind source path does not exist: 
/tmp/airflowtmp3d8fxnte")
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File 
"/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 
1157, in _run_raw_task
       self._prepare_and_execute_task_with_callbacks(context, task)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 
1331, in _prepare_and_execute_task_with_callbacks
       result = self._execute_task(context, task_copy)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 
1361, in _execute_task
       result = task_copy.execute(context=context)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/docker/operators/docker.py",
 line 346, in execute
       return self._run_image()
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/docker/operators/docker.py",
 line 255, in _run_image
       if self.host_tmp_dir in str(e):
   TypeError: 'in <string>' requires string as left operand, not NoneType
   ```
   
   the line 
   
   if self.host_tmp_dir in str(e):
   
   is buggy


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to