Edgewall Software

Ticket #3501 (closed defect: worksforme)

Opened 2 years ago

Last modified 21 months ago

WebAdmin using Postgres cannot delete multiple components at once.

Reported by: blinks@… Owned by: cmlenz
Priority: normal Milestone:
Component: admin/web Version: 0.9.6
Severity: normal Keywords: postgresql
Cc: blinks@…, pacopablo@…

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

Change History

Changed 2 years ago by pacopablo

  • 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

Changed 2 years ago by blinks@…

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

Changed 2 years ago by cboos

  • keywords postgresql added

Changed 22 months ago by harald.radi@…

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)

Changed 21 months ago by cboos

  • status changed from new to closed
  • resolution set to worksforme

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

Add/Change #3501 (WebAdmin using Postgres cannot delete multiple components at once.)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cmlenz. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.