Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ooops #16802

Closed
zhengyansheng opened this issue Jul 4, 2021 · 9 comments
Closed

Ooops #16802

zhengyansheng opened this issue Jul 4, 2021 · 9 comments
Labels
kind:bug This is a clearly a bug

Comments

@zhengyansheng
Copy link

Browser

Something bad has happened.
Please consider letting us know by creating a bug report using GitHub.

Python version: 3.7.10
Airflow version: 2.1.0
Node: apache-airflow-server

Traceback (most recent call last):
File "/usr/local/python37/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/python37/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/python37/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/python37/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/python37/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/python37/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/local/python37/lib/python3.7/site-packages/airflow/www/auth.py", line 34, in decorated
return func(*args, **kwargs)
File "/usr/local/python37/lib/python3.7/site-packages/airflow/www/views.py", line 668, in index
tags_filter=arg_tags_filter,
File "/usr/local/python37/lib/python3.7/site-packages/airflow/www/views.py", line 439, in render_template
**kwargs,
File "/usr/local/python37/lib/python3.7/site-packages/flask_appbuilder/baseviews.py", line 288, in render_template
template, **dict(list(kwargs.items()) + list(self.extra_args.items()))
File "/usr/local/python37/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/usr/local/python37/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/usr/local/python37/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/local/python37/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/local/python37/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/usr/local/python37/lib/python3.7/site-packages/airflow/www/templates/airflow/dags.html", line 21, in top-level template code
{% from 'appbuilder/loading_dots.html' import loading_dots %}
File "/usr/local/python37/lib/python3.7/site-packages/airflow/www/templates/airflow/main.html", line 20, in top-level template code
{% extends 'appbuilder/baselayout.html' %}
File "/usr/local/python37/lib/python3.7/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 2, in top-level template code
{% import 'appbuilder/baselib.html' as baselib %}
File "/usr/local/python37/lib/python3.7/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 46, in top-level template code
{% block body %}
File "/usr/local/python37/lib/python3.7/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 16, in block "body"
{% block messages %}
File "/usr/local/python37/lib/python3.7/site-packages/airflow/www/templates/airflow/main.html", line 62, in block "messages"
>{{ macros.datetime_diff_for_humans(scheduler_job.latest_heartbeat) }}.
File "/usr/local/python37/lib/python3.7/site-packages/airflow/macros/init.py", line 83, in datetime_diff_for_humans
return pendulum.instance(dt).diff_for_humans(since)
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/datetime.py", line 824, in diff_for_humans
other = self.now()
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/datetime.py", line 106, in now
return pendulum.now(tz)
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/init.py", line 211, in now
dt = _datetime.datetime.now(local_timezone())
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/init.py", line 60, in local_timezone
return get_local_timezone()
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/local_timezone.py", line 35, in get_local_timezone
tz = _get_system_timezone()
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/local_timezone.py", line 63, in _get_system_timezone
return _get_unix_timezone()
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/local_timezone.py", line 165, in _get_unix_timezone
with open(tzpath, "rb") as tzfile:
IsADirectoryError: [Errno 21] Is a directory: '/etc/timezone'

command line

python -c 'import pendulum;print(pendulum.now())'

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/init.py", line 211, in now
dt = _datetime.datetime.now(local_timezone())
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/init.py", line 60, in local_timezone
return get_local_timezone()
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/local_timezone.py", line 35, in get_local_timezone
tz = _get_system_timezone()
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/local_timezone.py", line 63, in _get_system_timezone
return _get_unix_timezone()
File "/usr/local/python37/lib/python3.7/site-packages/pendulum/tz/local_timezone.py", line 165, in _get_unix_timezone
with open(tzpath, "rb") as tzfile:
IsADirectoryError: [Errno 21] Is a directory: '/etc/timezone'

@zhengyansheng zhengyansheng added the kind:bug This is a clearly a bug label Jul 4, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 4, 2021

Thanks for opening your first issue here! Be sure to follow the issue template!

@uranusjr
Copy link
Member

uranusjr commented Jul 4, 2021

Looks like an upstream bug python-pendulum/pendulum#256

@ashb
Copy link
Member

ashb commented Jul 7, 2021

What environment are you running in ? You can probably work around this by setting TZ=UTC environment variable.

Since this is a bug in pendulum (and there's a workaround) with not all that much we can do in Airflow I'm going to close this.

@beci
Copy link

beci commented Jan 25, 2022

Hey @ashb, you should reopen, it's still an issue, the workaround isn't complete.

The pendulum bug already fixed, but have to wait for the new release.

@potiuk
Copy link
Member

potiuk commented Jan 25, 2022

Hey @ashb, you should reopen, it's still an issue, the workaround isn't complete.

Why ? Isn't that the case that you can set TZ=UTC and the problem is gone? Will that not work for you @beci ?

@beci
Copy link

beci commented Jan 28, 2022

You can set TZ=UTC unless you would like to use another TZ. Btw I don't use airflow ATM, I just notified you.

It's your decision to choose between to sweep under the rug or solving it.

@potiuk
Copy link
Member

potiuk commented Jan 28, 2022

It's not sweeping unde the rug. it's discussed in a public and workaround is present and the ONLY way to get a fix is to get a new release.

I am quite sure that discussing problem in public, providing a workaround and making a fix available in next "Backward-compatible release" (according to SemVer we adopt in Airlfow) is the right approach.

What would be your proposal of "not sweeping it under the rug" I wonder?

@beci
Copy link

beci commented Jan 30, 2022

I mean there is a workaround, but only if UTC is acceptable, therefore the bug still exists.
I don't know what's best when you depend on a broken package. I would reopen this issue, wait until pendulum release the fix, and apply that.

@potiuk
Copy link
Member

potiuk commented Jan 30, 2022

When pendulum releases the fix there is nothing to do. The new version of pendulum will be automatically updated if the tests pass. Our CI system automatically upgrades to latest versions of released dependencies (providing that the tests pass).

So ... there is nothing to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

5 participants