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

Timezone offset does not match system offset - check your config files #17

Open
xeruf opened this issue Sep 7, 2020 · 4 comments
Open

Comments

@xeruf
Copy link
Contributor

xeruf commented Sep 7, 2020

Traceback (most recent call last):
  File "/home/janek/.local/share/task/hooks/on-add-pirate", line 9, in <module>
    from tasklib import TaskWarrior, Task
  File "/usr/local/lib/python3.8/dist-packages/tasklib/__init__.py", line 1, in <module>
    from .backends import TaskWarrior
  File "/usr/local/lib/python3.8/dist-packages/tasklib/backends.py", line 11, in <module>
    from .task import Task, TaskQuerySet, ReadOnlyDictView
  File "/usr/local/lib/python3.8/dist-packages/tasklib/task.py", line 9, in <module>
    from .serializing import SerializingObject
  File "/usr/local/lib/python3.8/dist-packages/tasklib/serializing.py", line 11, in <module>
    local_zone = tzlocal.get_localzone()
  File "/usr/local/lib/python3.8/dist-packages/tzlocal/unix.py", line 165, in get_localzone
    _cache_tz = _get_localzone()
  File "/usr/local/lib/python3.8/dist-packages/tzlocal/unix.py", line 90, in _get_localzone
    utils.assert_tz_offset(tz)
  File "/usr/local/lib/python3.8/dist-packages/tzlocal/utils.py", line 38, in assert_tz_offset
    raise ValueError(msg)
ValueError: Timezone offset does not match system offset: 7200 != 0. Please, check your config files.
Hook Error: Expected feedback from a failing hook script.

I am a developer, but I rarely use python, so idk what I'm supposed to do with this. The hook shouldn't care about my system time at all?
I live in Germany (CEST) btw.

@xeruf
Copy link
Contributor Author

xeruf commented Sep 7, 2020

Oh wait, looks like this isn't even your hooks fault...

@xeruf
Copy link
Contributor Author

xeruf commented Sep 7, 2020

Moved to GothenburgBitFactory/tasklib#84

@xeruf xeruf closed this as completed Sep 7, 2020
@xeruf
Copy link
Contributor Author

xeruf commented Sep 8, 2020

Nevermind, the issue is in this project:

env = os.environ.copy()
env['TZ'] = 'UTC0'

WHYYYYYYYYY?

This caused me over an hour of debugging just now :/

@Alys
Copy link

Alys commented Jan 21, 2021

I had the same issue with on-add-pirate after installing task-relative-recur, and found that commenting out that env['TZ'] line did fix it.

I haven't noticed any incorrect behaviour from task-relative-recur since then although I'm not certain what impacts using something other than UTC0 would have. If UTC0 is useful or necessary in some circumstances, maybe it's worth mentioning in the README that you could comment out or adjust the timezone if needed?

I know that for my own use of this hook, I wouldn't care if the new tasks weren't due on exactly the right days due to a time zone issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants