-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Webserver shows wrong datetime (timezone) in log #19342
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Faced the same thing on 2.2.0, but did not issue the problem. |
2.2.0 and 2.2.1 both facing the same issue. |
I believe it is an issue with the added |
I'm interested in this issue, will try to give a fix. Thx. |
I followed the merge code, but not fix this issue, the webserver still shows wrong datetime in log |
What's your server's timezone and Airflow config's default timezone? |
Has this patch been added to the 2.2.2? Because the bug is still exists in it. |
it seems not. The pr was merged into |
I know what's the problem, I should change the js file tiLog.478df866123cef0b0eae.js under 'airflow/www/static/dist' directly instead of 'airflow/www/static/js/ti_log.js'. Once I restart the webserver, the datetime became the right one. Thanks for your reply anyway. |
Sounds like webpack wasn't rebuilding the files. In the future, you can run |
Got it, and thank you so much. I don't know much about front-end development. |
Hey, Can you tell me what changes do I have to do in this .js file. I am not familiar to javascript. I did the changes in “ti_log.js”. But the logs are same. Can you please tell the changes to be done in tiLog.478df866123cef0eae.js |
Thank you |
airflow db shell mysql> show global variables like '%timestamp%'; mysql> set global explicit_defaults_for_timestamp =1; |
Apache Airflow version
2.2.1 (latest released)
Operating System
Ubuntu 20.04.2 (docker)
Versions of Apache Airflow Providers
Deployment
Docker-Compose
Deployment details
Docker image build on Ubuntu 20.04 -> installed apache airflow via pip.
Localtime in image changed to Europe/Moscow.
Log format ariflow.cfg option:
log_format = %%(asctime)s %%(filename)s:%%(lineno)d %%(levelname)s - %%(message)s
What happened
For my purposes it's more usefull to run dags when it's midnight in my timezone.
So I changed default_timezone option in airflow.cfg to "Europe/Moscow" and also changed /etc/localtime in my docker image.
It works nice:
... except one thing.
Python logging module saves asctime without timezone (for example "2021-10-31 18:25:42,550").
And when I open task`s log in web interface, it shifts this time forward by three hours (for my timzone), but it's already in my timzone.
It is a little bit confusing :(
What you expected to happen
I expected to see my timezone in logs :)
I see several solutions for that:
That problem is gone when I change system (in container) /etc/localtime to UTC.
But this is very problematic because of the ability to affect a lot of python tasks.
How to reproduce
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: