fake_migration issues

84 views
Skip to first unread message

Dave S

unread,
Jan 25, 2021, 9:36:23 PM1/25/21
to web2py-users
Porting another (personal) application from my old 2.14.6 environment to 2.21.1., and copied both the table files and storage.sqlite from the old application.  Index page works, but another page which displays a sorted list doesn't.

Traceback (most recent call last):
File "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
File "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\applications\QuarterMaster\views\default/sortedQ.html", line 77, in <module>
File "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\sqlhtml.py", line 3544, in __init__
"Column %s not found (SQLTABLE)" % colname)
KeyError: 'Column QuarterMaster.IssueYr not found (SQLTABLE)' 
 

A cmd window running sqlite.exe verifies the schema of the table is correct in the db (as expected), and entries made from the index page are showing up.

I delete the table files, set fake_migrate_all = True, and ... lather, rinse .. index works, the table list doesn't, same exception.  And the table files don't get created.
Add migrate=True to the table definition ... lather, rinse. prior videre.
Change "fake_migrate_all=True to migrate=False,fake_migrate=True ... lather, rinse, p.v.

Is this a 2.21.1 issue, or have I rejoined those who bungle migrations?

/dps



Dave S

unread,
Jan 28, 2021, 5:11:05 PM1/28/21
to web2py-users
No suggestions?

/dps
 

Dave S

unread,
Jan 30, 2021, 2:11:04 AM1/30/21
to web2py-users
On Monday, January 25, 2021 at 6:36:23 PM UTC-8 Dave S wrote:
Porting another (personal) application from my old 2.14.6 environment to 2.21.1., and copied both the table files and storage.sqlite from the old application.  Index page works, but another page which displays a sorted list doesn't.
[...]
Is this a 2.21.1 issue, or have I rejoined those who bungle migrations?

Clearly the latter, but the help from Jim and Clemens here:
looked apropros.
But even with all 3 values true, I still don't seem to have table files, and I still get the error if there is data found by my query, but no error if rows is empty.

/dps 
 

valq...@gmail.com

unread,
Jan 30, 2021, 2:39:58 PM1/30/21
to web2py-users

Did you update pydal?
суббота, 30 января 2021 г. в 10:11:04 UTC+3, snide...@gmail.com:

Dave S

unread,
Jan 30, 2021, 4:40:21 PM1/30/21
to web2py-users

On Saturday, January 30, 2021 at 11:39:58 AM UTC-8 valq...@gmail.com wrote:

Did you update pydal?

PyDAL is "Version 18.0
Released on December 27th 2019" 

and installed from the Windows zip file distribution of web2py, Version 2.21.1-stable+timestamp.2020.11.28.04.10.44.

In addtion, I have other apps ported where there are no pydal issues (I don't remember if I migration was needed).  On checking those, I don't see table files there, either, so "no pydal issues" should be read as "no pydal issues causing tickets".
[One of them does have the "no module named path found" issue for imports in a module]

I find it strange that anything works with no table files, and one of the working apps has several define_table() calls, and the 2.14.6 version has about 15 table files when you include the scheduler.  (Haven't tried the scheduler under 2.21.1)

/dps

valq...@gmail.com

unread,
Jan 30, 2021, 5:33:37 PM1/30/21
to web2py-users
Do you use windows binaries? i.e web2py.exe?
https://github.com/web2py/web2py/issues/2300

воскресенье, 31 января 2021 г. в 00:40:21 UTC+3, snide...@gmail.com:

Dave S

unread,
Jan 30, 2021, 5:45:28 PM1/30/21
to web2py-users
On Saturday, January 30, 2021 at 2:33:37 PM UTC-8 valq...@gmail.com wrote:
Do you use windows binaries? i.e web2py.exe?
https://github.com/web2py/web2py/issues/2300


That issue is from April , and the exe I'm using is from November.  Are the official ones still broken?

/dps

valq...@gmail.com

unread,
Jan 30, 2021, 6:17:52 PM1/30/21
to web2py-users
I dont know, try to ask Nico, since issue is still open

воскресенье, 31 января 2021 г. в 01:45:28 UTC+3, snide...@gmail.com:

valq...@gmail.com

unread,
Jan 30, 2021, 6:20:50 PM1/30/21
to web2py-users
I also used binaries for windows, but now I use this https://winpython.github.io

воскресенье, 31 января 2021 г. в 02:17:52 UTC+3, valq...@gmail.com:

valq...@gmail.com

unread,
Jan 30, 2021, 6:22:33 PM1/30/21
to web2py-users
and this https://git-scm.com/download/win   (portable edition)

воскресенье, 31 января 2021 г. в 02:20:50 UTC+3, valq...@gmail.com:

valq...@gmail.com

unread,
Jan 30, 2021, 6:32:13 PM1/30/21
to web2py-users
try to compare db.py from  "fresh" welcome-app with your app. I have had a migration problem due to imports changes 

воскресенье, 31 января 2021 г. в 02:22:33 UTC+3, valq...@gmail.com:

Nico Zanferrari

unread,
Jan 31, 2021, 3:20:01 PM1/31/21
to Val K, web...@googlegroups.com
You are right, I'd completely forgotten these issues...

I've closed them all, because the zip files in the official repository http://www.web2py.com/init/default/download are fine.
Also, you can easily update the web2py program (and/or pydal) by manually substituting the source files inside.

Cheers,
Nico

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/1ba5a3aa-3393-450d-8b30-a8f552f44452n%40googlegroups.com.

Dave S

unread,
Jan 31, 2021, 6:58:21 PM1/31/21
to web2py-users
On Saturday, January 30, 2021 at 3:32:13 PM UTC-8 valq...@gmail.com wrote:
try to compare db.py from  "fresh" welcome-app with your app. I have had a migration problem due to imports changes 


Thanks!  This wasn't the issue, but you got me looking in the right place ... I had missed migrate_enabled.

There's some followup details for when I have time at the keyboard.

Dave S
/dps
 

António Ramos

unread,
Feb 10, 2021, 6:01:21 AM2/10/21
to web...@googlegroups.com
I have started another post with apparently the same problem.
as i have a production app i cant wait much longer so if anyone can help me professionaly with this please contact me privately.
Regards

--
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+un...@googlegroups.com.

Dave S

unread,
Feb 13, 2021, 2:32:10 AM2/13/21
to web2py-users
Briefly, I still get an exception but I think I understand why:   sql.log shows that the migration lower-cased all field names, which seems to be alright with sqlite, but doesn't seem to do that when I use the field in SQLTABLE.   This seems to be a broken backwards compatibility issue; I don't remember seeing this in the release notes.

/dps

Reply all
Reply to author
Forward
0 new messages