Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #213 (closed defect: fixed)

Opened 12 years ago

Last modified 10 years ago

catwalk: add/edit does not work since changeset 259

Reported by: gabor@… Owned by: anonymous
Priority: normal Milestone: 0.9
Component: Toolbox Version: 0.9a6
Severity: normal Keywords: sql CatWalk
Cc: gabor@…

Description

i'm using svn-head turbogears starting with r259,i am unable to edit/add objects using catwalk. it works ok with "tg-admin shell". i'm using mac osx, and postgres 8.0.4.

when editing, i get (full traceback attached)

"File SQLObject-0.7.0-py2.4.egg/sqlobject/postgres/pgconnection.py",
 line 119, in _queryInsertID
    c.execute("SELECT NEXTVAL('%s')" % sequenceName)
ProgrammingError: ERROR:  current transaction is aborted, commands ignored until end of transaction block

SELECT NEXTVAL('node_id_seq')

when adding a new object i get (full traceback attached)

  File "SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py", 
line 295, in _executeRetry
    return cursor.execute(query)
ProgrammingError: ERROR:  current transaction is aborted, commands ignored until end of transaction block

UPDATE node SET stuff = 'stuffz', name = 'nammes' WHERE id = 16

as i mentioned, r259 broke this, which deals with transaction changes. so i think catwalk simply was not updated for those changes.

Attachments

edit.txt Download (2.0 KB) - added by gabor@… 12 years ago.
edit object traceback
add-new.txt Download (1.8 KB) - added by gabor@… 12 years ago.
add new object traceback

Change History

Changed 12 years ago by gabor@…

edit object traceback

Changed 12 years ago by gabor@…

add new object traceback

comment:1 Changed 12 years ago by Florian

  • Milestone set to 0.9

On r385 this problem still exists for me.

192.168.1.16 - - [2005/12/27 22:19:21] "GET /catwalk/columns?objectName=Genre HTTP/1.1" 200 306
2005/12/27 22:19:22 HTTP INFO 192.168.1.16 - GET /catwalk/columns?objectName=Song HTTP/1.1
2005/12/27 22:19:22  INFO Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 271, in run
    main()
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 502, in main
    body = page_handler(*args, **cherrypy.request.paramMap)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/controllers.py", line 220, in newfunc
    html, *args, **kw)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/database.py", line 174, in run_with_transaction
    retval = func(*args, **kw)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/controllers.py", line 246, in _execute_func
    output = func(self, *args, **kw)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/catwalk/catwalk.py", line 969, in columns
    columns=self.object_columns(objectName),
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/catwalk/catwalk.py", line 478, in object_columns
    cols = self.get_columns_for_object(object)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/catwalk/catwalk.py", line 490, in get_columns_for_object
    cols.append(self.get_column_properties(column_name,column))
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/catwalk/catwalk.py", line 452, in get_column_properties
    props = self.get_foreign_key_properties(column,props)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/catwalk/catwalk.py", line 467, in get_foreign_key_properties
    properties['labelColumn'])
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r385-py2.4.egg/turbogears/catwalk/catwalk.py", line 327, in foreign_key_alternatives
    alt = list(obj.select())
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/sresults.py", line 149, in __iter__
    return iter(list(self.lazyIter()))
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/sresults.py", line 157, in lazyIter
    return conn.iterSelect(self)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py", line 755, in iterSelect
    select, keepConnection=True)))
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py", line 687, in __init__
    self.dbconn._executeRetry(self.rawconn, self.cursor, self.query)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py", line 295, in _executeRetry
    return cursor.execute(query)
ProgrammingError: ERROR:  current transaction is aborted, commands ignored until end of transaction block

comment:2 Changed 12 years ago by michele

Can you try with a new svn update? Kevin committed some new stuffs regarding transactions in r387, I'm not sure if they apply also in this situation.

comment:3 Changed 12 years ago by florian

I've tried with r391 and it still is not working. Below a perhaps better traceback.

