You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/25 10:20:50 UTC

[GitHub] [airflow] EKami opened a new issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

EKami opened a new issue #13311:
URL: https://github.com/apache/airflow/issues/13311


   **Apache Airflow version**:  2.0.0
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: On-premise
   - **OS** (e.g. from /etc/os-release):  Manjaro Linux
   - **Kernel** (e.g. `uname -a`): 5.9.11-3-MANJARO
   - **Install tools**: pip
   - **Others**:
   
   **What happened**:
   
   The web server crash on some actions after running a DAG with the following error:
   ```
   Traceback (most recent call last):
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
       response = self.full_dispatch_request()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception
       reraise(exc_type, exc_value, tb)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
       raise value
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
       rv = self.dispatch_request()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request
       return self.view_functions[rule.endpoint](**req.view_args)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/auth.py", line 34, in decorated
       return func(*args, **kwargs)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/decorators.py", line 60, in wrapper
       return f(*args, **kwargs)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/utils/session.py", line 65, in wrapper
       return func(*args, session=session, **kwargs)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/views.py", line 1108, in log
       return self.render_template(
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/views.py", line 396, in render_template
       return super().render_template(
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask_appbuilder/baseviews.py", line 280, in render_template
       return render_template(
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/templating.py", line 137, in render_template
       return _render(
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask/templating.py", line 120, in _render
       rv = template.render(context)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/jinja2/asyncsupport.py", line 76, in render
       return original_render(self, *args, **kwargs)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/jinja2/environment.py", line 1008, in render
       return self.environment.handle_exception(exc_info, True)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/jinja2/environment.py", line 780, in handle_exception
       reraise(exc_type, exc_value, tb)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/jinja2/_compat.py", line 37, in reraise
       raise value.with_traceback(tb)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/templates/airflow/ti_log.html", line 20, in <module>
       {% extends "airflow/task_instance.html" %}
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/jinja2/environment.py", line 1005, in render
       return concat(self.root_render_func(self.new_context(vars)))
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/templates/airflow/ti_log.html", line 16, in root
       specific language governing permissions and limitations
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/templates/airflow/task_instance.html", line 23, in root
       {% block content %}
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/templates/airflow/dag.html", line 24, in root
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/templates/airflow/main.html", line 16, in root
       specific language governing permissions and limitations
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 17, in root
       {% include 'appbuilder/flash.html' %}
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 32, in root
       <link href="{{url_for('appbuilder.static',filename='select2/select2.css')}}" rel="stylesheet">
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 35, in block_body
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/www/templates/airflow/main.html", line 74, in block_messages
       {% endif %}
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/jinja2/runtime.py", line 262, in call
       return __obj(*args, **kwargs)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/airflow/macros/__init__.py", line 83, in datetime_diff_for_humans
       return pendulum.instance(dt).diff_for_humans(since)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/datetime.py", line 824, in diff_for_humans
       other = self.now()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/datetime.py", line 106, in now
       return pendulum.now(tz)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/__init__.py", line 211, in now
       dt = _datetime.datetime.now(local_timezone())
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/__init__.py", line 60, in local_timezone
       return get_local_timezone()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 35, in get_local_timezone
       tz = _get_system_timezone()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 63, in _get_system_timezone
       return _get_unix_timezone()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 178, in _get_unix_timezone
       return Timezone(etctz.replace(" ", "_"))
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/timezone.py", line 40, in __init__
       tz = read(name, extend=extended)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/zoneinfo/__init__.py", line 9, in read
       return Reader(extend=extend).read_for(name)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/zoneinfo/reader.py", line 52, in read_for
       raise InvalidTimezone(timezone)
   pendulum.tz.zoneinfo.exceptions.InvalidTimezone: Invalid timezone "Europe/Athens
   pur"
   ```
   
   Notice the `\npur`.
   
   **What you expected to happen**:
   
   No crash
   
   **How to reproduce it**:
   I've been using the DAGs from [this tutorial](https://www.tensorflow.org/tfx/tutorials/tfx/airflow_workshop) . To make the matter simpler I've uploaded the dags [here on Github Gist](https://gist.github.com/EKami/e74a39ef7b566a0470d3d81a1d100ed2)
   
   
   **Anything else we need to know**:
   
   This problem occurs after a short period of time when running the DAGs shared in this issue. The webserver needs to be restarted from scratch to fix it.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] EKami commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
