Hi,

I created a new TurboGears skeleton using "tg-admin quickstart myApp --
sqlalchemy -i" . I then proceeded to create one new table definition
in the model.py file (not including the Identity tables) and I pointed
my database URI to our SQL Server rather than using the default. Now I
try to start the app, I get the following error:

Unhandled exception in thread started by <bound method Server._start
of <cherrypy._cpserver.Server o
bject at 0x00AB3210>>
Traceback (most recent call last):
  File "c:\python24\lib\site-packages\cherrypy-2.3.0-py2.4.egg\cherrypy
\_cpserver.py", line 78, in _
start
    Engine._start(self)
  File "c:\python24\lib\site-packages\cherrypy-2.3.0-py2.4.egg\cherrypy
\_cpengine.py", line 110, in
_start
    func()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\startup.py", line 234,
 in startTurboGears
    ext.start_extension()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\visit\api.py", line 15
5, in start_extension
    create_extension_model()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\visit\api.py", line 17
4, in create_extension_model
    _manager.create_model()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\visit\savisit.py", lin
e 39, in create_model
    class_mapper(visit_class).local_table.create(checkfirst=True)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\schema.py", line 300,
in create
    self.metadata.create_all(bind=bind, checkfirst=checkfirst,
tables=[self])
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\schema.py", line 1215,
 in create_all
    bind.create(self, checkfirst=checkfirst, tables=tables)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
1131, in create
    self._run_visitor(self.dialect.schemagenerator, entity,
connection=connection, **kwargs)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
1160, in _run_visitor
    visitorcallable(self.dialect, conn, **kwargs).traverse(element)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\visitors.py", line
 76, in traverse
    meth(target)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\compiler.py", line
 760, in visit_metadata
    self.traverse_single(table)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\visitors.py", line
 30, in traverse_single
    return meth(obj, **kwargs)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\compiler.py", line
 793, in visit_table
    self.execute()
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
1760, in execute
    return self.connection.execute(self.buffer.getvalue())
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
844, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
854, in _execute_text
    self.__execute_raw(context)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
916, in __execute_raw
    self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
953, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
935, in _handle_dbapi_exception
    raise exceptions.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconn
ect)
sqlalchemy.exceptions.DatabaseError: (DatabaseError) internal error:
SQL Server message 2714, severi
ty 16, state 6, line 2:
There is already an object named 'visit' in the database.
DB-Lib error message 10007, severity 5:
General SQL Server error: Check messages from the SQL Server.
 '\nCREATE TABLE visit (\n\tvisit_key VARCHAR(40) NOT NULL, \n
\tcreated DATETIME NOT NULL, \n\texpir
y DATETIME, \n\tPRIMARY KEY (visit_key)\n)\n\n' {}


For some reason, it keeps trying to re-create all the tables. I've
deleted them from the server and re-created them successfully using
"sql create". But if I start the program, the stupid thing tries to re-
create them AGAIN! This causes the error above (I think). How do I fix
this?

I'm using TurboGears 1.0.4.3 and SA 0.4.2p3 on Windows XP SP2. Thank
you very much!

Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to