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 #675 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Catwalk fails when adding new row (Postgres)

Reported by: chris@… Owned by: anonymous
Priority: normal Milestone:
Component: Toolbox Version:
Severity: normal Keywords:
Cc: chris@…

Description

Simplest class I can think of:

class Conference(SQLObject):

name = StringCol?(length=30)

When trying to add a record via Catwalk, I get:

127.0.0.1 - - [21/Mar/2006:20:28:53] "GET /catwalk/columns?objectName=Conference HTTP/1.1" 200 189 21/Mar/2006:20:29:01 HTTP INFO Page handler: <bound method CatWalk.add of <turbogears.toolbox.catwalk.CatWalk instance at 0x408f680c>> Traceback (most recent call last):

File "/usr/local/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py", line 99, in _run

self.main()

File "/usr/local/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py", line 248, in main

body = page_handler(*virtual_path, self.params)

File "<string>", line 3, in add File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a1-py2.4.egg/turbogears/controllers.py", line 210, in expose

tg_format, html, fragment, *args, kw)

File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a1-py2.4.egg/turbogears/database.py", line 193, in run_with_transaction

retval = func(*args, kw)

File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a1-py2.4.egg/turbogears/controllers.py", line 228, in _execute_func

output = errorhandling.try_call(func, *args, kw)

File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a1-py2.4.egg/turbogears/errorhandling.py", line 63, in try_call

output = func(self, *args, kw)

File "/usr/local/lib/python2.4/site-packages/TurboGears-0.9a1-py2.4.egg/turbogears/toolbox/catwalk/init.py", line 789, in add

new_object = obj(params)

File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py", line 1197, in init

self._create(id, kw)

File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py", line 1224, in _create

self._SO_finishCreate(id)

File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py", line 1248, in _SO_finishCreate

id, names, values)

File "/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py", line 752, in queryInsertID

return self._dbConnection._queryInsertID(

File "/usr/local/lib/python2.4/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('conference_id_seq') Request Headers:

Content-Length: 30 ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7 USER-AGENT: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1 CONNECTION: keep-alive PRAGMA: no-cache CONTENT-LENGTH: 30 HOST: localhost:7654 CACHE-CONTROL: no-cache CONTENT-TYPE: application/x-www-form-urlencoded ACCEPT: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Remote-Addr: 127.0.0.1 ACCEPT-LANGUAGE: en-us,en;q=0.5 Content-Type: application/x-www-form-urlencoded Remote-Host: 127.0.0.1 ACCEPT-ENCODING: gzip,deflate KEEP-ALIVE: 300

127.0.0.1 - - [21/Mar/2006:20:29:01] "POST /catwalk/add HTTP/1.1" 500 3121 2006-03-21 20:29:05,281 turbogears.controllers DEBUG Returning JSON 127.0.0.1 - - [21/Mar/2006:20:29:05] "GET /catwalk/instances?objectName=Conference&start=0 HTTP/1.1" 200 192

TurboGears 9.0a1 Postgres 8.0.3

The table and sequence have been created successfully.

Change History

comment:1 Changed 13 years ago by ronald@…

  • Cc chris@… added

Hi Chris, can you help me reproduce this? I have PG on OSX adding rows to your simple model with CatWalk without any glitch. I have tried to add, save and add another and update my 'Conference' class and haven't been able to reproduce your error. Are you running the latest revision (983)? On what platform? Do yo see the problem on a fresh quickstarted project?

comment:2 Changed 13 years ago by chris@…

Glad to help. TG is running 9.0a1, installed via easy_install (not subversion). Platform is SuSE 10 linux, w/ Python 2.4 (built from scratch). Postgres 8.0.3 is on another box running SuSE 9.

I have a feeling that it's Postgres that's complaining about something, but running the SELECT NEXTVAL('conference_id_seq') command seems to work fine thru psql.

I'll have to try a freshly quickstarted project tonight and follow up. If anyone thinks of any questions in the meantime, let me know and I'll do the research tonight.

comment:3 Changed 13 years ago by ronald@…

Hi Chris, Can you replace your version of turbogears/toolbox/catwalk/init.py with this one: http://trac.turbogears.org/turbogears/browser/trunk/turbogears/toolbox/catwalk/__init__.py?rev=909&format=raw

And check if the problem is still there.

comment:4 Changed 13 years ago by anonymous

bingo. that seems to have fixed it. Many thanks!

comment:5 Changed 13 years ago by ronald@…

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

Perfect =)

Note: See TracTickets for help on using tickets.