Re: [web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2017-03-23 Thread António Ramos
Solved. I asked for help from Webfaction and those guys just know a "litle"
about web2y...

Thanks

2017-03-23 8:38 GMT+00:00 Niphlod :

> you didn't let migration happen after dropping both the .table files and
> the underlying tables on the database.
>
>
> On Wednesday, March 22, 2017 at 6:20:12 PM UTC+1, Ramos wrote:
>>
>> I had the same problem this week and did all
>>
>>
>> *Please drop the scheduler_worker table from the database and remove the
>> file *_scheduler_worker.table from the databases/ folder of your
>> application, then set migrate to True (a single request with migrate=True
>> will suffice). The table will be recreated properly and the error will go
>> away.*
>> Now i get the error
>>  relation "scheduler_worker" does not
>> exist
>>
>> any help?
>>
>>
>> Em quarta-feira, 8 de março de 2017 14:05:46 UTC, Ben Lawrence escreveu:
>>>
>>> forget it, I am going back to mysql.
>>>
>>> On Sunday, March 5, 2017 at 4:48:30 AM UTC-8, Ben Lawrence wrote:

 OK,
 I have two machines, one with web2py+nginx (machine A) and the other
 with postgresql (machine B)

 On machine A:
 I check migrate = 0
 I delete all the scheduler tables
 I check that I deleted all the scheduler tables

 On machine B:
 I delete all the scheduler tables in postgres

 On machine A:
 I check that there are no scheduler tables.
 I reboot it

 I check that there are no scheduler tables
 I turn on migrate = 1
 There are now scheduler tables.
 I go to scheduler tables in web2py admin, scheduler_tasks show new
 tasks that have since completed,
 scheduler_run show new tasks that have completed,
 but scheduler_worker has error:

 Traceback (most recent call last):
   File 
 "/home/www-data/web2py/applications/temperature/controllers/appadmin.py:select",
  line 270, in select
   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
 2045, in select
 return adapter.select(self.query, fields, attributes)
   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
 line 746, in select
 return self._select_aux(sql, fields, attributes, colnames)
   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
 line 727, in _select_aux
 return processor(rows, fields, colnames, cacheable=cacheable)
   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
 line 305, in parse
 for row in rows
   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
 line 229, in _parse
 value = self.parse_value(value, fit, ft, blob_decode)
   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
 line 196, in parse_value
 return self.parser.parse(value, field_itype, field_type)
   File 
 "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
 101, in parse
 return self.registered[field_itype](value, field_type)
   File 
 "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
 76, in __call__
 return self.call(value, field_type)
   File 
 "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
 73, in _call
 return self.f(self.parser, value)
   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/base.py", 
 line 129, in _json
 raise RuntimeError('json data not a string')
 RuntimeError: json data not a string


 On Friday, August 26, 2016 at 4:41:38 PM UTC-7, Ben Lawrence wrote:
>
> Thanks, I must have got the sequence wrong.
>
> On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:
>>
>> if you get any error with __tmp is because you didn't drop tables on
>> the backend AND .table files before hitting the app with migrate=True.
>>
>> On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
>>>
>>> Hi Niphlod,
>>> I deleted all the scheduler tables , created a new database and then
>>> rebooted with DAL(..migrate=True..) yet still get this error
>>> column "worker_stats__tmp" is of type json but expression is of type
>>> text'
>>>
>>> using postgresql 9.4 on raspberry pi.
>>> In http://stackoverflow.com/questions/32501027/casting-text-
>>> type-column-to-json-type-in-postgresql
>>> there is a mention of recasting. If this is a solution, would you
>>> know how I can incorporate this into web2py?
>>> thanks,
>>> Ben
>>>
>>>
>>> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:

 Please drop the scheduler_worker table from the database and remove
 the file *_scheduler_worker.table from the databases/ folder of your
 application, then set migrate to True (a single request with 
 migrate=True
 

[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2017-03-23 Thread Niphlod
you didn't let migration happen after dropping both the .table files and 
the underlying tables on the database.

On Wednesday, March 22, 2017 at 6:20:12 PM UTC+1, Ramos wrote:
>
> I had the same problem this week and did all 
>
>
> *Please drop the scheduler_worker table from the database and remove the 
> file *_scheduler_worker.table from the databases/ folder of your 
> application, then set migrate to True (a single request with migrate=True 
> will suffice). The table will be recreated properly and the error will go 
> away.*
> Now i get the error
>  relation "scheduler_worker" does not 
> exist
>
> any help?
>
>
> Em quarta-feira, 8 de março de 2017 14:05:46 UTC, Ben Lawrence escreveu:
>>
>> forget it, I am going back to mysql. 
>>
>> On Sunday, March 5, 2017 at 4:48:30 AM UTC-8, Ben Lawrence wrote:
>>>
>>> OK,
>>> I have two machines, one with web2py+nginx (machine A) and the other 
>>> with postgresql (machine B)
>>>
>>> On machine A:
>>> I check migrate = 0
>>> I delete all the scheduler tables
>>> I check that I deleted all the scheduler tables
>>>
>>> On machine B:
>>> I delete all the scheduler tables in postgres
>>>
>>> On machine A:
>>> I check that there are no scheduler tables.
>>> I reboot it
>>>
>>> I check that there are no scheduler tables
>>> I turn on migrate = 1
>>> There are now scheduler tables.
>>> I go to scheduler tables in web2py admin, scheduler_tasks show new tasks 
>>> that have since completed,
>>> scheduler_run show new tasks that have completed,
>>> but scheduler_worker has error:
>>>
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/www-data/web2py/applications/temperature/controllers/appadmin.py:select",
>>>  line 270, in select
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
>>> 2045, in select
>>> return adapter.select(self.query, fields, attributes)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 746, in select
>>> return self._select_aux(sql, fields, attributes, colnames)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 727, in _select_aux
>>> return processor(rows, fields, colnames, cacheable=cacheable)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 305, in parse
>>> for row in rows
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 229, in _parse
>>> value = self.parse_value(value, fit, ft, blob_decode)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 196, in parse_value
>>> return self.parser.parse(value, field_itype, field_type)
>>>   File 
>>> "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
>>> 101, in parse
>>> return self.registered[field_itype](value, field_type)
>>>   File 
>>> "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
>>> 76, in __call__
>>> return self.call(value, field_type)
>>>   File 
>>> "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
>>> 73, in _call
>>> return self.f(self.parser, value)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/base.py", 
>>> line 129, in _json
>>> raise RuntimeError('json data not a string')
>>> RuntimeError: json data not a string
>>>
>>>
>>> On Friday, August 26, 2016 at 4:41:38 PM UTC-7, Ben Lawrence wrote:

 Thanks, I must have got the sequence wrong.

 On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:
>
> if you get any error with __tmp is because you didn't drop tables on 
> the backend AND .table files before hitting the app with migrate=True.
>
> On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
>>
>> Hi Niphlod,
>> I deleted all the scheduler tables , created a new database and then 
>> rebooted with DAL(..migrate=True..) yet still get this error
>> column "worker_stats__tmp" is of type json but expression is of type 
>> text'
>>
>> using postgresql 9.4 on raspberry pi.
>> In 
>> http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
>> there is a mention of recasting. If this is a solution, would you 
>> know how I can incorporate this into web2py?
>> thanks,
>> Ben
>>
>>
>> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>>>
>>> Please drop the scheduler_worker table from the database and remove 
>>> the file *_scheduler_worker.table from the databases/ folder of your 
>>> application, then set migrate to True (a single request with 
>>> migrate=True 
>>> will suffice). The table will be recreated properly and the error will 
>>> go 
>>> away.
>>>
>>> The error comes from the fact that the adapter chooses "at 
>>> connection time" the "nicest" column type to play with based on the 
>>> backend 

Re: [web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2017-03-22 Thread António Ramos
I want to keep postgres...

2017-03-22 17:22 GMT+00:00 Ben Lawrence :

> Use mysql, less head-ache for the scheduler.
>
> On Mar 22, 2017, at 10:20 AM, Ramos  wrote:
>
> I had the same problem this week and did all
>
>
> *Please drop the scheduler_worker table from the database and remove the
> file *_scheduler_worker.table from the databases/ folder of your
> application, then set migrate to True (a single request with migrate=True
> will suffice). The table will be recreated properly and the error will go
> away.*
> Now i get the error
>  relation "scheduler_worker" does not
> exist
>
> any help?
>
>
> Em quarta-feira, 8 de março de 2017 14:05:46 UTC, Ben Lawrence escreveu:
>>
>> forget it, I am going back to mysql.
>>
>> On Sunday, March 5, 2017 at 4:48:30 AM UTC-8, Ben Lawrence wrote:
>>>
>>> OK,
>>> I have two machines, one with web2py+nginx (machine A) and the other
>>> with postgresql (machine B)
>>>
>>> On machine A:
>>> I check migrate = 0
>>> I delete all the scheduler tables
>>> I check that I deleted all the scheduler tables
>>>
>>> On machine B:
>>> I delete all the scheduler tables in postgres
>>>
>>> On machine A:
>>> I check that there are no scheduler tables.
>>> I reboot it
>>>
>>> I check that there are no scheduler tables
>>> I turn on migrate = 1
>>> There are now scheduler tables.
>>> I go to scheduler tables in web2py admin, scheduler_tasks show new tasks
>>> that have since completed,
>>> scheduler_run show new tasks that have completed,
>>> but scheduler_worker has error:
>>>
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/www-data/web2py/applications/temperature/controllers/appadmin.py:select",
>>>  line 270, in select
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
>>> 2045, in select
>>> return adapter.select(self.query, fields, attributes)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 746, in select
>>> return self._select_aux(sql, fields, attributes, colnames)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 727, in _select_aux
>>> return processor(rows, fields, colnames, cacheable=cacheable)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 305, in parse
>>> for row in rows
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 229, in _parse
>>> value = self.parse_value(value, fit, ft, blob_decode)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>>> line 196, in parse_value
>>> return self.parser.parse(value, field_itype, field_type)
>>>   File 
>>> "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
>>> 101, in parse
>>> return self.registered[field_itype](value, field_type)
>>>   File 
>>> "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
>>> 76, in __call__
>>> return self.call(value, field_type)
>>>   File 
>>> "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", line 
>>> 73, in _call
>>> return self.f(self.parser, value)
>>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/base.py", 
>>> line 129, in _json
>>> raise RuntimeError('json data not a string')
>>> RuntimeError: json data not a string
>>>
>>>
>>> On Friday, August 26, 2016 at 4:41:38 PM UTC-7, Ben Lawrence wrote:

 Thanks, I must have got the sequence wrong.

 On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:
>
> if you get any error with __tmp is because you didn't drop tables on
> the backend AND .table files before hitting the app with migrate=True.
>
> On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
>>
>> Hi Niphlod,
>> I deleted all the scheduler tables , created a new database and then
>> rebooted with DAL(..migrate=True..) yet still get this error
>> column "worker_stats__tmp" is of type json but expression is of type
>> text'
>>
>> using postgresql 9.4 on raspberry pi.
>> In http://stackoverflow.com/questions/32501027/casting-text-
>> type-column-to-json-type-in-postgresql
>> there is a mention of recasting. If this is a solution, would you
>> know how I can incorporate this into web2py?
>> thanks,
>> Ben
>>
>>
>> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>>>
>>> Please drop the scheduler_worker table from the database and remove
>>> the file *_scheduler_worker.table from the databases/ folder of your
>>> application, then set migrate to True (a single request with 
>>> migrate=True
>>> will suffice). The table will be recreated properly and the error will 
>>> go
>>> away.
>>>
>>> The error comes from the fact that the adapter chooses "at
>>> connection time" the "nicest" column type to play with based on the 

Re: [web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2017-03-22 Thread Ben Lawrence
Use mysql, less head-ache for the scheduler.

> On Mar 22, 2017, at 10:20 AM, Ramos  wrote:
> 
> I had the same problem this week and did all 
> 
> Please drop the scheduler_worker table from the database and remove the file 
> *_scheduler_worker.table from the databases/ folder of your application, then 
> set migrate to True (a single request with migrate=True will suffice). The 
> table will be recreated properly and the error will go away.
> 
> Now i get the error
>  relation "scheduler_worker" does not exist
> 
> 
> any help?
> 
> 
> Em quarta-feira, 8 de março de 2017 14:05:46 UTC, Ben Lawrence escreveu:
> forget it, I am going back to mysql. 
> 
> On Sunday, March 5, 2017 at 4:48:30 AM UTC-8, Ben Lawrence wrote:
> OK,
> I have two machines, one with web2py+nginx (machine A) and the other with 
> postgresql (machine B)
> 
> On machine A:
> I check migrate = 0
> I delete all the scheduler tables
> I check that I deleted all the scheduler tables
> 
> On machine B:
> I delete all the scheduler tables in postgres
> 
> On machine A:
> I check that there are no scheduler tables.
> I reboot it
> 
> I check that there are no scheduler tables
> I turn on migrate = 1
> There are now scheduler tables.
> I go to scheduler tables in web2py admin, scheduler_tasks show new tasks that 
> have since completed,
> scheduler_run show new tasks that have completed,
> but scheduler_worker has error:
> Traceback (most recent call last):
>   File 
> "/home/www-data/web2py/applications/temperature/controllers/appadmin.py:select",
>  line 270, in select
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
> 2045, in select
> return adapter.select(self.query, fields, attributes)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 746, in select
> return self._select_aux(sql, fields, attributes, colnames)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 727, in _select_aux
> return processor(rows, fields, colnames, cacheable=cacheable)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 305, in parse
> for row in rows
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 229, in _parse
> value = self.parse_value(value, fit, ft, blob_decode)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 196, in parse_value
> return self.parser.parse(value, field_itype, field_type)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
> line 101, in parse
> return self.registered[field_itype](value, field_type)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
> line 76, in __call__
> return self.call(value, field_type)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
> line 73, in _call
> return self.f(self.parser, value)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/base.py", line 
> 129, in _json
> raise RuntimeError('json data not a string')
> RuntimeError: json data not a string
> 
> On Friday, August 26, 2016 at 4:41:38 PM UTC-7, Ben Lawrence wrote:
> Thanks, I must have got the sequence wrong.
> 
> On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:
> if you get any error with __tmp is because you didn't drop tables on the 
> backend AND .table files before hitting the app with migrate=True.
> 
> On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
> Hi Niphlod,
> I deleted all the scheduler tables , created a new database and then rebooted 
> with DAL(..migrate=True..) yet still get this error
> column "worker_stats__tmp" is of type json but expression is of type text'
> 
> using postgresql 9.4 on raspberry pi.
> In 
> http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
>  
> 
> there is a mention of recasting. If this is a solution, would you know how I 
> can incorporate this into web2py?
> thanks,
> Ben
> 
> 
> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
> Please drop the scheduler_worker table from the database and remove the file 
> *_scheduler_worker.table from the databases/ folder of your application, then 
> set migrate to True (a single request with migrate=True will suffice). The 
> table will be recreated properly and the error will go away.
> 
> The error comes from the fact that the adapter chooses "at connection time" 
> the "nicest" column type to play with based on the backend version. The 
> definition of the scheduler_worker table has a "json" Field, that on 
> postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" column, 
> hence the misbehaviour if you don't drop and re-create the table.
> 
> 
> -- 
> Resources:
> - http://web2py.com 
> - 

[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2017-03-22 Thread Ramos
I had the same problem this week and did all 


*Please drop the scheduler_worker table from the database and remove the 
file *_scheduler_worker.table from the databases/ folder of your 
application, then set migrate to True (a single request with migrate=True 
will suffice). The table will be recreated properly and the error will go 
away.*
Now i get the error
 relation "scheduler_worker" does not 
exist

any help?


Em quarta-feira, 8 de março de 2017 14:05:46 UTC, Ben Lawrence escreveu:
>
> forget it, I am going back to mysql. 
>
> On Sunday, March 5, 2017 at 4:48:30 AM UTC-8, Ben Lawrence wrote:
>>
>> OK,
>> I have two machines, one with web2py+nginx (machine A) and the other with 
>> postgresql (machine B)
>>
>> On machine A:
>> I check migrate = 0
>> I delete all the scheduler tables
>> I check that I deleted all the scheduler tables
>>
>> On machine B:
>> I delete all the scheduler tables in postgres
>>
>> On machine A:
>> I check that there are no scheduler tables.
>> I reboot it
>>
>> I check that there are no scheduler tables
>> I turn on migrate = 1
>> There are now scheduler tables.
>> I go to scheduler tables in web2py admin, scheduler_tasks show new tasks 
>> that have since completed,
>> scheduler_run show new tasks that have completed,
>> but scheduler_worker has error:
>>
>> Traceback (most recent call last):
>>   File 
>> "/home/www-data/web2py/applications/temperature/controllers/appadmin.py:select",
>>  line 270, in select
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
>> 2045, in select
>> return adapter.select(self.query, fields, attributes)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 746, in select
>> return self._select_aux(sql, fields, attributes, colnames)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 727, in _select_aux
>> return processor(rows, fields, colnames, cacheable=cacheable)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 305, in parse
>> for row in rows
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 229, in _parse
>> value = self.parse_value(value, fit, ft, blob_decode)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 196, in parse_value
>> return self.parser.parse(value, field_itype, field_type)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
>> line 101, in parse
>> return self.registered[field_itype](value, field_type)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
>> line 76, in __call__
>> return self.call(value, field_type)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
>> line 73, in _call
>> return self.f(self.parser, value)
>>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/base.py", 
>> line 129, in _json
>> raise RuntimeError('json data not a string')
>> RuntimeError: json data not a string
>>
>>
>> On Friday, August 26, 2016 at 4:41:38 PM UTC-7, Ben Lawrence wrote:
>>>
>>> Thanks, I must have got the sequence wrong.
>>>
>>> On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:

 if you get any error with __tmp is because you didn't drop tables on 
 the backend AND .table files before hitting the app with migrate=True.

 On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
>
> Hi Niphlod,
> I deleted all the scheduler tables , created a new database and then 
> rebooted with DAL(..migrate=True..) yet still get this error
> column "worker_stats__tmp" is of type json but expression is of type 
> text'
>
> using postgresql 9.4 on raspberry pi.
> In 
> http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
> there is a mention of recasting. If this is a solution, would you know 
> how I can incorporate this into web2py?
> thanks,
> Ben
>
>
> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>>
>> Please drop the scheduler_worker table from the database and remove 
>> the file *_scheduler_worker.table from the databases/ folder of your 
>> application, then set migrate to True (a single request with 
>> migrate=True 
>> will suffice). The table will be recreated properly and the error will 
>> go 
>> away.
>>
>> The error comes from the fact that the adapter chooses "at connection 
>> time" the "nicest" column type to play with based on the backend 
>> version. 
>> The definition of the scheduler_worker table has a "json" Field, that on 
>> postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" 
>> column, 
>> hence the misbehaviour if you don't drop and re-create the table.
>>
>>

-- 
Resources:
- http://web2py.com
- 

[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2017-03-08 Thread Ben Lawrence
forget it, I am going back to mysql. 

On Sunday, March 5, 2017 at 4:48:30 AM UTC-8, Ben Lawrence wrote:
>
> OK,
> I have two machines, one with web2py+nginx (machine A) and the other with 
> postgresql (machine B)
>
> On machine A:
> I check migrate = 0
> I delete all the scheduler tables
> I check that I deleted all the scheduler tables
>
> On machine B:
> I delete all the scheduler tables in postgres
>
> On machine A:
> I check that there are no scheduler tables.
> I reboot it
>
> I check that there are no scheduler tables
> I turn on migrate = 1
> There are now scheduler tables.
> I go to scheduler tables in web2py admin, scheduler_tasks show new tasks 
> that have since completed,
> scheduler_run show new tasks that have completed,
> but scheduler_worker has error:
>
> Traceback (most recent call last):
>   File 
> "/home/www-data/web2py/applications/temperature/controllers/appadmin.py:select",
>  line 270, in select
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 
> 2045, in select
> return adapter.select(self.query, fields, attributes)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 746, in select
> return self._select_aux(sql, fields, attributes, colnames)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 727, in _select_aux
> return processor(rows, fields, colnames, cacheable=cacheable)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 305, in parse
> for row in rows
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 229, in _parse
> value = self.parse_value(value, fit, ft, blob_decode)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 196, in parse_value
> return self.parser.parse(value, field_itype, field_type)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
> line 101, in parse
> return self.registered[field_itype](value, field_type)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
> line 76, in __call__
> return self.call(value, field_type)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
> line 73, in _call
> return self.f(self.parser, value)
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/base.py", line 
> 129, in _json
> raise RuntimeError('json data not a string')
> RuntimeError: json data not a string
>
>
> On Friday, August 26, 2016 at 4:41:38 PM UTC-7, Ben Lawrence wrote:
>>
>> Thanks, I must have got the sequence wrong.
>>
>> On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:
>>>
>>> if you get any error with __tmp is because you didn't drop tables on the 
>>> backend AND .table files before hitting the app with migrate=True.
>>>
>>> On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:

 Hi Niphlod,
 I deleted all the scheduler tables , created a new database and then 
 rebooted with DAL(..migrate=True..) yet still get this error
 column "worker_stats__tmp" is of type json but expression is of type 
 text'

 using postgresql 9.4 on raspberry pi.
 In 
 http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
 there is a mention of recasting. If this is a solution, would you know 
 how I can incorporate this into web2py?
 thanks,
 Ben


 On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>
> Please drop the scheduler_worker table from the database and remove 
> the file *_scheduler_worker.table from the databases/ folder of your 
> application, then set migrate to True (a single request with migrate=True 
> will suffice). The table will be recreated properly and the error will go 
> away.
>
> The error comes from the fact that the adapter chooses "at connection 
> time" the "nicest" column type to play with based on the backend version. 
> The definition of the scheduler_worker table has a "json" Field, that on 
> postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" column, 
> hence the misbehaviour if you don't drop and re-create the table.
>
>

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


[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2017-03-05 Thread Ben Lawrence
OK,
I have two machines, one with web2py+nginx (machine A) and the other with 
postgresql (machine B)

On machine A:
I check migrate = 0
I delete all the scheduler tables
I check that I deleted all the scheduler tables

On machine B:
I delete all the scheduler tables in postgres

On machine A:
I check that there are no scheduler tables.
I reboot it

I check that there are no scheduler tables
I turn on migrate = 1
There are now scheduler tables.
I go to scheduler tables in web2py admin, scheduler_tasks show new tasks 
that have since completed,
scheduler_run show new tasks that have completed,
but scheduler_worker has error:

Traceback (most recent call last):
  File 
"/home/www-data/web2py/applications/temperature/controllers/appadmin.py:select",
 line 270, in select
  File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 2045, 
in select
return adapter.select(self.query, fields, attributes)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
746, in select
return self._select_aux(sql, fields, attributes, colnames)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
727, in _select_aux
return processor(rows, fields, colnames, cacheable=cacheable)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
305, in parse
for row in rows
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
229, in _parse
value = self.parse_value(value, fit, ft, blob_decode)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
196, in parse_value
return self.parser.parse(value, field_itype, field_type)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
line 101, in parse
return self.registered[field_itype](value, field_type)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
line 76, in __call__
return self.call(value, field_type)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/__init__.py", 
line 73, in _call
return self.f(self.parser, value)
  File "/home/www-data/web2py/gluon/packages/dal/pydal/parsers/base.py", line 
129, in _json
raise RuntimeError('json data not a string')
RuntimeError: json data not a string


On Friday, August 26, 2016 at 4:41:38 PM UTC-7, Ben Lawrence wrote:
>
> Thanks, I must have got the sequence wrong.
>
> On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:
>>
>> if you get any error with __tmp is because you didn't drop tables on the 
>> backend AND .table files before hitting the app with migrate=True.
>>
>> On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
>>>
>>> Hi Niphlod,
>>> I deleted all the scheduler tables , created a new database and then 
>>> rebooted with DAL(..migrate=True..) yet still get this error
>>> column "worker_stats__tmp" is of type json but expression is of type 
>>> text'
>>>
>>> using postgresql 9.4 on raspberry pi.
>>> In 
>>> http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
>>> there is a mention of recasting. If this is a solution, would you know 
>>> how I can incorporate this into web2py?
>>> thanks,
>>> Ben
>>>
>>>
>>> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:

 Please drop the scheduler_worker table from the database and remove the 
 file *_scheduler_worker.table from the databases/ folder of your 
 application, then set migrate to True (a single request with migrate=True 
 will suffice). The table will be recreated properly and the error will go 
 away.

 The error comes from the fact that the adapter chooses "at connection 
 time" the "nicest" column type to play with based on the backend version. 
 The definition of the scheduler_worker table has a "json" Field, that on 
 postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" column, 
 hence the misbehaviour if you don't drop and re-create the table.



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


[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2016-08-26 Thread Ben Lawrence
Thanks, I must have got the sequence wrong.

On Thursday, August 25, 2016 at 12:05:38 PM UTC-7, Niphlod wrote:
>
> if you get any error with __tmp is because you didn't drop tables on the 
> backend AND .table files before hitting the app with migrate=True.
>
> On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
>>
>> Hi Niphlod,
>> I deleted all the scheduler tables , created a new database and then 
>> rebooted with DAL(..migrate=True..) yet still get this error
>> column "worker_stats__tmp" is of type json but expression is of type text'
>>
>> using postgresql 9.4 on raspberry pi.
>> In 
>> http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
>> there is a mention of recasting. If this is a solution, would you know 
>> how I can incorporate this into web2py?
>> thanks,
>> Ben
>>
>>
>> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>>>
>>> Please drop the scheduler_worker table from the database and remove the 
>>> file *_scheduler_worker.table from the databases/ folder of your 
>>> application, then set migrate to True (a single request with migrate=True 
>>> will suffice). The table will be recreated properly and the error will go 
>>> away.
>>>
>>> The error comes from the fact that the adapter chooses "at connection 
>>> time" the "nicest" column type to play with based on the backend version. 
>>> The definition of the scheduler_worker table has a "json" Field, that on 
>>> postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" column, 
>>> hence the misbehaviour if you don't drop and re-create the table.
>>>
>>>

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


[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2016-08-25 Thread Niphlod
if you get any error with __tmp is because you didn't drop tables on the 
backend AND .table files before hitting the app with migrate=True.

On Thursday, August 25, 2016 at 6:53:07 PM UTC+2, Ben Lawrence wrote:
>
> Hi Niphlod,
> I deleted all the scheduler tables , created a new database and then 
> rebooted with DAL(..migrate=True..) yet still get this error
> column "worker_stats__tmp" is of type json but expression is of type text'
>
> using postgresql 9.4 on raspberry pi.
> In 
> http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
> there is a mention of recasting. If this is a solution, would you know how 
> I can incorporate this into web2py?
> thanks,
> Ben
>
>
> On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>>
>> Please drop the scheduler_worker table from the database and remove the 
>> file *_scheduler_worker.table from the databases/ folder of your 
>> application, then set migrate to True (a single request with migrate=True 
>> will suffice). The table will be recreated properly and the error will go 
>> away.
>>
>> The error comes from the fact that the adapter chooses "at connection 
>> time" the "nicest" column type to play with based on the backend version. 
>> The definition of the scheduler_worker table has a "json" Field, that on 
>> postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" column, 
>> hence the misbehaviour if you don't drop and re-create the table.
>>
>>

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


[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2016-08-25 Thread Ben Lawrence
Hi Niphlod,
I deleted all the scheduler tables , created a new database and then 
rebooted with DAL(..migrate=True..) yet still get this error
column "worker_stats__tmp" is of type json but expression is of type text'

using postgresql 9.4 on raspberry pi.
In 
http://stackoverflow.com/questions/32501027/casting-text-type-column-to-json-type-in-postgresql
there is a mention of recasting. If this is a solution, would you know how 
I can incorporate this into web2py?
thanks,
Ben


On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>
> Please drop the scheduler_worker table from the database and remove the 
> file *_scheduler_worker.table from the databases/ folder of your 
> application, then set migrate to True (a single request with migrate=True 
> will suffice). The table will be recreated properly and the error will go 
> away.
>
> The error comes from the fact that the adapter chooses "at connection 
> time" the "nicest" column type to play with based on the backend version. 
> The definition of the scheduler_worker table has a "json" Field, that on 
> postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" column, 
> hence the misbehaviour if you don't drop and re-create the table.
>
>

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


[web2py] Re: ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text

2016-07-28 Thread Ben Lawrence
HI
I had the same problem and the same error as main post.
After following your instructions the error is solved but another error 
persists.

ERROR:web2py.scheduler.rpiblue#2315:Error retrieving status


With 

Version 2.14.6-stable+timestamp.2016.05.09.19.18.48

Database drivers available: sqlite3, imaplib, pymysql, pg8000

postgresql 9.4

Any ideas would be gratefully received.

On Wednesday, May 27, 2015 at 12:53:40 PM UTC-7, Niphlod wrote:
>
> Please drop the scheduler_worker table from the database and remove the 
> file *_scheduler_worker.table from the databases/ folder of your 
> application, then set migrate to True (a single request with migrate=True 
> will suffice). The table will be recreated properly and the error will go 
> away.
>
> The error comes from the fact that the adapter chooses "at connection 
> time" the "nicest" column type to play with based on the backend version. 
> The definition of the scheduler_worker table has a "json" Field, that on 
> postgresql 9.3 maps to a "json" column, while on 9.1 was a "text" column, 
> hence the misbehaviour if you don't drop and re-create the table.
>
>

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


[web2py] Re: ProgrammingError: column worker_stats__tmp is of type json but expression is of type text

2015-05-28 Thread Jose C



Please drop the scheduler_worker table from the database and remove the 
 file *_scheduler_worker.table from the databases/ folder of your 
 application, then set migrate to True (a single request with migrate=True 
 will suffice). The table will be recreated properly and the error will go 
 away.


Confirmed that doing the above resolves the problem.  Thanks for your 
assistance Niphlod, and for the explanation of why it happened.

Jose
 

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


[web2py] Re: ProgrammingError: column worker_stats__tmp is of type json but expression is of type text

2015-05-27 Thread Niphlod
Please drop the scheduler_worker table from the database and remove the 
file *_scheduler_worker.table from the databases/ folder of your 
application, then set migrate to True (a single request with migrate=True 
will suffice). The table will be recreated properly and the error will go 
away.

The error comes from the fact that the adapter chooses at connection time 
the nicest column type to play with based on the backend version. The 
definition of the scheduler_worker table has a json Field, that on 
postgresql 9.3 maps to a json column, while on 9.1 was a text column, 
hence the misbehaviour if you don't drop and re-create the table.

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