Web2py scheduler

61 views
Skip to first unread message

Simona Chovancová

unread,
Feb 6, 2018, 8:34:24 AM2/6/18
to web2py-users
Hello,

I'm having trouble using the scheduler. I have managed to set it up to queue tasks and successfully complete them. Although, that only works if I do not use database. If I include db in function that is tasked, I get this:

Traceback (most recent call last):
  File "/srv/www/web2py/gluon/shell.py", line 273, in run
    exec(python_code, _env)
  File "<string>", line 1, in <module>
  File "/srv/www/web2py/gluon/scheduler.py", line 735, in loop
    self.wrapped_report_task(task, self.async(task))
  File "/srv/www/web2py/gluon/scheduler.py", line 889, in wrapped_report_task
    db.rollback()
  File "/srv/www/web2py/gluon/packages/dal/pydal/base.py", line 956, in rollback
    self._adapter.rollback()
  File "/srv/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1342, in rollback
    return self.connection.rollback()
  File "/srv/www/web2py/gluon/contrib/pg8000/core.py", line 1429, in rollback
    self.execute(self._cursor, "rollback", None)
  File "/srv/www/web2py/gluon/contrib/pg8000/core.py", line 1626, in execute
    self.handle_messages(cursor)
  File "/srv/www/web2py/gluon/contrib/pg8000/core.py", line 1774, in handle_messages
    raise self.error
ProgrammingError: ('ERROR', '42P05', 'prepared statement "pg8000_statement_13" already exists')

Also, if I do just simple inserts like db.table.insert(something="abc"), I also include db.commit(), I get this error:

Database drivers available: sqlite3, imaplib, pymysql, pg8000
starting single-scheduler for "myapp"...
ERROR:web2py.scheduler.servername#3711:    error storing result


Can someone please point me to the right direction?
Thanks

Simona Chovancová

unread,
Feb 6, 2018, 9:17:51 AM2/6/18
to web2py-users
solved, ran worker in different application than the task was sent from

Massimo Di Pierro

unread,
Feb 10, 2018, 11:50:06 PM2/10/18
to web2py-users
Please install and use psycopg2. There are known issues with pg8000. 
Reply all
Reply to author
Forward
0 new messages