On 21 December 2011 14:15, Axel <[email protected]> wrote:

> Johann Spies <johann.spies@...> writes:
>
> > Use the ticket interface to go to the line of code that caused the
> problem.
> Maybe there is something in the controller that causes this.RegardsJohann
>
> The ticket interface says:
>
> Traceback (most recent call last):
> File "gluon/restricted.py", line 204, in restricted
> File "C:/Documents and
> Settings/axel1/Desktop/web2py/applications/axelweb/models/db.py",
>    line 16, in <module>
> File "gluon/dal.py", line 5097, in define_table
> File "gluon/dal.py", line 728, in create_table
> File "gluon/dal.py", line 816, in migrate_table
> File "gluon/dal.py", line 1359, in execute
> File "gluon/dal.py", line 1353, in log_execute
> File "gluon/contrib/pymysql/cursors.py", line 108, in execute
> File "gluon/contrib/pymysql/connections.py", line 184, in
> defaulterrorhandlerInternalError: (1060, u"Duplicate column name 'nyckel'")
>
> line 16 in db.py is:
>
> db.define_table('testdata',Field('idtestdata'),Field('nyckel'),Field('data'))
>
> If I delete the table in MySQL, the browser loads forever.
> If I create the table in MySQL, I get the error ticket.
>

It might be a communication problem between web2py and mysql.

To test whether it is your code that causes the problem, change your db to
sqlite temporarily and see whether you get the same problem.

If that works without a problem, then you know the problem is
mysql-related.  I would try the following if I were you: comment out the
model in web2py (this time with mysql as database server) and use appadmin
to make sure web2py does not use the table any more.  Then check in mysql
using mysql commandline or other mysql admin tool whether the table still
exists in mysql.  If so, drop it in mysql, make sure there are no files in
web2py/applications/<yourapp>/database/  that refers to that table,
uncomment the model and try again.

Regards
Johann



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Reply via email to