Column auth_user.id not found BUT the column exists.

20 views
Skip to first unread message

Diego Tostes

unread,
Jun 23, 2020, 10:10:32 AM6/23/20
to web...@googlegroups.com

I am getting this error:

Traceback (most recent call last):
File "/home/rebec/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/home/rebec/web2py/applications/lavanderia/views/appadmin.html", line 169, in <module>
dict( ratio=ram['ratio'], hits=ram['hits'], misses=ram['misses']))}}
File "/home/rebec/web2py/gluon/sqlhtml.py", line 3274, in __init__
"Column %s not found (SQLTABLE)" % colname)
KeyError: 'Column auth_user.id not found (SQLTABLE)'

But when i check the DB:
mysql> show columns in auth_user;+--------------------+--------------+------+-----+---------+----------------+| Field              | Type         | Null | Key | Default | Extra          |+--------------------+--------------+------+-----+---------+----------------+| id                 | int(11)      | NO   | PRI | NULL    | auto_increment || first_name         | varchar(128) | YES  |     | NULL    |                || last_name          | varchar(128) | YES  |     | NULL    |                || email              | varchar(512) | YES  |     | NULL    |                || password           | varchar(512) | YES  |     | NULL    |                || registration_key   | varchar(512) | YES  |     | NULL    |                || reset_password_key | varchar(512) | YES  |     | NULL    |                || registration_id    | varchar(512) | YES  |     | NULL    |                |+--------------------+--------------+------+-----+---------+----------------+8 rows in set (0.00 sec)

Scott Hunter

unread,
Jun 27, 2020, 12:32:52 PM6/27/20
to web2py-users
Can you post the complete instructions for the lines listed in the stack trace?  At least for the one in your code?

Massimo Di Pierro

unread,
Jul 1, 2020, 1:15:34 AM7/1/20
to web2py-users
Somehow the table in db contains the field but the model does not.
We need to see you model.
Reply all
Reply to author
Forward
0 new messages