evanhlavaty opened a new issue #17035:
URL: https://github.com/apache/airflow/issues/17035
**Apache Airflow version**: 2.1.2-python3.8 docker image
**Kubernetes version (if you are using kubernetes)** (use `kubectl
version`): 1.19.7
**Environment**:
- **Cloud provider or hardware configuration**: On premise K8 cluster
**What happened**:
I have a yaml file mounted to my container that gets spun up per DAG task.
This file is then referenced by the KubernetesPodOperator parameter
'pod_template_file'. After upgrading from 2.10 to 2.1.2 I get the following
error:
[2021-07-15 17:10:12,672] {taskinstance.py:1501} ERROR - Task failed with
exception
Traceback (most recent call last):
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1157, in _run_raw_task
self._prepare_and_execute_task_with_callbacks(context, task)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1294, in _prepare_and_execute_task_with_callbacks
self.render_templates(context=context)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1793, in render_templates
self.task.render_template_fields(context)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/baseoperator.py",
line 992, in render_template_fields
self._do_render_template_fields(self, self.template_fields, context,
jinja_env, set())
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/baseoperator.py",
line 1005, in _do_render_template_fields
rendered_content = self.render_template(content, context, jinja_env,
seen_oids)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/baseoperator.py",
line 1040, in render_template
return jinja_env.get_template(content).render(**context)
File
"/home/airflow/.local/lib/python3.8/site-packages/jinja2/environment.py", line
883, in get_template
return self._load_template(name, self.make_globals(globals))
File
"/home/airflow/.local/lib/python3.8/site-packages/jinja2/environment.py", line
857, in _load_template
template = self.loader.load(self, name, globals)
File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/loaders.py",
line 115, in load
source, filename, uptodate = self.get_source(environment, name)
File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/loaders.py",
line 197, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound:
/opt/airflow/pod_templates/base_pod_operator_file.yaml
This worked in 2.1.0 flawlessly. I have confirmed the file exists inside the
container at the correct path. I have changed nothing in my helm chart besides
the airflow image version.
**What you expected to happen**:
The KubernetesPodOperator to find the file at the provided file path.
**How to reproduce it**:
Use the KubernetesPodOperator and pass a file path to the pod_template_file
parameter.
--
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]