Thank you, Niphlod. Can you help me with the Web2py upgrade ? Because I think there are some fatal problems in Web2py code. Basically appadmin will start well, but fails after Web2py restart with corrupted scheduler.
I want move from 2.14.6 to trunk. (because 2.14.6 has strange gluon/main.py ln.451 "except HTTP, http_response", which makes problems to me and it is fixed in trunk) My steps are: 1. git clone --recursive g...@github.com:web2py/web2py.git 2. I make copy of my app called codex2020 from backuped 2.14.6 into applications/ 3. python /home/mirek/mz/web2py/web2py.py -a "xxx" 4. http://localhost:8000/codex2020/appadmin # this works 5. http://localhost:8000/codex2020/appadmin # this works 6. kill web2py 7. python /home/mirek/mz/web2py/web2py.py -a "xxx" 8. http://localhost:8000/codex2020/appadmin Now appadmin fails with: <class 'psycopg2.ProgrammingError'> column "worker_stats__tmp" is of type json but expression is of type text LINE 1: UPDATE "scheduler_worker" SET "worker_stats__tmp"="worker_st... ^ HINT: You will need to rewrite or cast the expression. Traceback (most recent call last): File "/home/mirek/mz/web2py/gluon/restricted.py", line 216, in restricted exec(ccode, environment) File "/home/mirek/mz/web2py/applications/codex2020/models/scheduler.py", line 76, in <module> scheduler = Scheduler(db) File "/home/mirek/mz/web2py/gluon/scheduler.py", line 771, in __init__ self.define_tables(db, migrate=migrate) File "/home/mirek/mz/web2py/gluon/scheduler.py", line 866, in define_tables migrate=self.__get_migrate('scheduler_worker', migrate) File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/base.py", line 587, in define_table table = self.lazy_define_table(tablename, *fields, **args) File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/base.py", line 621, in lazy_define_table polymodel=polymodel) File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", line 778, in create_table return self.migrator.create_table(*args, **kwargs) File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/migrator.py", line 297, in create_table fake_migrate=fake_migrate File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/migrator.py", line 417, in migrate_table self.adapter.execute(sub_query) File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 67, in wrap return f(*args, **kwargs) File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", line 416, in execute rv = self.cursor.execute(command, *args[1:], **kwargs) ProgrammingError: column "worker_stats__tmp" is of type json but expression is of type text LINE 1: UPDATE "scheduler_worker" SET "worker_stats__tmp"="worker_st... ---------------------------------------------- Note: This has nothing to do with scheduler from 2.14.6. If I fix it now, removing 4 Scheduler tables in pgAdmin and 4 Scheduler metadata in databases/ then I receive same: first start good, next start corrupted. ---------------------------------------------- If I instead of (8.) do 8. http://localhost:8000/codex2020 then I receive another error, which is maybe consecutive to the corrupted scheduler, but maybe it is next standalone error: class MARKMIN(XmlComponent), In 'text' is LazyT, which (I think) is not handled in _compat.py:to_bytes Traceback (most recent call last): File "/home/mirek/mz/web2py/gluon/restricted.py", line 216, in restricted exec(ccode, environment) File "<string>", line 113, in <module> File "/home/mirek/mz/web2py/gluon/html.py", line 2802, in __init__ self.text = to_bytes(text) File "/home/mirek/mz/web2py/gluon/_compat.py", line 67, in to_bytes raise TypeError('Expected bytes') TypeError: Expected bytes On Monday, 7 November 2016 18:28:22 UTC+1, Mirek Zvolský wrote: > > I use Debian (testing), Postgres 9.4, > and Web2py 2.14.6 (with current trunk is problem the same) > > I use such command (assigned to an alias) for long time to start my > application > python web2py.py -K codex2020 -X $@ > > Today I received strange behaviour, errors like > web2py.scheduler TICKER: error assigning tasks > or such something (with no effect if I have deleted scheduler_* tables and > their databases/ metadata earlier) > starting scheduler for "codex2020"... > Currently running 1 scheduler processes > Traceback (most recent call last): > File "/home/mirek/mz/web2py/gluon/restricted.py", line 227, in restricted > exec ccode in environment > File "applications/codex2020/models/scheduler.py", line 80, in <module> > scheduler = Scheduler(db) > File "/home/mirek/mz/web2py/gluon/scheduler.py", line 567, in __init__ > self.define_tables(db, migrate=migrate) > File "/home/mirek/mz/web2py/gluon/scheduler.py", line 659, in > define_tables > migrate=self.__get_migrate('scheduler_worker', migrate) > File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/base.py", line 834, > in define_table > table = self.lazy_define_table(tablename,*fields,**args) > File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/base.py", line 873, > in lazy_define_table > polymodel=polymodel) > File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", > line 510, in create_table > fake_migrate=fake_migrate > File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", > line 623, in migrate_table > self.execute(sub_query) > File > "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line > 362, in execute > return BaseAdapter.execute(self, *a, **b) > File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", > line 1388, in execute > return self.log_execute(*a, **b) > File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", > line 1382, in log_execute > ret = self.get_cursor().execute(command, *a[1:], **b) > ProgrammingError: column "worker_stats__tmp" is of type json but > expression is of type text > LINE 1: UPDATE scheduler_worker SET worker_stats__tmp=worker_stats; > ^ > HINT: You will need to rewrite or cast the expression. > > Then I decided then if I run without $@, all will start well: > python web2py.py -K codex2020 -X > > After testing of everything I went back to: > python web2py.py -K codex2020 -X $@ > or > python web2py.py -K codex2020 -X "$@" > > and I have now no more the previous problem. All works well. > > Has somebody any idea about the reason of problems > and can you explain me the difference between $@ and "$@". Which one is > more safe to use? Is there a difference? > > Thanks... > -- 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.