this exact error happened to me after upgrading web2py.
https://groups.google.com/forum/#!topic/web2py/58aG2cdzk8s
I'm using Version 2.11.2-stable.
I don't know how to report this properly. Any ideas?
Also, what more information would you want?
That may be considered a bug, which you can report on Github.
For now, the workaround is to set lazy_tables=True
or make sure reference fields refer only to tables that have already been defined.