At the start of the function XXX() from the library uLib.py using 
APScheduler ValueError exception occurs.
What to do?

OS - Ubuntu 12.04 64 bits
Web2py version - 2.9.8
APScheduler version = 3.0.0

controller - opros.py
~~~~~~~~~~~~~~~~~~~~~
import uLib as l
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.date import DateTrigger

sched = BackgroundScheduler()
sched.start()

sched.add_job(
    l.XXX, 
    trigger=DateTrigger(), 
    args=[db, session] 
)

user library - uLib.py
~~~~~~~~~~~~~~~~~~~~~~
def XXX(db, ss):
    print db
    print db.tables
    print db(db.bus.id==ss.iBusId).select(db.bus.snaim).first().snaim
#enddef

Log file
~~~~~~~~
2014-09-09 09:19:30,615 - apscheduler.scheduler - INFO - start(132) - 
Scheduler started
2014-09-09 09:19:30,624 - apscheduler.scheduler - INFO - _real_add_job(743) 
- Added job "XXX" to job store "default"
2014-09-09 09:19:30,640 - apscheduler.scheduler - INFO - remove_job(513) - 
Removed job 91d564aae40c4848a8e87d836f6d1eea
2014-09-09 09:19:30,647 - apscheduler.executors.default - INFO - 
run_job(106) - Running job "XXX (trigger: date[2014-09-09 09:19:30 MSK], 
next run at: 2014-09-09 09:19:30 MSK)" (scheduled at 2014-09-09 
09:19:30.614321+04:00)

<DAL uri="sqlite://upoweron.sqlite">

['obj', 'bus', 'krp', 'pdr', 'lgh', 'sht', 'cdz', 'cdp', 'par', 'trf', 
'osht', 'opas', 'opke', 'ojrn', 'ompf', 'oenr', 'opwr', 'opw1', 'opw2', 
'owri', 'orqs', 'orpt', 'oini', 'auth_user', 'auth_group', 
'auth_membership', 'auth_permission', 'auth_event', 'auth_cas']

2014-09-09 09:19:30,701 - apscheduler.executors.default - ERROR - 
_LogErrorReplacement(1426) - Job "XXX (trigger: date[2014-09-09 09:19:30 
MSK], next run at: 2014-09-09 09:19:30 MSK)" raised an exception
Traceback (most recent call last):
  File 
"/usr/local/lib/python2.7/dist-packages/apscheduler/executors/base.py", 
line 108, in run_job
    retval = job.func(*job.args, **job.kwargs)
  File "applications/upoweron/modules/uLib.py", line 11858, in XXX
    sNaim = db(db.bus.id==ss.iBusId).select(db.bus.snaim).first().snaim
  File "/home/aab/MyPython/web2py/gluon/dal.py", line 10724, in select
    return adapter.select(self.query, fields, attributes)
  File "/home/aab/MyPython/web2py/gluon/dal.py", line 2464, in select
    return super(SQLiteAdapter, self).select(query, fields, attributes)
  File "/home/aab/MyPython/web2py/gluon/dal.py", line 1874, in select
    return self._select_aux(sql, fields, attributes)
  File "/home/aab/MyPython/web2py/gluon/dal.py", line 1839, in _select_aux
    self.execute(sql)
  File "/home/aab/MyPython/web2py/gluon/dal.py", line 1960, in execute
    return self.log_execute(*a, **b)
  File "/home/aab/MyPython/web2py/gluon/dal.py", line 1945, in log_execute
    if not self.connection: raise ValueError(a[0])
ValueError: SELECT  bus.snaim FROM bus WHERE (bus.id = 7);

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to