Recreating the scheduler tables doesn't work.

I've found a little difference between the logs on the server (where 
scheduler doesn't work) and the logs on localhost (where it does work). 
This line is present only on the server log:

DEBUG:pyDAL:Your database version does not support the JSON data type (using 
TEXT instead)

The server is running PostgreSQL 9.1.15 + psycopg 2.4.5 + web2py 2.10.3
Localhost is running PostgreSQL 9.3.6 + psycopg 2.4.5 + web2py 2.10.4


Here is the complete log on server:

starting single-scheduler for "webmedios"...
DEBUG:pyDAL:Your database version does not support the JSON data type (using 
TEXT instead)
DEBUG:web2py.scheduler.medios#24872:defining tables (migrate=True)
DEBUG:web2py.scheduler.medios#24872:thread building own DAL object
DEBUG:web2py.scheduler.medios#24872:looping...
DEBUG:pyDAL:Your database version does not support the JSON data type (using 
TEXT instead)
DEBUG:web2py.scheduler.medios#24872:defining tables (migrate=False)
INFO:web2py.scheduler.medios#24872:nothing to do
DEBUG:web2py.scheduler.medios#24872:sleeping...
DEBUG:web2py.scheduler.medios#24872:empty runs 1/3
DEBUG:web2py.scheduler.medios#24872:    freeing workers that have not sent 
heartbeat
INFO:web2py.scheduler.medios#24872:TICKER: I'm a ticker
DEBUG:web2py.scheduler.medios#24872:looping...
DEBUG:web2py.scheduler.medios#24872:Assigning tasks...
INFO:web2py.scheduler.medios#24872:TICKER: workers are 1
INFO:web2py.scheduler.medios#24872:TICKER: tasks are 0
DEBUG:web2py.scheduler.medios#24872:Tasks assigned...
DEBUG:web2py.scheduler.medios#24872:sleeping...
DEBUG:web2py.scheduler.medios#24872:empty runs 2/3
DEBUG:web2py.scheduler.medios#24872:........recording heartbeat (ACTIVE)
DEBUG:web2py.scheduler.medios#24872:looping...
INFO:web2py.scheduler.medios#24872:nothing to do
DEBUG:web2py.scheduler.medios#24872:sleeping...
DEBUG:web2py.scheduler.medios#24872:empty runs 3/3
INFO:web2py.scheduler.medios#24872:empty runs limit reached, killing myself
INFO:web2py.scheduler.medios#24872:die!



And here the complete log on localhost:

starting single-scheduler for "webmedios"...
DEBUG:web2py.scheduler.notebook#7049:defining tables (migrate=True)
DEBUG:web2py.scheduler.notebook#7049:thread building own DAL object
DEBUG:web2py.scheduler.notebook#7049:looping...
DEBUG:web2py.scheduler.notebook#7049:defining tables (migrate=False)
DEBUG:web2py.scheduler.notebook#7049:    freeing workers that have not sent 
heartbeat
INFO:web2py.scheduler.notebook#7049:TICKER: I'm a ticker
INFO:web2py.scheduler.notebook#7049:nothing to do
DEBUG:web2py.scheduler.notebook#7049:sleeping...
DEBUG:web2py.scheduler.notebook#7049:empty runs 1/3
DEBUG:web2py.scheduler.notebook#7049:looping...
DEBUG:web2py.scheduler.notebook#7049:Assigning tasks...
DEBUG:web2py.scheduler.notebook#7049:........recording heartbeat (ACTIVE)
INFO:web2py.scheduler.notebook#7049:TICKER: workers are 1
INFO:web2py.scheduler.notebook#7049:TICKER: tasks are 1
DEBUG:web2py.scheduler.notebook#7049:Tasks assigned...
DEBUG:web2py.scheduler.notebook#7049:sleeping...
DEBUG:web2py.scheduler.notebook#7049:empty runs 1/3
DEBUG:web2py.scheduler.notebook#7049:........recording heartbeat (ACTIVE)
DEBUG:web2py.scheduler.notebook#7049:looping...
DEBUG:web2py.scheduler.notebook#7049:   work to do 2
DEBUG:web2py.scheduler.notebook#7049:    new scheduler_run record
INFO:web2py.scheduler.notebook#7049:new task 2 "mytest" demo.mytest
DEBUG:web2py.scheduler.notebook#7049: new task allocated: demo.mytest
DEBUG:web2py.scheduler.notebook#7049:   task starting
DEBUG:web2py.scheduler.notebook#7049:    task started
DEBUG:web2py.scheduler.notebook#7049:    new task report: COMPLETED
DEBUG:web2py.scheduler.notebook#7049:   result: true
DEBUG:web2py.scheduler.notebook#7049:  task completed or failed
DEBUG:web2py.scheduler.notebook#7049: recording task report in db 
(COMPLETED)
INFO:web2py.scheduler.notebook#7049:task completed (COMPLETED)
DEBUG:web2py.scheduler.notebook#7049:looping...
INFO:web2py.scheduler.notebook#7049:nothing to do
DEBUG:web2py.scheduler.notebook#7049:sleeping...
DEBUG:web2py.scheduler.notebook#7049:empty runs 1/3
DEBUG:web2py.scheduler.notebook#7049:looping...
DEBUG:web2py.scheduler.notebook#7049:........recording heartbeat (ACTIVE)
INFO:web2py.scheduler.notebook#7049:nothing to do
DEBUG:web2py.scheduler.notebook#7049:sleeping...
DEBUG:web2py.scheduler.notebook#7049:empty runs 2/3
DEBUG:web2py.scheduler.notebook#7049:looping...
DEBUG:web2py.scheduler.notebook#7049:........recording heartbeat (ACTIVE)
INFO:web2py.scheduler.notebook#7049:nothing to do
DEBUG:web2py.scheduler.notebook#7049:sleeping...
DEBUG:web2py.scheduler.notebook#7049:empty runs 3/3
INFO:web2py.scheduler.notebook#7049:empty runs limit reached, killing myself
INFO:web2py.scheduler.notebook#7049:die!


