Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Airflow version: 2.3.3 RuntimeError: Unable to find any timezone configuration #42558

Closed
2 tasks done
psubudhi opened this issue Sep 28, 2024 · 9 comments
Closed
2 tasks done
Labels
area:core area:webserver Webserver related Issues kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet pending-response

Comments

@psubudhi
Copy link

Apache Airflow version

2.10.1

If "Other Airflow 2 version" selected, which one?

2.3.3

What happened?

Started airflow scheduler and webserver and opened the endpoint for 6007 from Jarvis lab. Got below error.

Ooops!
Something bad has happened.

Airflow is used by many users, and it is very likely that others had similar problems and you can easily find
a solution to your problem.

Consider following these steps:

  • gather the relevant information (detailed logs with errors, reproduction steps, details of your deployment)

  • find similar issues using:

  • if you run Airflow on a Managed Service, consider opening an issue using the service support channels

  • if you tried and have difficulty with diagnosing and fixing the problem yourself, consider creating a bug report.
    Make sure however, to include all relevant details and results of your investigation so far.

Python version: 3.8.12
Airflow version: 2.3.3
Node: f6d2b5df6971

Traceback (most recent call last):
File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 1519, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 1517, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/conda/lib/python3.8/site-packages/flask/app.py", line 1503, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/opt/conda/lib/python3.8/site-packages/airflow/www/auth.py", line 46, in decorated
return func(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/airflow/www/views.py", line 964, in index
return self.render_template(
File "/opt/conda/lib/python3.8/site-packages/airflow/www/views.py", line 709, in render_template
return super().render_template(
File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/baseviews.py", line 322, in render_template
return render_template(
File "/opt/conda/lib/python3.8/site-packages/flask/templating.py", line 154, in render_template
return _render(
File "/opt/conda/lib/python3.8/site-packages/flask/templating.py", line 128, in _render
rv = template.render(context)
File "/opt/conda/lib/python3.8/site-packages/jinja2/environment.py", line 1291, in render
self.environment.handle_exception()
File "/opt/conda/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/opt/conda/lib/python3.8/site-packages/airflow/www/templates/airflow/dags.html", line 43, in top-level template code
{% elif curr_ordering_direction == 'asc' and request.args.get('sorting_key') == attribute_name %}
File "/opt/conda/lib/python3.8/site-packages/airflow/www/templates/airflow/main.html", line 21, in top-level template code
{% from 'airflow/_messages.html' import show_message %}
File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 2, in top-level template code
{% import 'appbuilder/baselib.html' as baselib %}
File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 37, in top-level template code
{% block body %}
File "/opt/conda/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 16, in block 'body'
{% block messages %}
File "/opt/conda/lib/python3.8/site-packages/airflow/www/templates/airflow/dags.html", line 104, in block 'messages'
{{ super() }}
File "/opt/conda/lib/python3.8/site-packages/airflow/www/templates/airflow/main.html", line 62, in block 'messages'
{% call show_message(category='warning', dismissible=false) %}
File "/opt/conda/lib/python3.8/site-packages/jinja2/runtime.py", line 828, in _invoke
rv = self._func(*arguments)
File "/opt/conda/lib/python3.8/site-packages/airflow/www/templates/airflow/_messages.html", line 25, in template
{{ caller() }}
File "/opt/conda/lib/python3.8/site-packages/jinja2/runtime.py", line 828, in _invoke
rv = self._func(*arguments)
File "/opt/conda/lib/python3.8/site-packages/airflow/www/templates/airflow/main.html", line 70, in template
>{{ macros.datetime_diff_for_humans(scheduler_job.latest_heartbeat) }}.
File "/opt/conda/lib/python3.8/site-packages/airflow/macros/init.py", line 77, in datetime_diff_for_humans
return pendulum.instance(dt).diff_for_humans(since)
File "/opt/conda/lib/python3.8/site-packages/pendulum/datetime.py", line 824, in diff_for_humans
other = self.now()
File "/opt/conda/lib/python3.8/site-packages/pendulum/datetime.py", line 106, in now
return pendulum.now(tz)
File "/opt/conda/lib/python3.8/site-packages/pendulum/init.py", line 211, in now
dt = _datetime.datetime.now(local_timezone())
File "/opt/conda/lib/python3.8/site-packages/pendulum/tz/init.py", line 60, in local_timezone
return get_local_timezone()
File "/opt/conda/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 35, in get_local_timezone
tz = _get_system_timezone()
File "/opt/conda/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 63, in _get_system_timezone
return _get_unix_timezone()
File "/opt/conda/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 242, in _get_unix_timezone
raise RuntimeError("Unable to find any timezone configuration")
RuntimeError: Unable to find any timezone configuration

What you think should happen instead?

UI should open

How to reproduce

Open the UI

Operating System

Linux f6d2b5df6971 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Versions of Apache Airflow Providers

2.3.3

Deployment

Other

Deployment details

NA

Anything else?

NA

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@psubudhi psubudhi added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Sep 28, 2024
Copy link

boring-cyborg bot commented Sep 28, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@dosubot dosubot bot added the area:webserver Webserver related Issues label Sep 28, 2024
@koustreak
Copy link

env:

  • name: AIRFLOW__CORE__DEFAULT_TIMEZONE
    value: "UTC"

Have you tried this one ??

@jscheffl
Copy link
Contributor

Version 2.3.3 of Airflow is pretty pretty old. Have you considered upgrading to a more recent version?

@psubudhi
Copy link
Author

psubudhi commented Oct 1, 2024 via email

@psubudhi
Copy link
Author

psubudhi commented Oct 1, 2024

I checked the config

default_timezone = utc

@psubudhi
Copy link
Author

psubudhi commented Oct 1, 2024

fyi

image
image

@jscheffl
Copy link
Contributor

jscheffl commented Oct 1, 2024

Re-reading the stack trace there is something seriously wrog with your system anyway. The error is rooted becasue the webser attempts to render an error message that the scheduler in unhealty.

Are you sure that the default_timezone is set consistently across all nodes? Looking at the configuration reference utcis actually the default (see https://airflow.apache.org/docs/apache-airflow/2.3.3/configurations-ref.html)

Note that the upper case version AIRFLOW__CORE__... in your config is the version to over-ride the CFG file from ENV variables. To debug what actually is used, can you open a shell i nthe context of the webserver and run airflow config list on the command line and check which value is active?

@psubudhi
Copy link
Author

psubudhi commented Oct 2, 2024 via email

@jscheffl
Copy link
Contributor

jscheffl commented Oct 2, 2024

Conflig looks good but still I feel like the exception is not usual.

Hypothesis: Something is broken in your install. One option would be a clean re-install (don't forget to use the right constraints) and even much better I'd recommend to use a recent version. 2.3.3 for sure will not receive fixes. And the error is so basic that I doubt it is a SW problem but rather something in your setup or environment. Config at least looks "proper".

@apache apache locked and limited conversation to collaborators Oct 2, 2024
@jscheffl jscheffl converted this issue into discussion #42675 Oct 2, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
area:core area:webserver Webserver related Issues kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet pending-response
Projects
None yet
Development

No branches or pull requests

3 participants