Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Bug with freeNas (freeBSD) and apscheduler #33

Closed
0xE0-rng opened this issue Jul 4, 2016 · 4 comments
Closed

Bug with freeNas (freeBSD) and apscheduler #33

0xE0-rng opened this issue Jul 4, 2016 · 4 comments

Comments

@0xE0-rng
Copy link

0xE0-rng commented Jul 4, 2016

When running Premiumizer on freeNas 9.10 it crashes with the following stack trace:

Traceback (most recent call last):                                                                                                  
  File "./Premiumizer.py", line 1411, in <module>                                                                                   
    seconds=active_interval, replace_existing=True, max_instances=1, coalesce=True)                                                 
  File "/virtualenv/lib/python2.7/site-packages/apscheduler/schedulers/base.py", line 366, in add_job                               
    'trigger': self._create_trigger(trigger, trigger_args),                                                                         
  File "/virtualenv/lib/python2.7/site-packages/apscheduler/schedulers/base.py", line 848, in _create_trigger                       
    return self._create_plugin_instance('trigger', trigger, trigger_args)                                                           
  File "/virtualenv/lib/python2.7/site-packages/apscheduler/schedulers/base.py", line 833, in _create_plugin_instance               
    return plugin_cls(**constructor_kwargs)                                                                                         
  File "/virtualenv/lib/python2.7/site-packages/apscheduler/triggers/interval.py", line 37, in __init__                             
    self.timezone = astimezone(timezone)                                                                                            
  File "/virtualenv/lib/python2.7/site-packages/apscheduler/util.py", line 77, in astimezone                                        
    'Unable to determine the name of the local timezone -- you must explicitly '                                                    
ValueError: Unable to determine the name of the local timezone -- you must explicitly specify the name of the local timezone. Please
 refrain from using timezones like EST to prevent problems with daylight saving time. Instead, use a locale based timezone name (suc
h as Europe/Helsinki).`

This looks like an apscheduler bug but i am not sure.

Update:
Ok i found the reason, its a problem with tzlocal. Its unable to read the correct time zone on freeBSD systems.
There is a pull request here but it has not been accepted yet.

@0xE0-rng
Copy link
Author

0xE0-rng commented Jul 4, 2016

I tested the pull request mentiond above and everything works great on freeBSD now

@0xE0-rng 0xE0-rng closed this as completed Jul 4, 2016
@matrixpolic
Copy link

i also met this problem;
solve:
sched = BlockingScheduler(timezone="UTC")

@Darktex
Copy link

Darktex commented Jun 30, 2018

You can also set up the timezone without changing the code.

I did two things, not sure which one worked but both are quick.

  1. Set up your timezone as a system var:
    export TZ=America/Los_Angeles
  2. Change the zonefile as described here: https://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/

@0xE0-rng
Copy link
Author

0xE0-rng commented Jun 9, 2020

For freebsd its not export, but rater setenv.
This error can be fixed by running e.g. setenv TZ Europe/Berlin

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

No branches or pull requests

3 participants