192.168.1.16 - - [2005/12/27 23:00:22] "GET /catwalk/list HTTP/1.1" 200 68
2005/12/27 23:00:24 HTTP INFO 192.168.1.16 - GET /catwalk/columns?objectName=Genre HTTP/1.1
2005-12-27 23:00:24,155 turbogears.controllers DEBUG Returning JSON
192.168.1.16 - - [2005/12/27 23:00:24] "GET /catwalk/columns?objectName=Genre HTTP/1.1" 200 306
2005/12/27 23:00:25 HTTP INFO 192.168.1.16 - GET /catwalk/columns?objectName=Genre HTTP/1.1
2005-12-27 23:00:25,940 turbogears.controllers DEBUG Returning JSON
192.168.1.16 - - [2005/12/27 23:00:25] "GET /catwalk/columns?objectName=Genre HTTP/1.1" 200 306
2005/12/27 23:00:28 HTTP INFO 192.168.1.16 - POST /catwalk/add HTTP/1.1
2005/12/27 23:00:28  INFO Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 271, in run
    main()
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 502, in main
    body = page_handler(*args, **cherrypy.request.paramMap)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r391-py2.4.egg/turbogears/controllers.py", line 220, in newfunc
    html, *args, **kw)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r391-py2.4.egg/turbogears/database.py", line 175, in run_with_transaction
    retval = func(*args, **kw)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r391-py2.4.egg/turbogears/controllers.py", line 246, in _execute_func
    output = func(self, *args, **kw)
  File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a0dev_r391-py2.4.egg/turbogears/catwalk/catwalk.py", line 696, in add
    new_object = obj(**params)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py", line 1183, in __init__
    self._create(id, **kw)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py", line 1210, in _create
    self._SO_finishCreate(id)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py", line 1234, in _SO_finishCreate
    id, names, values)
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py", line 744, in queryInsertID
    return self._dbConnection._queryInsertID(
  File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/postgres/pgconnection.py", line 119, in _queryInsertID
    c.execute("SELECT NEXTVAL('%s')" % sequenceName)
ProgrammingError: ERROR:  current transaction is aborted, commands ignored until end of transaction block

comment:4 Changed 12 years ago by helge

Catwalk requires a table called "catwalk_state_table" which is defined in turbogears/catwalk/catwalk.py:73, but it is not created via "tg-admin sql create". Create this table manually and it works.

comment:5 Changed 12 years ago by ronald@…

  • Cc gabor@… added

Can someone who can reproduce the problem (I can't) check with the latest revision? Revision r558 updated the way CatWalk aquired a connection for the state table, which in theory should fix this issue.

comment:6 Changed 11 years ago by nyenyec

I just tried this with r591 and a freshly creates turbotunes tutorial.

WinXP Pro, Postgres 8.1

When I call

tg-admin toolbox start

And the try to add an artist through the CatWalk web page I get:

29/Jan/2006:21:40:47 HTTP INFO Serving HTTP on http://localhost:7654/
29/Jan/2006:21:41:28 HTTP INFO Page handler: <bound method CatWalk.add of <turbogears.toolbox.catwalk.CatWalk instance at 0x013A9580>>
Traceback (most recent call last):
  File "c:\python24\lib\site-packages\cherrypy-2.2.0beta-py2.4.egg\cherrypy\_cphttptools.py", line 99, in _run
    self.main()
  File "c:\python24\lib\site-packages\cherrypy-2.2.0beta-py2.4.egg\cherrypy\_cphttptools.py", line 247, in main
    body = page_handler(*virtual_path, **self.params)
  File "c:\local\turbogears\svn\turbogears\turbogears\controllers.py", line 241, in newfunc
    html, fragment, *args, **kw)
  File "c:\local\turbogears\svn\turbogears\turbogears\database.py", line 189, in run_with_transaction
    retval = func(*args, **kw)
  File "c:\local\turbogears\svn\turbogears\turbogears\controllers.py", line 258, in _execute_func
    output = func(self, *args, **kw)
  File "c:\local\turbogears\svn\turbogears\turbogears\toolbox\catwalk\__init__.py", line 784, in add
    new_object = obj(**params)
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1457-py2.4.egg\sqlobject\main.py", line 1197, in __init__
    self._create(id, **kw)
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1457-py2.4.egg\sqlobject\main.py", line 1224, in _create
    self._SO_finishCreate(id)
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1457-py2.4.egg\sqlobject\main.py", line 1248, in _SO_finishCreate
    id, names, values)
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1457-py2.4.egg\sqlobject\dbconnection.py", line 752, in queryInsertID
    return self._dbConnection._queryInsertID(
  File "c:\python24\lib\site-packages\SQLObject-0.7.1dev_r1457-py2.4.egg\sqlobject\postgres\pgconnection.py", line 122, in _queryInsertID
    c.execute("SELECT NEXTVAL('%s')" % sequenceName)
ProgrammingError: ERROR:  current transaction is aborted, commands ignored until end of transaction block

SELECT NEXTVAL('artist_id_seq') 

comment:7 Changed 11 years ago by anonymous

  • Keywords sql CatWalk added

comment:8 Changed 11 years ago by kevin

This may also be related to #249.

comment:9 Changed 11 years ago by anonymous

I think this is also related to #618 'Cannot add rows to tables in Postgres db using Catwalk'

comment:10 Changed 11 years ago by ronald@…

  • Status changed from new to closed
  • Resolution set to fixed

Checked in a workaround in rev909 - tested with Postgres on OSX

Note: See TracTickets for help on using tickets.