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

The time zone issue on the tasks page #3809

Open
terrellgf opened this issue Aug 1, 2023 · 6 comments
Open

The time zone issue on the tasks page #3809

terrellgf opened this issue Aug 1, 2023 · 6 comments
Labels

Comments

@terrellgf
Copy link

terrellgf commented Aug 1, 2023

The start time and end time in the flexget page is always GMT timezone and not using my system timezone.

root@f8d3be86c1c8:/config# flexget status
There is a FlexGet process already running for this config, sending execution there.
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┓
┃ Task ┃ Last execution ┃ Last success ┃ Entries ┃ Accepted ┃ Rejected ┃ Failed ┃ Duration ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━┩
│ xxx-Free-Movie-23H │ 2023-08-01 12:53 │ 2023-08-01 12:53 │ 50 │ 0 │ 50 │ 0 │ 1s │
│ xxx-Free-Movie-11H │ 2023-08-01 12:53 │ 2023-08-01 12:53 │ 50 │ 0 │ 50 │ 0 │ 0s │
│ xxx-Free-Movie-5H │ 2023-08-01 12:53 │ 2023-08-01 12:53 │ 50 │ 0 │ 50 │ 0 │ 0s │
│ xxx-Movies │ 2023-08-01 12:42 │ 2023-08-01 12:42 │ 50 │ 0 │ 46 │ 0 │ 20s │
│ yyy-Movies │ 2023-08-01 12:42 │ 2023-08-01 12:42 │ 50 │ 0 │ 25 │ 0 │ 10s │
│ zzz-Movies │ 2023-08-01 12:43 │ 2023-08-01 12:43 │ 50 │ 0 │ 31 │ 0 │ 10s │
│ kkk-Movies │ 2023-08-01 12:43 │ - │ - │ - │ - │ - │ - │
│ lll-Movies │ 2023-08-01 12:43 │ 2023-08-01 12:08 │ 206 │ 0 │ 123 │ 0 │ 33s │
│ cleanup │ 2023-08-01 02:05 │ 2023-08-01 02:05 │ 1 │ 0 │ 1 │ 0 │ 0s │
│ cleanup-files │ 2023-08-01 04:04 │ 2023-08-01 04:04 │ 1999 │ 0 │ 1999 │ 0 │ 62s │
│ cleanup-dirs │ 2023-08-01 04:05 │ 2023-08-01 04:05 │ 2202 │ 0 │ 2202 │ 0 │ 10s │
└────────────────────────┴──────────────────┴──────────────────┴─────────┴──────────┴──────────┴────────┴──────────┘
Q20230801130359

@santiagozky
Copy link

santiagozky commented Sep 14, 2023

I have a similar issue. in addition I get this when flexget start:

tzlocal() does not support non-zoneinfo timezones like Europe/Madrid. \nPlease use a timezone in the form of Continent/City'