What do you think? Where should I continue looking for the problem?


El miércoles, 13 de mayo de 2015, 9:20:06 (UTC-3), Lisandro escribió:
>
> Niphlod, I really appreciate your time on this. 
>
> I left the task queued and I went to sleep. The same only task that the 
> previous example (I only changed the period to 300 seconds instead of 30, 
> and left repeats=0 to make it loop). The worker is starting every 2 minutes 
> (from linux cron). 
>
> This morning, when I check the scheduler_run table, I see that the task 
> was successfully executed, but only some times, not every 5 minutes (300 
> seconds), but every some random period, much larger than 5 minutes. This is 
> the start/stop time of the runs in the scheduler_run table:
>  2015-05-13 00:57:08
>  2015-05-13 03:21:07
>  2015-05-13 03:54:08
>  2015-05-13 04:03:07
>  2015-05-13 04:39:08
>  2015-05-13 06:09:07
>  2015-05-13 06:33:08
>  2015-05-13 06:36:07
>  2015-05-13 06:45:08
>  2015-05-13 07:33:08
>  2015-05-13 07:57:07
>  2015-05-13 08:33:07
>
> Notice that the last run was about 20 minutes ago. The task ran 
> succesfully at 8.33, and the scheduler set next_run_time to 8.36.
> Now it's 9.00 and the task haven't executed yet. Though, I checked the 
> scheduler_worker table, and I can see the last heartbeat was at 9.00. 
> Also notice that some runs occur with very little time difference, and 
> others don't.
>
> If I start the worker manually with -D 0 option, I see the same log posted 
> in the previous post.
> It would seem as if the scheduler wasn't seeing the task. But every once 
> in a while, it picks up the task.
>
> I don't have any other task scheduled, nor any other workers starting. 
> Also, I don't have any other cron task scheduled on the server that could 
> be interfering. 
>
> I checked the connection to the database, and it's ok, I'm connecting to 
> the correct db. Actually it's the only db on my server that has the 
> scheduler tables (I've manually logged in to the other dbs to check the 
> scheduler tables weren't being created there).
>
> I would like to try to remove completely the scheduler tables and let 
> web2py re-create them. I don't know, just a try. 
> I'm not shure how to do it. I think I would manually drop the tables from 
> the database, and then manually remove the corresponding files under 
> databases/ folder. Is this the correct approach? I can't think of another 
> test to do here, I'm really in a dead end :/
>
>
>
> El miércoles, 13 de mayo de 2015, 5:31:28 (UTC-3), Niphlod escribió:
>>
>> the scheduler doesn't depend on nginx, uwsgi and such. 
>> it's an external process that communicates with the app with the database 
>> as the only mean of communication. 
>> If you queue something and you verify that is in the scheduler_task 
>> table, and the scheduler doesn't see it, it's because it's pointing to a 
>> different database.
>>
>>

-- 
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