EKami commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-752063881


   @kaxil I'm able to reproduce 100% of the time by running the web UI and then killing the scheduler while the webserver is still running. Clicking on a button on the web UI will trigger the error.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754613440


   This is not an airflow bug -- it is entirely in pendulum code. And I don't see anything in that file that would have `pur` appended to the file.
   
   This is environmental, feel free to raise an issue with pendulum if you think it should be handled better there.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-751241537


   ```
   pendulum.tz.zoneinfo.exceptions.InvalidTimezone: Invalid timezone "Europe/Athens
   pur"
   ```
   
   That looks weird, have you set any timezone either in DAG or airflow.cfg or Webserver?
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] raghavgar commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
raghavgar commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-811963870


   @EKami were you able to resolve this issue? We have same issue with Airflow 


-- 
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:
users@infra.apache.org



[GitHub] [airflow] EKami commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
EKami commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754580977


   With:
   ```
   $ pip freeze | grep pendulum
   pendulum==2.1.2
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] EKami commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
EKami commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754566852


   ```
   $ timedatectl
      Local time: mar. 2021-01-05 13:02:15 EET
   Universal time: mar. 2021-01-05 11:02:15 UTC
        RTC time: mar. 2021-01-05 11:02:15    
       Time zone: Europe/Athens (EET, +0200)  
   System clock synchronized: yes                         
     NTP service: active                      
   RTC in local TZ: no 
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-751227596


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


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-752271000


   > @kaxil I'm able to reproduce 100% of the time by running the web UI and then killing the scheduler while the webserver is still running. Clicking on a button on the web UI will trigger the error.
   
   Interesting, I will test it out as soon as I am back from holidays. 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] kaxil edited a comment on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-752271000


   > @kaxil I'm able to reproduce 100% of the time by running the web UI and then killing the scheduler while the webserver is still running. Clicking on a button on the web UI will trigger the error.
   
   Interesting, I will test it out as soon as I am back from holidays. This will need more investigation -- gut says this might be environment-related but will still test it out


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb closed issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
ashb closed issue #13311:
URL: https://github.com/apache/airflow/issues/13311


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754574967


   Specifically the TZ environment variable?
   
   What does `python -c 'import pendulum; print(repr(pendulum.now()))'` do?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] EKami commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
EKami commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754620696


   Okay, thanks a lot for your help :)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] EKami commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
EKami commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754580300


   ```
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "<string>", line 1, in <module>
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/__init__.py", line 211, in now
       dt = _datetime.datetime.now(local_timezone())
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/__init__.py", line 60, in local_timezone
       return get_local_timezone()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 35, in get_local_timezone
       tz = _get_system_timezone()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 63, in _get_system_timezone
       return _get_unix_timezone()
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/local_timezone.py", line 178, in _get_unix_timezone
       return Timezone(etctz.replace(" ", "_"))
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/timezone.py", line 40, in __init__
       tz = read(name, extend=extended)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/zoneinfo/__init__.py", line 9, in read
       return Reader(extend=extend).read_for(name)
     File "/home/user/Programs/anaconda3/envs/tfx/lib/python3.8/site-packages/pendulum/tz/zoneinfo/reader.py", line 52, in read_for
       raise InvalidTimezone(timezone)
   pendulum.tz.zoneinfo.exceptions.InvalidTimezone: Invalid timezone "Europe/Athens
   pur"
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] EKami commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
EKami commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754612262


   ```
   $ cat /etc/timezone
   Europe/Athens
   pur
   ```
   
   Interesting... Probably the program [tzupdate](https://github.com/cdown/tzupdate) that created this. But in all cases, I don't think airflow should crash if it encounters an error like that.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] EKami commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
EKami commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-751242292


   > That looks weird, have you set any timezone either in DAG or airflow.cfg or Webserver?
   
   Nope, I just installed airflow and I ran the scripts from the tutorial above with not changes to the config files at all


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754607737


   What's in your `/etc/timezone` file?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #13311: pendulum.tz.zoneinfo.exceptions.InvalidTimezone

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #13311:
URL: https://github.com/apache/airflow/issues/13311#issuecomment-754551989


   @EKami This feels like a mis-configuration in your environment.
   
   What does `echo TZ` show?


----------------------------------------------------------------
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:
users@infra.apache.org