Modify

#11691 closed defect (invalid)

Problem with root option (Macro crash)

Reported by: jaroslaw.pekala@… Owned by: ChrisNelson
Priority: high Component: TracJsGanttPlugin
Severity: blocker Keywords:
Cc: Trac Release: 1.0

Description

Problem after update from 0.10 to 0.11

Error: Macro TracJSGanttChart(root=25067) failed column reference "id" is ambiguous LINE 9: WHERE ((id IN (25067,25593,25595)))

Attachments (0)

Change History (21)

comment:1 in reply to: ↑ description Changed 11 months ago by ChrisNelson

Replying to jaroslaw.pekala@…:

Problem after update from 0.10 to 0.11

Error: Macro TracJSGanttChart(root=25067) failed column reference "id" is ambiguous LINE 9: WHERE ((id IN (25067,25593,25595)))

What version of the plugin are you using? Can you provide more of a traceback? It's hard to know which query fails from that one line.

comment:2 follow-up: Changed 11 months ago by anonymous

version 0.11 (see description). Log extract below

2014-04-15 17:29:46,554 Trac[formatter] ERROR: Macro TracJSGanttChart(root=25067) failed:
135243 Traceback (most recent call last):
  File "/data/env/demo/lib/python2.6/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "/data/env/demo/lib/python2.6/site-packages/trac/wiki/formatter.py", line 356, in process
    text = self.processor(text)
  File "/data/env/demo/lib/python2.6/site-packages/trac/wiki/formatter.py", line 343, in _macro_processor
    text)
  File "/data/env/demo/lib/python2.6/site-packages/tracjsgantt/tracjsgantt.py", line 731, in expand_macro
    tasks = self._add_tasks(options)
  File "/data/env/demo/lib/python2.6/site-packages/tracjsgantt/tracjsgantt.py", line 664, in _add_tasks
    self.tickets = self._query_tickets(options)
  File "/data/env/demo/lib/python2.6/site-packages/tracjsgantt/tracjsgantt.py", line 320, in _query_tickets
    rawtickets = self.pm.query(query_options, fields, self.req)
  File "/data/env/demo/lib/python2.6/site-packages/tracjsgantt/tracpm.py", line 1186, in query
    tickets = query.execute(req)
  File "/data/env/demo/lib/python2.6/site-packages/trac/ticket/query.py", line 302, in execute
    self.num_items = self._count(sql, args)
  File "/data/env/demo/lib/python2.6/site-packages/trac/ticket/query.py", line 283, in _count
    % sql, args)[0][0]
  File "/data/env/demo/lib/python2.6/site-packages/trac/db/api.py", line 122, in execute
    return db.execute(query, params)
  File "/data/env/demo/lib/python2.6/site-packages/trac/db/util.py", line 121, in execute
    cursor.execute(query, params)
  File "/data/env/demo/lib/python2.6/site-packages/trac/db/util.py", line 66, in execute
    return self.cursor.execute(sql)
ProgrammingError: column reference "id" is ambiguous
LINE 9: WHERE ((id IN (25067,25593,25595)))
Last edited 11 months ago by ChrisNelson (previous) (diff)

comment:3 in reply to: ↑ 2 Changed 11 months ago by ChrisNelson

Replying to anonymous:

version 0.11 (see description).

I've been bad about updating the plugin version. Sorry. The latest version of the plugin is 0.10. What Subversion revision of the plugin are you using? Did you checkout the source with Subversion or download a zip file?

comment:4 Changed 11 months ago by jaroslaw.pekala@…

Yes, we checked out sources from svn: https://trac-hacks.org/svn/tracjsganttplugin/0.11/

comment:5 follow-up: Changed 11 months ago by jaroslaw.pekala@…

svn - Revision 13851: /tracjsganttplugin/0.11

comment:6 in reply to: ↑ 5 Changed 11 months ago by ChrisNelson

Replying to jaroslaw.pekala@…:

svn - Revision 13851: /tracjsganttplugin/0.11

The last change I see is:

git-svn-id: http://trac-hacks.org/svn/tracjsganttplugin/0.11@13842 7322e99d-02ea-0310-aa39-e9a107903beb

That is r13842.

r13851 seems to be for the TagsPlugin

Last edited 11 months ago by ChrisNelson (previous) (diff)

comment:7 follow-up: Changed 11 months ago by jaroslaw.pekala@…

Sorry. I didn't install it by myself. Our admin downloaded zipped version from trac-hacks

comment:8 in reply to: ↑ 7 Changed 11 months ago by ChrisNelson

Replying to jaroslaw.pekala@…:

Sorry. I didn't install it by myself. Our admin downloaded zipped version from trac-hacks

OK. We don't have Trac 1.0 in production yet so I have no good way to test the plugin there. We are weeks away from moving to Trac 1.0.1. I'm not sure I can do anything in the mean time. This appears to be a version compatibility issue.

comment:9 Changed 11 months ago by ChrisNelson

We aren't in production yet but in the development sandbox where we are running a patched Trac 1.0.1 we don't see this problem.

comment:10 Changed 11 months ago by ChrisNelson

What do you get if you try TracJSGanttChart(id=25067)?

comment:11 follow-up: Changed 11 months ago by Jarosław Pękala <jaroslaw.pekala@…>

When TracJSGanttChart(id=25067) is used result is the same as for root=

comment:12 in reply to: ↑ 11 Changed 11 months ago by ChrisNelson

Replying to Jarosław Pękala <jaroslaw.pekala@…>:

When TracJSGanttChart(id=25067) is used result is the same as for root=

What DBMS are you using? SQLite? PostgreSQL?

What -- specific -- Trac version are you using? You say "1.0" but we're playing with 1.0.1.

comment:13 follow-up: Changed 11 months ago by Jarosław Pękala <jaroslaw.pekala@…>

DBMS: PostgreSQL Trac: 1.0.2dev-r11780

comment:14 in reply to: ↑ 13 Changed 11 months ago by ChrisNelson

Replying to Jarosław Pękala <jaroslaw.pekala@…>:

DBMS: PostgreSQL Trac: 1.0.2dev-r11780

OK. My guess is that something changed in query.py between 1.0.1 (stable) and 1.0.2dev. If you can test in 1.0.1, that would be helpful. If not, I'll see what changes there are in Trac between those versions (but that may take me a while).

comment:15 Changed 11 months ago by Jarosław Pękala <jaroslaw.pekala@…>

Maybe it will be helpful: previously used TracJSGanttChart version (installed about April 2012) had no problem with our current trac. It started when we updated macro to last version (yesterday). Tomorrow I'll try to revert macro sources from our trac production environment to check the result.

comment:16 follow-up: Changed 11 months ago by Jarosław Pękala <jaroslaw.pekala@…>

We installed trac ver. 1.0.1 there's no problem. Your assumptions were right - error is connected with version 1.0.2.

comment:17 in reply to: ↑ 16 Changed 11 months ago by ChrisNelson

Replying to Jarosław Pękala <jaroslaw.pekala@…>:

We installed trac ver. 1.0.1 there's no problem. Your assumptions were right - error is connected with version 1.0.2.

Great! I may look into what changed between 1.0.1 and 1.0.2 to see if I can point to a bug in Trac.

comment:18 follow-up: Changed 11 months ago by ChrisNelson

There are two closed tickets at Edgewall:

Changeset 12299 was Dec 8, 2013 1:00:16 PM (4 months ago). The OP says he was using "Trac: 1.0.2dev-r11780" which is from 2013-04-13 09:34:51. You'd think that the older fix would be in the newer rev.

comment:19 in reply to: ↑ 18 Changed 11 months ago by ChrisNelson

Replying to ChrisNelson:

... Changeset 12299 was Dec 8, 2013 1:00:16 PM (4 months ago). The OP says he was using "Trac: 1.0.2dev-r11780" which is from 2013-04-13 09:34:51. You'd think that the older fix would be in the newer rev.

Then again, the change set IDs and the dates are on opposite orders. What did I miss?

comment:20 Changed 11 months ago by ChrisNelson

The change to 1.0stable was:

branches/1.0-stable/trac/ticket/query.py
r12235 	r12299 	 
435	435	        enum_columns = ('resolution', 'priority', 'severity') 
436	436	        # Build the list of actual columns to query 
437	 	        cols = self.cols[:] 
 	437	        cols = [] 
438	438	        def add_cols(*args): 
439	439	            for col in args: 
440	440	                if not col in cols: 
441	441	                    cols.append(col) 
 	442	        add_cols(*self.cols)  # remove duplicated cols 
442	443	        if self.group and not self.group in cols: 
443	444	            add_cols(self.group)

and if I look at query.py at the top of 1.0stable today I see:

        # Build the list of actual columns to query
        cols = []
        def add_cols(*args):
            for col in args:
                if not col in cols:
                    cols.append(col)
        add_cols(*self.cols)  # remove duplicated cols

The problem appears to have resurfaced.

comment:21 Changed 11 months ago by ChrisNelson

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

The OP's change (11780) is in the history of the fix for this "column reference "id" is ambiguous" issue (12299) on the 1.0-stable branch. Updating to current 1.0.2 should address the issue, if desired.

Add Comment

Modify Ticket

Action
as closed The owner will remain ChrisNelson.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.