Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13543 closed defect (cantfix)

OperationalError: ambiguous column name: id

Reported by: Mikko Owned by:
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description (last modified by Ryan J Ollos)

How to Reproduce

  1. Configure multiple custom fields ("dev", "sales", "users" in this case with possible values "", "S", "M", "L" and "XL" for each field).
  2. Open /query and build a custom query where you try to select multiple values for at least two custom fields and press "Update"
  3. Select the URL in the browser address bar, copy and paste it into another browser window.

Expected result:

The page should look the same as after (2) when "Update" has been pressed.

Actual result:

Error page without the query interface nor query results:

While doing a GET operation on /query, Trac issued an internal error.

The problem seems to be caused by incorrect caching when query with multiple custom fields is done via GET. If I build the same query using custom query UI and press "Update" button, the query runs fine. The query also seems to work once if the same query has not been run in a while.

The cause is probably similar to t:#13068 but this is about Filters because the problem still appears even with only Summary column selected.

Note: trac report bug button automatically selected XmlRpcPlugin as the component for this ticket, but I think it's not the correct one. I believe the problem is in core Trac ticket query implementation. I have left the Component field in this bug as-is because I'm not sure how this should be handled here.

This query had custom Filter on fields "dev", "sales" and "users".

Request parameters:

{u'col': [u'id',
          u'summary',
          u'type',
          u'status',
          u'priority',
          u'milestone',
          u'time'],
 u'dev': [u'S', u'M'],
 u'order': u'priority',
 u'sales': [u'XL', u'L'],
 u'users': [u'XL', u'L']}

User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36

System Information

Trac 1.2.3
Genshi 0.7.1 (with speedups)
pysqlite 2.6.0
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609]
RPC 1.1.7
setuptools 40.8.0
SQLite 3.11.0
jQuery 1.11.3
jQuery UI 1.11.4
jQuery Timepicker 1.5.5

Enabled Plugins

TracXMLRPC 1.1.7

Interface Customization

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 647, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 248, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.7/dist-packages/trac/ticket/query.py", line 1016, in process_request
    return self.display_html(req, query)
  File "/usr/local/lib/python2.7/dist-packages/trac/ticket/query.py", line 1122, in display_html
    tickets = query.execute(req, cached_ids=orig_list)
  File "/usr/local/lib/python2.7/dist-packages/trac/ticket/query.py", line 303, in execute
    self.num_items = self._count(sql, args)
  File "/usr/local/lib/python2.7/dist-packages/trac/ticket/query.py", line 284, in _count
    % sql, args)[0][0]
  File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 122, in execute
    return db.execute(query, params)
  File "/usr/local/lib/python2.7/dist-packages/trac/db/util.py", line 128, in execute
    cursor.execute(query, params if params is not None else [])
  File "/usr/local/lib/python2.7/dist-packages/trac/db/util.py", line 72, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/local/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 88, in execute
    result = PyFormatCursor.execute(self, *args)
  File "/usr/local/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 64, in execute
    args or [])
  File "/usr/local/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 55, in _rollback_on_error
    return function(self, *args, **kwargs)
OperationalError: ambiguous column name: id

Attachments (0)

Change History (6)

comment:1 Changed 3 years ago by Jun Omae

Resolution: cantfix
Status: newclosed

That is not an XmlRpcPlugin issue. → trac:#13068

comment:2 Changed 3 years ago by Jun Omae

Try one of the following:

  • Downgrade to Trac 1.2.2
  • Upgrade to Trac 1.2-stable
  • Apply the changes of trac:r16819

comment:3 Changed 3 years ago by Jun Omae

Owner: osimons deleted
Status: closednew

comment:4 Changed 3 years ago by anonymous

Thanks, manually applying changes from ​trac:r16819 fixed the issue.

I guess this will be fixed officially in 1.2.4.

comment:5 Changed 3 years ago by Ryan J Ollos

Status: newclosed

comment:6 Changed 3 years ago by Ryan J Ollos

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.