full error:

  File "/home/flexget/.local/bin/flexget", line 8, in <module>
    sys.exit(main())
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/__init__.py", line 55, in main
    manager.start()
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 366, in start
    self.handle_cli()
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 392, in handle_cli
    self.daemon_command(command_options)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 489, in daemon_command
    run_daemon()
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 470, in run_daemon
    fire_event('manager.daemon.started', self)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/event.py", line 108, in fire_event
    result = event(*args, **kwargs)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/event.py", line 20, in __call__
    return self.func(*args, **kwargs)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/components/scheduler/scheduler.py", line 124, in setup_scheduler
    scheduler = BackgroundScheduler(
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 97, in __init__
    self.configure(gconfig, **options)
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 141, in configure
    self._configure(config)
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/background.py", line 29, in _configure
    super(BackgroundScheduler, self)._configure(config)
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 711, in _configure
    self.timezone = astimezone(config.pop('timezone', None)) or get_localzone()
  File "/home/flexget/.local/lib/python3.10/site-packages/tzlocal/unix.py", line 218, in get_localzone
    _cache_tz = _get_localzone()
  File "/home/flexget/.local/lib/python3.10/site-packages/tzlocal/unix.py", line 175, in _get_localzone
    tzenv = utils._tz_from_env()
  File "/home/flexget/.local/lib/python3.10/site-packages/tzlocal/utils.py", line 109, in _tz_from_env
    raise zoneinfo.ZoneInfoNotFoundError(
zoneinfo._common.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like Europe/Madrid. \nPlease use a timezone in the form of Continent/City'

@gazpachoking
Copy link
Member

I have a similar issue. in addition I get this when flexget start:

tzlocal() does not support non-zoneinfo timezones like Europe/Madrid. \nPlease use a timezone in the form of Continent/City'

full error:

  File "/home/flexget/.local/bin/flexget", line 8, in <module>
    sys.exit(main())
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/__init__.py", line 55, in main
    manager.start()
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 366, in start
    self.handle_cli()
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 392, in handle_cli
    self.daemon_command(command_options)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 489, in daemon_command
    run_daemon()
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/manager.py", line 470, in run_daemon
    fire_event('manager.daemon.started', self)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/event.py", line 108, in fire_event
    result = event(*args, **kwargs)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/event.py", line 20, in __call__
    return self.func(*args, **kwargs)
  File "/home/flexget/.local/lib/python3.10/site-packages/flexget/components/scheduler/scheduler.py", line 124, in setup_scheduler
    scheduler = BackgroundScheduler(
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 97, in __init__
    self.configure(gconfig, **options)
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 141, in configure
    self._configure(config)
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/background.py", line 29, in _configure
    super(BackgroundScheduler, self)._configure(config)
  File "/home/flexget/.local/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 711, in _configure
    self.timezone = astimezone(config.pop('timezone', None)) or get_localzone()
  File "/home/flexget/.local/lib/python3.10/site-packages/tzlocal/unix.py", line 218, in get_localzone
    _cache_tz = _get_localzone()
  File "/home/flexget/.local/lib/python3.10/site-packages/tzlocal/unix.py", line 175, in _get_localzone
    tzenv = utils._tz_from_env()
  File "/home/flexget/.local/lib/python3.10/site-packages/tzlocal/utils.py", line 109, in _tz_from_env
    raise zoneinfo.ZoneInfoNotFoundError(
zoneinfo._common.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like Europe/Madrid. \nPlease use a timezone in the form of Continent/City'

I think your issue is different. Python normally loads zone info files from the system. What OS are you on? Do you have a /user/share/zoneinfo/Europe/Madrid file?

@santiagozky
Copy link

santiagozky commented Sep 15, 2023

hi @gazpachoking ,it's an ubuntu 22.10 container image.
I installed the tzdata package and now the error seems gone. is that supposed to be a dependency? (my python knowledge is near zero)

the container doesnt have a /usr/share/zoneinfo directory. I have no idea why 🤷‍♂️. I do have a /home/flexget/.local/lib/python3.10/site-packages/pytz/zoneinfo/Europe/Madrid, though
(and now /home/flexget/.local/lib/python3.10/site-packages/tzdata/zoneinfo/Europe/Madrid as well)

@shadycuz
Copy link
Contributor

@gazpachoking @santiagozky I was just about to open an issue for this as well. I'm also using a ubuntu 22.00 container. Here is what I did to trigger the issue.

  1. Everything was running fine, Flexget was running as a daemon.
  2. I take my config file and I create a copy of it test.yml with some tweaks.
  3. I test my new config flexget -c test.yml check or w/e the command is. I notice it creates a db file and what not.
  4. Seeing that my new config is good, I backup my old and rename the test.yml to config.yml. My daemon has autoreload so I trust that it will read the new config. I go to bed.
  5. I wake up and I see nothing in my logs (web UI). I have tasks that run every 30mins and they did not run.
  6. I go to the container and I ask the daemon for that status but It says it cant find anything running. but I see the PID still
  7. I check the container logs and I see the TZ error above.
  8. I restart the container and the container fails with the same TZ error.
  9. I remove the TZ environment variable and it works fine again.

@gazpachoking
Copy link
Member

I installed the tzdata package and now the error seems gone. is that supposed to be a dependency? (my python knowledge is near zero)

Indeed, it looks like that may be necessary on certain platforms that don't include their own timezone data. Can someone please open another ticket to track this, as it has nothing to do with the original report.

Copy link

This issue is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants