table already exists; 'Rows' object has no attribute 'fields'

156 views
Skip to first unread message

pbreit

unread,
Apr 16, 2017, 3:31:04 AM4/16/17
to web2py-users
I'm a long time web2py user running into some problems I haven't seen before and cannot resolve.

First, I am getting this error a lot even when I create a brand new project from scratch:

OperationalError: table "auth_user" already exists

Another error I am getting consistently is:

AttributeError: 'Rows' object has no attribute 'fields'

All I am doing is going to /appadmin and trying to view a simple table:



db.define_table('contact',
   
Field('user_id', 'reference auth_user', default=auth.user_id),
   
Field('name'),
   
Field('address'),
   
Field('city'),
   
Field('province'),
   
Field('zip'),
   
Field('country'),
   
Field('status', default='new'),
   
Field('tax_id'),
   
Field('phone'),
   
Field('entity'),
   
Field('business_type'),
   
Field('bank_name'),
   
Field('bank_id'),
   
Field('bank_account_id'),
   
Field('bank_currency'),
    auth
.signature)



Dave S

unread,
Apr 17, 2017, 4:29:09 PM4/17/17
to web2py-users
On Sunday, April 16, 2017 at 12:31:04 AM UTC-7, pbreit wrote:
I'm a long time web2py user running into some problems I haven't seen before and cannot resolve.

First, I am getting this error a lot even when I create a brand new project from scratch:

OperationalError: table "auth_user" already exists

Another error I am getting consistently is:

AttributeError: 'Rows' object has no attribute 'fields'


What database?  What does your connection string look like?
 
All I am doing is going to /appadmin and trying to view a simple table:



db.define_table('contact',
   
Field('user_id', 'reference auth_user', default=auth.user_id),
   
Field('name'),
   
Field('address'),
   
Field('city'),
   
Field('province'),
   
Field('zip'),
   
Field('country'),
   
Field('status', default='new'),
   
Field('tax_id'),
   
Field('phone'),
   
Field('entity'),
   
Field('business_type'),
   
Field('bank_name'),
   
Field('bank_id'),
   
Field('bank_account_id'),
   
Field('bank_currency'),
    auth
.signature)




/dps
 

pbreit

unread,
Apr 17, 2017, 6:58:38 PM4/17/17
to web2py-users
Sqlite. These are fresh installs with just a table defined and no other edits.

I've noticed that I can get it to work if I quickcreate the new app, call it up in a browser so the initial tables get created, add my own models and the call it up again.

Dave S

unread,
Apr 17, 2017, 7:18:26 PM4/17/17
to web2py-users


On Monday, April 17, 2017 at 3:58:38 PM UTC-7, pbreit wrote:
Sqlite. These are fresh installs with just a table defined and no other edits.

I've noticed that I can get it to work if I quickcreate the new app, call it up in a browser so the initial tables get created, add my own models and the call it up again.

What did you name your model files?

/dps
 

pbreit

unread,
Apr 18, 2017, 7:28:54 PM4/18/17
to web2py-users
models were in the regular models.py file

Wabbajack

unread,
Apr 18, 2017, 10:54:32 PM4/18/17
to web2py-users

Similar problem here i have downloaded the latest version.
enable username = true
add 1 user thru the webapp

then go appadmin click db.auth_user [to view my newly created user]
then the error occurs <type 'exceptions.AttributeError'> 'Rows' object has no attribute 'fields'

Also i view the database and confirmed that it already added 1 user also update the group, event, membership table


Dave S

unread,
Apr 19, 2017, 1:56:33 AM4/19/17
to web2py-users


On Tuesday, April 18, 2017 at 7:54:32 PM UTC-7, Wabbajack wrote:

Similar problem here i have downloaded the latest version.

Windows?  Source?  Packaged or GitHub?

 
enable username = true
add 1 user thru the webapp

then go appadmin click db.auth_user [to view my newly created user]
then the error occurs <type 'exceptions.AttributeError'> 'Rows' object has no attribute 'fields'

Also i view the database and confirmed that it already added 1 user also update the group, event, membership table


Are you also using sqlite?
 

/dps
 

Wabbajack

unread,
Apr 19, 2017, 4:24:21 AM4/19/17
to web2py-users
Hi Dave,

Thanks for the quick response..

Yes i am using Windows also downloaded from GIT repository
Also used sqlite ...i havent done any changes yet all steps below are fresh after creation of new simple application

seems to have a problem right after you add a new record on any table on the DB

Anthony

unread,
Apr 19, 2017, 11:43:45 AM4/19/17
to web2py-users
On Wednesday, April 19, 2017 at 4:24:21 AM UTC-4, Wabbajack wrote:
Hi Dave,

Thanks for the quick response..

Yes i am using Windows also downloaded from GIT repository

It is possible you did not get the updated pydal because that is not part of the web2py repository but a submodule. When doing the initial clone, you need to add --recursive, and when updating, I think you need to run "git submodule update".

Also, when updating web2py, you should also update your application's appadmin.py controller and appadmin.html view, in case any changes have been made.

Anthony

Wabba Jak

unread,
Apr 19, 2017, 7:44:01 PM4/19/17
to web...@googlegroups.com
Hi Anthony,

Thanks... got it working



--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/EILfDStMCEw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pbreit

unread,
Apr 21, 2017, 4:00:24 AM4/21/17
to web2py-users
I'm still experiencing both problems.

I cloned web2py from scratch with: git clone --recursive https://github.com/web2py/web2py.git

I added my fairly basic table models into models.py. When i run for the very first time I get:
OperationalError: table "auth_user" already exists



In /appadmin jsut trying to go to one of my tables continuously gave me:
AttributeError: 'Rows' object has no attribute 'fields'



And now I'm also stuck with:
ERROR:Rocket.Errors.Port8000:Socket 127.0.0.1:8000 in use by other process



I never ran into any of these problems before a few months a


pbreit

unread,
Apr 23, 2017, 12:49:26 AM4/23/17
to web2py-users
I reinstalled Mac OS Sierra which appears to have fixed the problems.

Dave S

unread,
Apr 24, 2017, 4:38:58 PM4/24/17
to web2py-users


On Saturday, April 22, 2017 at 9:49:26 PM UTC-7, pbreit wrote:
I reinstalled Mac OS Sierra which appears to have fixed the problems.

That seems like a rather drastic solution.  Perhaps there were issues with paths variables pointing in various directions as new replaced old (FSVO "replace").

/dps
 

Remco Boerma

unread,
May 18, 2017, 6:22:42 AM5/18/17
to web2py-users
Thanks for that. 

It does introduce a  new error: 
ValueError: Field student_record.request_tenant is already bound to a table

The latest pydal as db._common_fields don't seem to get along. 

db._common_fields.append(auth.signature)
db._common_fields.append(Field('request_tenant',
default=user_org,
writable=False))


Any ideas on that? 
Thanks. 

Op woensdag 19 april 2017 17:43:45 UTC+2 schreef Anthony:
Reply all
Reply to author
Forward
0 new messages