[
https://issues.apache.org/jira/browse/AIRFLOW-6347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17009955#comment-17009955
]
ASF GitHub Bot commented on AIRFLOW-6347:
-----------------------------------------
kaxil commented on pull request #7092: [AIRFLOW-6347] BugFix: Can't get task
logs when serialization is enabled
URL: https://github.com/apache/airflow/pull/7092
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> Can't get task logs in webUI when DAG serialization is enabled
> --------------------------------------------------------------
>
> Key: AIRFLOW-6347
> URL: https://issues.apache.org/jira/browse/AIRFLOW-6347
> Project: Apache Airflow
> Issue Type: Bug
> Components: DAG, webserver
> Affects Versions: 1.10.7
> Reporter: Anton Cherkasov
> Assignee: Kaxil Naik
> Priority: Major
> Attachments: serialization-disabled.png, serialization_enabled.png
>
>
> When I set next config options in airflow.cfg:
> {noformat}
> [core]
> store_serialized_dags = True
> min_serialized_dag_update_interval = 3{noformat}
>
> View with task logs shows infinity Js spinner, while in webserver log I see
> next error:
> {noformat}
> [2019-12-25 14:48:57,640] {{app.py:1891}} ERROR - Exception on
> /get_logs_with_metadata [GET]
> Traceback (most recent call last):
> File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in
> wsgi_app
> response = self.full_dispatch_request()
> File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in
> full_dispatch_request
> rv = self.handle_user_exception(e)
> File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in
> handle_user_exception
> reraise(exc_type, exc_value, tb)
> File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in
> reraise
> raise value
> File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in
> full_dispatch_request
> rv = self.dispatch_request()
> File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in
> dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/www_rbac/decorators.py",
> line 121, in wrapper
> return f(self, *args, **kwargs)
> File
> "/usr/local/lib/python3.7/site-packages/flask_appbuilder/security/decorators.py",
> line 101, in wraps
> return f(self, *args, **kwargs)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/www_rbac/decorators.py",
> line 56, in wrapper
> return f(*args, **kwargs)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/utils/db.py",
> line 74, in wrapper
> return func(*args, **kwargs)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/www_rbac/views.py",
> line 637, in get_logs_with_metadata
> logs, metadata = _get_logs_with_metadata(try_number, metadata)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/www_rbac/views.py",
> line 628, in _get_logs_with_metadata
> logs, metadatas = handler.read(ti, try_number, metadata=metadata)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/utils/log/file_task_handler.py",
> line 169, in read
> log, metadata = self._read(task_instance, try_number_element, metadata)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/utils/log/file_task_handler.py",
> line 98, in _read
> log_relative_path = self._render_filename(ti, try_number)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/utils/log/file_task_handler.py",
> line 75, in _render_filename
> jinja_context = ti.get_template_context()
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/utils/db.py",
> line 74, in wrapper
> return func(*args, **kwargs)
> File
> "/usr/local/airflow/.local/lib/python3.7/site-packages/airflow/models/taskinstance.py",
> line 1149, in get_template_context
> if 'tables' in task.params:
> TypeError: argument of type 'NoneType' is not iterable{noformat}
> After some investigation I found that *task.params* field is _empty dict_
> when DAG serialization is disabled and this field became _None object_ after
> enabling serialization.
> Screenshot of _Task Instance Details_ view with *enabled* DAG serialization
> feature: !serialization_enabled.png!
>
> Screenshot of _Task Instance Details_ view with *disabled* DAG serialization
> feature:
> !serialization-disabled.png!
>
> See the _params_ field.
> h2. Steps to reproduce:
> # Install Airflow 1.10.7 or upgrade from previous one
> # Upload some DAG and perform tasks.
> # Enable DAG serialization in airflow.conf
> # Restart airflow scheduler and webserver
> # Go to task's log view
> # See infinity spinner and errors in webserver logs
--
This message was sent by Atlassian Jira
(v8.3.4#803005)