<p dir="auto"><strong>Apache Airflow version</strong>: 1.10.10</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: aws</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): ecs task</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): python 3.6 image</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Upgrading from 1.10.9 to 1.10.10 gave error when trying to access UI</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Node: 8cec32b7a064
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File &quot;/usr/local/lib/python3.6/site-packages/flask/app.py&quot;, line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File &quot;/usr/local/lib/python3.6/site-packages/flask/app.py&quot;, line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File &quot;/usr/local/lib/python3.6/site-packages/flask/app.py&quot;, line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File &quot;/usr/local/lib/python3.6/site-packages/flask/_compat.py&quot;, line 39, in reraise
    raise value
  File &quot;/usr/local/lib/python3.6/site-packages/flask/app.py&quot;, line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File &quot;/usr/local/lib/python3.6/site-packages/flask/app.py&quot;, line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File &quot;/usr/local/lib/python3.6/site-packages/flask_admin/base.py&quot;, line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File &quot;/usr/local/lib/python3.6/site-packages/flask_admin/base.py&quot;, line 368, in _run_view
    return fn(self, *args, **kwargs)
  File &quot;/usr/local/lib/python3.6/site-packages/flask_login/utils.py&quot;, line 258, in decorated_view
    return func(*args, **kwargs)
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/utils/db.py&quot;, line 74, in wrapper
    return func(*args, **kwargs)
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/www/views.py&quot;, line 2330, in index
    auto_complete_data=auto_complete_data)
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/www/views.py&quot;, line 389, in render
    return super(AirflowViewMixin, self).render(template, **kwargs)
  File &quot;/usr/local/lib/python3.6/site-packages/flask_admin/base.py&quot;, line 308, in render
    return render_template(template, **kwargs)
  File &quot;/usr/local/lib/python3.6/site-packages/flask/templating.py&quot;, line 140, in render_template
    ctx.app,
  File &quot;/usr/local/lib/python3.6/site-packages/flask/templating.py&quot;, line 120, in _render
    rv = template.render(context)
  File &quot;/usr/local/lib/python3.6/site-packages/jinja2/asyncsupport.py&quot;, line 76, in render
    return original_render(self, *args, **kwargs)
  File &quot;/usr/local/lib/python3.6/site-packages/jinja2/environment.py&quot;, line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File &quot;/usr/local/lib/python3.6/site-packages/jinja2/environment.py&quot;, line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File &quot;/usr/local/lib/python3.6/site-packages/jinja2/_compat.py&quot;, line 37, in reraise
    raise value.with_traceback(tb)
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/www/templates/airflow/dags.html&quot;, line 20, in top-level template code
    {% extends &quot;airflow/master.html&quot; %}
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/www/templates/airflow/master.html&quot;, line 20, in top-level template code
    {% extends &quot;admin/master.html&quot; %}
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/www/templates/admin/master.html&quot;, line 20, in top-level template code
    {% extends 'admin/base.html' %}
  File &quot;/usr/local/lib/python3.6/site-packages/flask_admin/templates/bootstrap3/admin/base.html&quot;, line 38, in top-level template code
    {% block page_body %}
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/www/templates/admin/master.html&quot;, line 191, in block &quot;page_body&quot;
    {% block body %}
  File &quot;/usr/local/lib/python3.6/site-packages/airflow/www/templates/airflow/dags.html&quot;, line 84, in block &quot;body&quot;
    &lt;a href=&quot;{{ url_for('airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}&quot; title=&quot;{{ dag.description[0:80] + '...' if dag.description|length &gt; 80 else dag.description }}&quot;&gt;
TypeError: object of type 'NoneType' has no len()"><pre class="notranslate"><code class="notranslate">Node: 8cec32b7a064
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/site-packages/flask_admin/base.py", line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_admin/base.py", line 368, in _run_view
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_login/utils.py", line 258, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 74, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/airflow/www/views.py", line 2330, in index
    auto_complete_data=auto_complete_data)
  File "/usr/local/lib/python3.6/site-packages/airflow/www/views.py", line 389, in render
    return super(AirflowViewMixin, self).render(template, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_admin/base.py", line 308, in render
    return render_template(template, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask/templating.py", line 140, in render_template
    ctx.app,
  File "/usr/local/lib/python3.6/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/usr/local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/site-packages/airflow/www/templates/airflow/dags.html", line 20, in top-level template code
    {% extends "airflow/master.html" %}
  File "/usr/local/lib/python3.6/site-packages/airflow/www/templates/airflow/master.html", line 20, in top-level template code
    {% extends "admin/master.html" %}
  File "/usr/local/lib/python3.6/site-packages/airflow/www/templates/admin/master.html", line 20, in top-level template code
    {% extends 'admin/base.html' %}
  File "/usr/local/lib/python3.6/site-packages/flask_admin/templates/bootstrap3/admin/base.html", line 38, in top-level template code
    {% block page_body %}
  File "/usr/local/lib/python3.6/site-packages/airflow/www/templates/admin/master.html", line 191, in block "page_body"
    {% block body %}
  File "/usr/local/lib/python3.6/site-packages/airflow/www/templates/airflow/dags.html", line 84, in block "body"
    &lt;a href="{{ url_for('airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}" title="{{ dag.description[0:80] + '...' if dag.description|length &gt; 80 else dag.description }}"&gt;
TypeError: object of type 'NoneType' has no len()
</code></pre></div>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">See UI</p>
<p dir="auto"><strong>How to reproduce it</strong>:<br>
Upgrade airflow<br>
<code class="notranslate">airflow upgradedb</code></p>
<p dir="auto"><strong>Apache Airflow version</strong>: airflow 1.10.10</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>OS</strong> (e.g. from /etc/os-release): Mac</li>
</ul>
<p dir="auto"><strong>What happened</strong>:<br>
<code class="notranslate">Ooops! throws exception File "/Users/muru/opensrc/py36/airflow_110/venv368/lib/python3.6/site-packages/airflow/www/templates/airflow/dags.html", line 84, in block "body" &lt;a href="{{ url_for('airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}" title="{{ dag.description[0:80] + '...' if dag.description|length &gt; 80 else dag.description }}"&gt; TypeError: object of type 'NoneType' has no len()</code></p>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
Should able to load page without errors or exceptions.</p>

<p dir="auto">The description column in dag table can be null. But in the dags.html, should check dag.decription is not null before perform length filter.</p>
<p dir="auto"><strong>How to reproduce it</strong>:<br>
migrate airflow 1.9.0 to 1.10.10<br>
Perform airflow upgradedb<br>
start airflow webserver<br>
launch and open <a href="http://localhost:8080/" rel="nofollow">http://localhost:8080/</a></p>
<p dir="auto"><strong>Anything else we need to know</strong>:<br>
Line 84 in airflow/www/templates/airflow/dags.html file, replace the condition<br>
<code class="notranslate">if dag.description|length &gt; 80  change to if dag.description and dag.description|length &gt; 80</code></p>

<p dir="auto">As a workaround, perform the following db update and open <a href="http://localhost:8080/" rel="nofollow">http://localhost:8080/</a><br>
<code class="notranslate">update dag set description=' ' where description is null;</code></p>