I can run the scheduler using sqlite database, but I will got the error when I change to using postgres database.
Code (task.py):
def AutoRemoveCacheData():
return 'OK'
from gluon.scheduler import Scheduler
scheduler = Scheduler(db,dict(AutoRemoveCacheData=AutoRemoveCacheData),migrate=True)
Error message:
root@ip-123-45-67-321:/var/www/web2py# python web2py.py -K ScheduleApp
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2015
Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib)
starting single-scheduler for "ScheduleApp"...
ERROR:web2py.scheduler.ip-123-45-67-321#1388:Error retrieving status
ERROR:web2py.scheduler.ip-123-45-67-321#1388:Error retrieving status
ERROR:web2py.scheduler.ip-123-45-67-321#1388:Error retrieving status
Anybody know how to solve this problem?
Thanks!
I'm having the same error.
To get the actual error cause, I tweaked
gluon/scheduler.py
. After removing the guilty try/except of Scheduler.send_heartbeat() I got the following error:NotSupportedError: type oid 114 not mapped to py type
Googling around with this error I found that discussion where Niphlod says: "The problem comes from pg8000 not supporting the json type. Use psycopg2 instead."
So, let's try with this Python module...