Edgewall Software
Modify

Opened 18 years ago

Closed 15 years ago

#3501 closed defect (duplicate)

WebAdmin using Postgres cannot delete multiple components at once.

Reported by: blinks@… Owned by: Christopher Lenz
Priority: normal Milestone:
Component: admin/web Version: 0.9.6
Severity: normal Keywords: postgresql
Cc: blinks@…, pacopablo@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Using WebAdmin 0.1.2dev-r3580 on Trac 0.9.6 with Postgres 8.0.8.

  1. Log in as a user with TRAC_ADMIN permissions.
  2. Select Admin, Components.
  3. If there is only one current component, create a test component.
  4. Check two components and click the "Remove selected items" button.

What should happen: both components get deleted.

What does happen:

Oops...
-------------------------------------
  Trac detected an internal error:

    can't adapt
-------------------------------------
If you think this really should work and you can reproduce it. Then you should consider to report this problem to the Trac team.

Go to http://trac.edgewall.com/ and create a new ticket where you describe the problem, how to reproduce it. Don't forget to include the python traceback found below.

TracGuide — The Trac User and Administration Guide
Python traceback

Traceback (most recent call last):
  File "/usr/lib64/python2.4/site-packages/trac/web/modpython_frontend.py", line 206, in handler
    dispatch_request(mpr.path_info, mpr, env)
  File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 107, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib64/python2.4/site-packages/TracWebAdmin-0.1.2dev_r3580-py2.4.egg/webadmin/web_ui.py", line 109, in process_request
    path_info)
  File "/usr/lib64/python2.4/site-packages/TracWebAdmin-0.1.2dev_r3580-py2.4.egg/webadmin/ticket.py", line 76, in process_admin_request
    comp = ticket.Component(self.env, name, db=db)
  File "/usr/lib64/python2.4/site-packages/trac/ticket/model.py", line 417, in __init__
    "WHERE name=%s", (name,))
ProgrammingError: can't adapt

Attachments (0)

Change History (7)

comment:1 by pacopablo, 18 years ago

Cc: pacopablo@… added

I remember running into this issue also. I believe that I traced it back to an issue with psycopg1. If you're using psycopg1, try with psycopg2 and see if the issue persists

comment:2 by blinks@…, 18 years ago

I'm running v2 already:

# on Gentoo, from /etc/portage/package.keywords
=www-apps/trac-0.9.6 ~amd64
=dev-libs/clearsilver-0.10.2 ~amd64
=app-text/pytextile-2.0.10 ~amd64
=dev-python/psycopg-2.0.2 ~amd64
=dev-python/pysqlite-2.3.1 ~amd64

comment:3 by Christian Boos, 18 years ago

Keywords: postgresql added

comment:4 by harald.radi@…, 18 years ago

I'm not sure if this also applies to WebAdmin, but adding the following code to trac/db/postgres_backend.py solved that issue for me for most other plugins:

def adapt_markup(markup):
    return AsIs("'%s'" % markup.plaintext())

register_adapter(Markup, adapt_markup)

comment:5 by Christian Boos, 18 years ago

Resolution: worksforme
Status: newclosed

Can't reproduce (with either psycopg2: 2.0.5.1 (dec dt ext pq3) or pyPgSQL: 2.5.1).

comment:6 by Christian Boos, 15 years ago

Resolution: worksforme
Status: closedreopened

comment:7 by Christian Boos, 15 years ago

Resolution: duplicate
Status: reopenedclosed

comment:4 was right on the spot, though I don't know exactly how he got a Markup value there, nor why that issue was not seen by more people…

Anyway, see #8740 for a resolution of the issue.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.