Created a new application from admin panel, accessing single mysql db,
inserted one task that sends an email and prints a test message.
Version 2.0.9 (2012-10-04 20:17:03) dev
def test():
db.scheduler_task.insert(
status='QUEUED',
application_name='test2',
task_name='send reminder email',
function_name='send_msg',
enabled=True,
start_time = request.now,
next_run_time = request.now+datetime.timedelta(minutes=2),
stop_time = request.now+datetime.timedelta(days=1),
repeats = 1, # run 1 times
period = 120,
timeout = 60, # should take less than 60 seconds
)
started scheduler: asm21:web2py209 adnan$ python web2py.py -a pass -K test2 -X
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2012
Version 2.0.9 (2012-10-04 20:17:03) dev
Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib)
please visit:
starting scheduler for "test2"...
http://127.0.0.1:8000use "kill -SIGTERM 831" to shutdown the web2py server
Currently running 1 scheduler processes
Processes started
ERROR:Rocket.Errors.Port8000:Socket
127.0.0.1:8000 in use by other process and it won't share.
WARNING:Rocket.Errors.Port8000:Listener started when not ready.
Traceback (most recent call last):
File "/Users/adnan/web2py209/gluon/restricted.py", line 209, in restricted
exec ccode in environment
File "applications/test2/models/db.py", line 15, in <module>
db = DAL('mysql://crm:password@localhost:3307/CRM',migrate_enabled=False, fake_migrate_all=True)
File "/Users/adnan/web2py209/gluon/dal.py", line 6600, in __new__
raise RuntimeError, 'Cannot duplicate a Singleton'
RuntimeError: Cannot duplicate a Singleton
traceback error in the scheduler_run table after task was run (first time):
Traceback (most recent call last):
File "/opt/web-apps/web2py/gluon/scheduler.py", line 203, in executor
_env = env(a=a,c=c,import_models=True)
File "/opt/web-apps/web2py/gluon/shell.py", line 127, in env
environment = build_environment(request, response, session)
File "/opt/web-apps/web2py/gluon/compileapp.py", line 388, in build_environment
t = environment['T'] = translator(request)
File "/opt/web-apps/web2py/gluon/languages.py", line 437, in __init__
self.set_current_languages()
File "/opt/web-apps/web2py/gluon/languages.py", line 492, in set_current_languages
pl_info = self.get_possible_languages_info('default')
File "/opt/web-apps/web2py/gluon/languages.py", line 471, in get_possible_languages_info
info = read_possible_languages(self.folder)
File "/opt/web-apps/web2py/gluon/languages.py", line 250, in read_possible_languages
lambda: read_possible_languages_aux(langdir))
File "/opt/web-apps/web2py/gluon/cfs.py", line 40, in getcfs
return filter() if callable(filter) else ''
File "/opt/web-apps/web2py/gluon/languages.py", line 250, in <lambda>
lambda: read_possible_languages_aux(langdir))
File "/opt/web-apps/web2py/gluon/languages.py", line 215, in read_possible_languages_aux
flist = oslistdir(langdir)
OSError: [Errno 2] No such file or directory: 'applications/test2/languages'
traceback error in the scheduler_run table after task was run (second time):
Traceback (most recent call last):
File "/Users/adnan/web2py209/gluon/scheduler.py", line 203, in executor
_env = env(a=a,c=c,import_models=True)
File "/Users/adnan/web2py209/gluon/shell.py", line 134, in env
sys.exit(1)
SystemExit: 1
Please let me know if there is anything else I can test to help figure out where exactly is the problem? It's a bit urgent for me to figure this out, or I have to roll back production before weekend starts :(