In fact it is not migration problem. But fatal problem after adding scheduler (Postgres+Scheduler)
1. Clean new app created in /admin 2. Changed private/appconfig.ini to Postgres database (empty database I have created in pgAdmin) 3. Web2py + AppAdmin --> OK 4. added models/scheduler.py: import + instantiate Scheduler ; nothing more 5. restart Web2py + AppAdmin --> OK 6. restart Web2py + AppAdmin --> failure <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. Debian 8 Jessie Testing, Postgres 9.4, python-psycopg2/testing,now 2.6.2-1 amd64 (I hope Web2py uses this one) 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.