You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by Apache Bloodhound <de...@bloodhound.apache.org> on 2013/05/15 00:32:06 UTC
[Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
#527: AttributeError rendering TicketQuery widget
---------------------+---------------
Reporter: olemis | Owner:
Type: defect | Status: new
Priority: major | Version:
Resolution: |
---------------------+---------------
Got following error recorded in the log while expanding `TicketQuery`
widget in global environment
{{{
2013-05-14 17:20:01,973 Trac[web_ui] ERROR: - 68c06066-1735-4042-877b-
a96f7c932422 - Error rendering widget TicketQuery with options {'args':
{'query': '!closed'}}
}}}
Details
{{{#!py
Traceback (most recent call last):
File "/path/to/bloodhound/bloodhound_dashboard/bhdashboard/web_ui.py",
line 272, in _render_widget
return wp.render_widget(name, ctx, options)
File "/path/to/bloodhound/bloodhound_dashboard/bhdashboard/util.py",
line 132, in widget_name_checker
return f(self, name, *args, **kwargs)
File
"/path/to/bloodhound/bloodhound_dashboard/bhdashboard/widgets/query.py",
line 102, in render_widget
data = qrymdl.process_request(fakereq)[1]
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 229, in process_request
return self.display_html(req, query)
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 241, in display_html
tickets = query.execute(req)
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 127, in execute
row[product_idx], val)
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 71, in _get_ticket_href
product_env = ProductEnvironment(self.env, prefix)
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/cache.py", line
67, in wrapper
result = user_function(*args, **kwds)
File "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/env.py",
line 379, in __call__
return ComponentMeta.__call__(self, *args, **kwargs)
File "/path/to/bloodhound/trac/trac/core.py", line 140, in __call__
self.__init__(*args, **kwargs)
File "/path/to/bloodhound/trac/trac/core.py", line 107, in new_init
original_init(self, *args, **kwargs)
File "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/env.py",
line 534, in __init__
self.setup_config()
File "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/env.py",
line 787, in setup_config
self.config = Configuration(self.parent, self.product.prefix, parents)
AttributeError: 'NoneType' object has no attribute 'prefix'
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner: olemis
Type: defect | Status: accepted
Priority: major | Milestone:
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Comment (by olemis):
[attachment:t527_r1482295_ticket_href_in_query.diff This patch] will fix
the initial issue if applied this way
{{{#!sh
$ hg qapplied
t526/t526_r1482295_widget_hide_disabled.diff
t527/t527_r1482295_ticket_href_in_query.diff
$ hg log -r qparent --template="[{svnrev}] - {desc}\n"
[1482295] - Ref. #325 - added 'More' link to the products widget, for
displaying the /products page
}}}
... but , immediately after , a new error is recorded in the log while
expanding `TicketQuery` widget in global environment
{{{
2013-05-14 17:51:19,939 Trac[formatter] ERROR: Macro Widget(TicketQuery,
query="!closed") failed:
}}}
Details
{{{#!py
Traceback (most recent call last):
File "/path/to/bloodhound/trac/trac/wiki/formatter.py", line 765, in
_macro_formatter
return macro.ensure_inline(macro.process(args))
File "/path/to/bloodhound/trac/trac/wiki/formatter.py", line 380, in
ensure_inline
text = _markup_to_unicode(text)
File "/path/to/bloodhound/trac/trac/wiki/formatter.py", line 107, in
_markup_to_unicode
markup = stream.render('xhtml', encoding=None, strip_whitespace=False)
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 183, in render
return encode(generator, method=method, encoding=encoding, out=out)
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/output.py", line 57, in encode
return _encode(''.join(list(iterator)))
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/output.py", line 339, in __call__
for kind, data, pos in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/output.py", line 670, in __call__
for kind, data, pos in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/output.py", line 586, in __call__
for ev in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File
"/media/b-500gb/projects/_svn/tho/tracdeveloperplugin/trunk/tracdeveloper/log.py",
line 62, in fn
for kind, data, pos in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 686, in
_unmark
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 954, in
__call__
for mark, (kind, data, pos) in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 779, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 954, in
__call__
for mark, (kind, data, pos) in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 779, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 1175, in
__call__
for mark, (kind, data, pos) in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 779, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 682, in
_mark
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/base.py", line 605, in
_include
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/markup.py", line 378, in
_match
ctxt, start=idx + 1, **vars):
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/markup.py", line 327, in
_match
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/base.py", line 545, in
_flatten
for kind, data, pos in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 686, in
_unmark
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 954, in
__call__
for mark, (kind, data, pos) in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 779, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 954, in
__call__
for mark, (kind, data, pos) in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 779, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 1175, in
__call__
for mark, (kind, data, pos) in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 779, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 714, in
__call__
for mark, event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/filters/transform.py", line 682, in
_mark
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/base.py", line 605, in
_include
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/markup.py", line 327, in
_match
for event in stream:
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/base.py", line 565, in
_flatten
result = _eval_expr(data, ctxt, vars)
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/base.py", line 277, in
_eval_expr
retval = expr.evaluate(ctxt)
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/template/eval.py", line 178, in
evaluate
return eval(self.code, _globals, {'__data__': data})
File
"/path/to/bloodhound/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html",
line 107, in <Expression u"cell.value != '' and
format_time(int(cell.value)) or '--'">
<td class="date" py:attrs="td_attrs">${cell.value != '' and
format_time(int(cell.value)) or '--'}
TypeError: int() argument must be a string or a number, not
'datetime.datetime'
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:3>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner: nobody
Type: defect | Status: new
Priority: major | Milestone:
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Changes (by olemis):
* owner: => nobody
* keywords: => ProductTicketQuery
* component: => multiproduct
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:1>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner:
Type: defect | Status: review
Priority: critical | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Changes (by olemis):
* owner: olemis =>
* status: accepted => review
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:6>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner: rjollos
Type: defect | Status: closed
Priority: critical | Milestone: Release 6
Component: multiproduct | Version:
Resolution: fixed | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Changes (by rjollos):
* status: review => closed
* resolution: => fixed
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:9>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery widget
Posted by Olemis Lang <ol...@gmail.com>.
On 5/29/13, Apache Bloodhound <de...@bloodhound.apache.org> wrote:
> #527: AttributeError rendering TicketQuery widget
> ---------------------------+--------------------------------
> Reporter: olemis | Owner: rjollos
> Type: defect | Status: review
> Priority: critical | Milestone: Release 6
> Component: multiproduct | Version:
> Resolution: | Keywords: ProductTicketQuery
> ---------------------------+--------------------------------
> Changes (by rjollos):
>
> * owner: => rjollos
>
>
> Comment:
>
> (In [1487711]) Refs #527: Refs #527: Fix for traceback when rendering
> `[[Widget(TicketQuery, query="!closed")]]`. The `widget_grid` template can
> now handle `datetime` objects.
>
> (In [1487712]) Refs #527: Avoid traceback when resolving env `href` to
> generate ticket URL for a `ProductQuery` when ticket product is `None`.
>
> Olemis should have been credited in the log message for both commits.
> Sorry about that Olemis!
>
nevermind ... let's just fix it ! that's what really matters ;)
PS: btw , the root cause of this message is not related to product =
NULL but the fact that environment selection code was not robust (as
expressed in the patch ;) ... which I suppose was understood before
committing r1487712 . For global environment env.parent is always set
to None , hence the failure and the patch .
--
Regards,
Olemis.
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner: rjollos
Type: defect | Status: review
Priority: critical | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Changes (by rjollos):
* owner: => rjollos
Comment:
(In [1487711]) Refs #527: Refs #527: Fix for traceback when rendering
`[[Widget(TicketQuery, query="!closed")]]`. The `widget_grid` template can
now handle `datetime` objects.
(In [1487712]) Refs #527: Avoid traceback when resolving env `href` to
generate ticket URL for a `ProductQuery` when ticket product is `None`.
Olemis should have been credited in the log message for both commits.
Sorry about that Olemis!
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:8>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner: olemis
Type: defect | Status: accepted
Priority: critical | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Comment (by olemis):
Replying to [comment:3 olemis]:
>
[...]
This seems to be the definitive solution ...
{{{#!sh
$ hg qapplied
t526/t526_r1482295_widget_hide_disabled.diff
t527/t527_r1482295_ticket_href_in_query.diff
t527/t527_r1482295_widget_grid_datetime.diff
$ hg log -r qparent --template="[{svnrev}] - {desc}\n"
[1482295] - Ref. #325 - added 'More' link to the products widget, for
displaying the /products page
}}}
... unless somebody will detect anything else going wrong with
''!TicketQueryWidget'' and submitted patches .
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:5>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner:
Type: defect | Status: review
Priority: critical | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Comment (by rjollos):
I could immediately produce the traceback in comment:3 by placing the call
to the `Widget` macro on WikiStart. The only way that I've been able to
reproduce the traceback in comment:description is to set the product for a
ticket that appears in a query on the Dashboard to `Null`, by directly
editing the database. In that case, I get:
{{{
#!sh
10:40:13 PM Trac[web_ui] ERROR: - 4ce868fb-9cbe-46dd-925e-aed660dfd90d -
Error rendering widget TicketQuery with options {'args': {'max': 10,
'query':
'status=!closed&group=product&col=id&col=summary&col=owner&col=status&col=priority&order=priority&col=milestone',
'title': 'Active Tickets'}}
Traceback (most recent call last):
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_dashboard/bhdashboard/web_ui.py",
line 269, in _render_widget
return wp.render_widget(name, ctx, options)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_dashboard/bhdashboard/util.py",
line 132, in widget_name_checker
return f(self, name, *args, **kwargs)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_dashboard/bhdashboard/widgets/query.py",
line 102, in render_widget
data = qrymdl.process_request(fakereq)[1]
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 229, in process_request
return self.display_html(req, query)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 241, in display_html
tickets = query.execute(req)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 127, in execute
row[product_idx], val)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/ticket/query.py",
line 71, in _get_ticket_href
product_env = ProductEnvironment(self.env, prefix)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/cache.py",
line 67, in wrapper
result = user_function(*args, **kwds)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/env.py",
line 379, in __call__
return ComponentMeta.__call__(self, *args, **kwargs)
File "/home/user/Workspace/bh526/bloodhound/trac/trac/core.py", line
140, in __call__
self.__init__(*args, **kwargs)
File "/home/user/Workspace/bh526/bloodhound/trac/trac/core.py", line
107, in new_init
original_init(self, *args, **kwargs)
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/env.py",
line 534, in __init__
self.setup_config()
File
"/home/user/Workspace/bh526/bloodhound/bloodhound_multiproduct/multiproduct/env.py",
line 787, in setup_config
self.config = Configuration(self.parent, self.product.prefix, parents)
AttributeError: 'NoneType' object has no attribute 'prefix'
}}}
How does one end up with the product for a ticket resource being `Null`
without directly editing the database?
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:7>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner: olemis
Type: defect | Status: accepted
Priority: major | Milestone:
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Changes (by olemis):
* owner: nobody => olemis
* status: new => accepted
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #527: AttributeError rendering TicketQuery
widget
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#527: AttributeError rendering TicketQuery widget
---------------------------+--------------------------------
Reporter: olemis | Owner: olemis
Type: defect | Status: accepted
Priority: critical | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: ProductTicketQuery
---------------------------+--------------------------------
Changes (by olemis):
* priority: major => critical
* milestone: => Release 6
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/527#comment:4>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker