kolfild26 opened a new issue, #23607:
URL: https://github.com/apache/airflow/issues/23607

   ### Apache Airflow version
   
   2.3.0 (latest released)
   
   ### What happened
   
   Hi,
   Tried to upgrade from v.2.2.3 to v.2.3.
   
   `airflow db upgrade:`
   ```
   
   ./airflow2.3/lib/python3.8/site-packages/airflow/configuration.py:412:
   FutureWarning: The 'log_filename_template' setting in [logging] has the old 
default value of '{{ ti.dag_id }}/{{ ti.task_id }}/{{ ts }}/{{ try_number 
}}.log'. This value has been changed to 'dag_id={{ ti.dag_id }}/run_id={{ 
ti.run_id }}/task_id={{ ti.task_id }}/{% if ti.map_index >= 0 %}map_index={{ 
ti.map_index }}/{% endif %}attempt={{ try_number }}.log' in the running config, 
but please update your config before Apache Airflow 3.0.
   ```
   
   I reviewed my airflow.cfg file and changed what was recommended by the 
waring message. And also checked [the default config 
file](https://github.com/apache/airflow/blob/main/airflow/config_templates/default_airflow.cfg)
 in the airflow github repository. Here is the same string:
   `log_filename_template = dag_id={{{{ ti.dag_id }}}}/run_id={{{{ ti.run_id 
}}}}/task_id={{{{ ti.task_id }}}}/{{%% if ti.map_index >= 0 %%}}map_index={{{{ 
ti.map_index }}}}/{{%% endif %%}}attempt={{{{ try_number }}}}.log`
   
   But after I run again I get the exception:
   `airflow db upgrade --show-sql-only:`
   ```
   Unable to load the config, contains a configuration error.
   Traceback (most recent call last):
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/logging/config.py", line 
563, in configure
       handler = self.configure_handler(handlers[name])
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/logging/config.py", line 
744, in configure_handler
       result = factory(**kwargs)
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/airflow/utils/log/file_task_handler.py",
 line 51, in __init__
       self.filename_template, self.filename_jinja_template = 
parse_template_string(filename_template)
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/airflow/utils/helpers.py",
 line 176, in parse_template_string
       return None, jinja2.Template(template_string)
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/jinja2/environment.py",
 line 1195, in __new__
       return env.from_string(source, template_class=cls)
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/jinja2/environment.py",
 line 1092, in from_string
       return cls.from_code(self, self.compile(source), gs, None)
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/jinja2/environment.py",
 line 757, in compile
       self.handle_exception(source=source_hint)
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/jinja2/environment.py",
 line 925, in handle_exception
       raise rewrite_traceback_stack(source=source)
     File "<unknown>", line 1, in template
   jinja2.exceptions.TemplateSyntaxError: expected token ':', got '}'
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/media/data/anaconda3/envs/airflow2.3/bin/airflow", line 5, in 
<module>
       from airflow.__main__ import main
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/airflow/__init__.py",
 line 47, in <module>
       settings.initialize()
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/airflow/settings.py",
 line 561, in initialize
       LOGGING_CLASS_PATH = configure_logging()
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/airflow/logging_config.py",
 line 73, in configure_logging
       raise e
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/site-packages/airflow/logging_config.py",
 line 68, in configure_logging
       dictConfig(logging_config)
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/logging/config.py", line 
808, in dictConfig
       dictConfigClass(config).configure()
     File 
"/media/data/anaconda3/envs/airflow2.3/lib/python3.8/logging/config.py", line 
570, in configure
       raise ValueError('Unable to configure handler '
   ValueError: Unable to configure handler 'task'
   ```
   it seems that it is the **log_filename_template** parameter causes the error 
as:
   
   - there are no any other exceptions or error messages
   - exception disapears when reverting the changes
   
   I don't really know whether this FutureWarning causes any problems with 
working with airflow. And is it okay to stay with the old value of the 
**log_filename_template**?
   
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   1. upgrade airflow installation from [pip apache 
airflow](https://pypi.org/project/apache-airflow/)
   2. run `airflow db upgrade`
   
   
   ### Operating System
   
   Oracle Linux 7.8
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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