More information.... just tried initializing the DAL with pg8000 and things 
appear to be working. This points to an issue with psycopg2 (or at least 
the version that PythonAnywhere has installed)


On Wednesday, June 8, 2016 at 3:50:42 PM UTC-4, Andre wrote:
>
> Okay, fair enough.
>
> Along with the errors I posted earlier (related to Postgres), I also 
> noticed that when I try to access the scheduler_worker table I get the 
> following error:
>
>  Traceback (most recent call last):
>   File "/home/wdis/web2py/applications/wdis/controllers/appadmin.py", line 
> 252, in select
>     limitby=(start, stop))
>   File "/home/wdis/web2py/gluon/packages/dal/pydal/objects.py", line 2020, in 
> select
>     return adapter.select(self.query, fields, attributes)
>   File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 1296, in select
>     return self._select_aux(sql,fields,attributes)
>   File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 1277, in _select_aux
>     return processor(rows,fields,self._colnames,cacheable=cacheable)
>   File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 1767, in parse
>     for row in rows]
>   File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 1677, in _parse
>     value = self.parse_value(value, ft, blob_decode)
>   File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 1527, in parse_value
>     return self.parsemap[key](value,field_type)
>   File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 1633, in parse_json
>     raise RuntimeError('json data not a string')
> RuntimeError: json data not a string
>
>
> I'm not sure if the errors are related but perhaps it can offer a clue to 
> what's going on. Any thoughts?
>
> -Andre
>
>
> On Wednesday, June 8, 2016 at 3:29:16 PM UTC-4, Niphlod wrote:
>>
>> sqlite is the worst choice for concurrency, which scheduler is quite all 
>> about. I'd investigate further on the path of pythonanywhere's postgresql 
>> not being viable, mostly because it seems that psycopg2 is a "battery 
>> included" library.
>>
>> On Wednesday, June 8, 2016 at 3:55:30 PM UTC+2, Andre wrote:
>>>
>>> I was not able to get the scheduler to work with Postgres so I tried 
>>> using SQLite and it seems to work!  
>>>
>>> So moving forward I'll try using two databases: SQLite for the scheduler 
>>> and MySQL for everything else.
>>>
>>> As a side note, I'm not quite sure why Postgres did not work. I tried 
>>> clearing out the tables and then have the scheduler recreate everything but 
>>> I was still getting the same error. Poking around the forums, it seems a 
>>> possible solution is updating the postgres drivers however my hands are a 
>>> bit tied since I'm using PythonAnywhere.
>>>
>>> -Andre
>>>
>>>
>>>
>>>
>>> On Tuesday, June 7, 2016 at 4:17:59 PM UTC-4, Niphlod wrote:
>>>>
>>>> NP. perfectly kosher. For all matter and purposes, unless you need 
>>>> "transactional consistency" a separate db makes perfect sense.
>>>> Those messages though indicate that the scheduler isn't finding the 
>>>> tables, or the tables have an incorrect structure.
>>>>
>>>> On Tuesday, June 7, 2016 at 7:08:41 PM UTC+2, Andre Kozaczka wrote:
>>>>>
>>>>> Ah bummer! Thank you for looking into this for me.
>>>>>
>>>>> Through PythonAnywhere, I've added a Postgres database. I'm not sure 
>>>>> if I will migrate everything from MySQL to Postgres but I was thinking of 
>>>>> just starting off with the scheduler. I created a second DAL for the 
>>>>> Postgres and initialized the scheduler with it. All the tables are 
>>>>> generated however I'm getting error messages on the console and the task 
>>>>> sits in QUEUED status.
>>>>>
>>>>> I know I'm veering off from the original question, but is it kosher to 
>>>>> have a second database just for the scheduler? 
>>>>>
>>>>> Here are the error messages:
>>>>> 2016-06-07 14:54:57,026 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - Error retrieving status
>>>>> 2016-06-07 14:54:57,335 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (0)
>>>>> 2016-06-07 14:54:57,843 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (1)
>>>>> 2016-06-07 14:54:58,353 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (2)
>>>>> 2016-06-07 14:54:58,862 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (3)
>>>>> 2016-06-07 14:54:59,370 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (4)
>>>>> 2016-06-07 14:54:59,878 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (5)
>>>>> 016-06-07 14:55:00,048 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - Error retrieving status
>>>>> 2016-06-07 14:55:00,398 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (6)
>>>>> 2016-06-07 14:55:00,908 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (7)
>>>>> 2016-06-07 14:55:01,417 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (8)
>>>>> 2016-06-07 14:55:01,972 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - TICKER: error assigning tasks (9)
>>>>> 2016-06-07 14:55:03,066 - web2py.scheduler.giles-liveconsole2#12039 - 
>>>>> ERROR - Error retrieving status
>>>>>
>>>>> On Tuesday, June 7, 2016 at 8:07:32 AM UTC-4, Niphlod wrote:
>>>>>>
>>>>>> uhm, then it'll be quite impossible to fix it given the timeout is 
>>>>>> seemingly random.
>>>>>>
>>>>>> On Tuesday, June 7, 2016 at 1:19:07 PM UTC+2, Andre Kozaczka wrote:
>>>>>>>
>>>>>>> Yes, same lines.
>>>>>>>
>>>>>>> On Tuesday, June 7, 2016 at 5:54:37 AM UTC-4, Niphlod wrote:
>>>>>>>>
>>>>>>>> is the exception raised in the same lines ?
>>>>>>>>
>>>>>>>> On Tuesday, June 7, 2016 at 4:32:45 AM UTC+2, Andre Kozaczka wrote:
>>>>>>>>>
>>>>>>>>>  
>>>>>>>>> Well..... adding "sync_output=200" ended up working for tasks that 
>>>>>>>>> were just over the 300 second mark (where previously I was failing). 
>>>>>>>>> I 
>>>>>>>>> changed the task length to 600 seconds and I'm back to failing. Ah... 
>>>>>>>>> so 
>>>>>>>>> close!!!
>>>>>>>>>
>>>>>>>>> I tried changing sync_output to 100 but still failed. Unless you 
>>>>>>>>> have another trick up your sleeve, I may have to wave the white flag 
>>>>>>>>> and 
>>>>>>>>> ditch MySQL.... and maybe give Postgres a try?
>>>>>>>>>
>>>>>>>>> -Andre
>>>>>>>>>
>>>>>>>>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to