Modify

Opened 12 months ago

Closed 12 months ago

Last modified 11 months ago

#11290 closed defect (fixed)

Doesn't work on version 1.0

Reported by: giursino Owned by: rjollos
Priority: normal Component: SimpleTicketPlugin
Severity: blocker Keywords:
Cc: Trac Release: 1.0

Description

When I try to visit the "new ticket" page it gives me this error:

Trac detected an internal error: 
IndexError: list index out of range

in Trac version 0.12 it worked fine.

My configuration is:

...
[simpleticket]
show_only = true
fields = cc, component, severity, type, ver_from
...

Versions:

  • plugin: 0.5
  • trac: 1.0.1

Error log:

2013-08-28 10:18:50,294 Trac[main] ERROR: Exception caught while post-processing request:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 243, in dispatch
    self._post_process_request(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 340, in _post_process_request
    f.post_process_request(req, *(None,)*extra_arg_count)
  File "build/bdist.linux-i686/egg/simpleticket/web_ui.py", line 31, in post_process_request
    data['fields'] = [f for f in data['fields'] if f['name'] in self.fields and f is not None]
TypeError: 'NoneType' object is unsubscriptable

Attachments (0)

Change History (10)

comment:1 Changed 12 months ago by giursino

  • Severity changed from normal to blocker

comment:2 Changed 12 months ago by giursino

I'm forgetting to say that my environment use inherit clause, that is:

environment configuration:

...
[inherit]
file = trac_global.ini
...

trac_global.ini:

...
[simpleticket]
show_only = true
fields = cc, component, severity, type, ver_from
...

comment:3 Changed 12 months ago by giursino

I've found that the problem is related to data variable, that is passed to function post_process_request with None value.

I've show that this function is called two times, the first works the second fail.

comment:4 Changed 12 months ago by giursino

Better, I found that, the second time that the function is called, data has not fields value in his array

comment:5 Changed 12 months ago by rjollos

I've reproduced the issue. Here is the full traceback:

08:41:53 PM Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "/home/user/Workspace/th11290/teo-rjollos.git/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/user/Workspace/th11290/teo-rjollos.git/trac/web/main.py", line 233, in dispatch
    content_type)
  File "/home/user/Workspace/th11290/teo-rjollos.git/trac/web/chrome.py", line 1027, in render_template
    encoding='utf-8')
  File "/home/user/Workspace/th11290/genshi.git/genshi/core.py", line 183, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/home/user/Workspace/th11290/genshi.git/genshi/output.py", line 58, in encode
    for chunk in iterator:
  File "/home/user/Workspace/th11290/genshi.git/genshi/output.py", line 350, in __call__
    for kind, data, pos in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/output.py", line 829, in __call__
    for kind, data, pos in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/output.py", line 669, in __call__
    for kind, data, pos in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/output.py", line 774, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/home/user/Workspace/th11290/genshi.git/genshi/output.py", line 594, in __call__
    for ev in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th11290/teo-rjollos.git/trac/web/chrome.py", line 1165, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th11290/teo-rjollos.git/trac/web/chrome.py", line 1154, in _generate
    for kind, data, pos in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/base.py", line 617, in _include
    for event in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/markup.py", line 379, in _match
    ctxt, start=idx + 1, **vars):
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/markup.py", line 379, in _match
    ctxt, start=idx + 1, **vars):
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/markup.py", line 327, in _match
    for event in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/base.py", line 557, in _flatten
    for kind, data, pos in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/base.py", line 617, in _include
    for event in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/base.py", line 557, in _flatten
    for kind, data, pos in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/base.py", line 617, in _include
    for event in stream:
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/base.py", line 577, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/base.py", line 289, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/home/user/Workspace/th11290/teo-rjollos.git/trac/ticket/templates/ticket_box.html", line 33, in <Expression u"'status' in fields_map and fields[fields_map['status']].rendered or ticket.status">
    ${'status' in fields_map and fields[fields_map['status']].rendered or ticket.status}
  File "/home/user/Workspace/th11290/genshi.git/genshi/template/eval.py", line 333, in lookup_item
    return obj[key]
IndexError: list index out of range

comment:6 Changed 12 months ago by rjollos

It appears that, at a minimum, the following fields are required: summary, reporter, owner, description, type, status. It makes sense that we much have a summary, reporter and type. The owner and status fields aren't shown on the interface, so I'm not sure why those are needed. Strictly speaking, we could get by without a description, and maybe a change to Trac could be made so that SimpleTicketPlugin can remove it.

Last edited 12 months ago by rjollos (previous) (diff)

comment:7 Changed 12 months ago by rjollos

In 13387:

Refs #11290: Perform some additional tests for variable existence, and don't remove required fields.

comment:8 Changed 12 months ago by rjollos

Please go ahead and close the ticket if your issue is resolved after [13387].

comment:9 Changed 12 months ago by rjollos

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

Please reopen if you continue to experience trouble with the plugin.

comment:10 Changed 11 months ago by anonymous

ok thanks

Add Comment

Modify Ticket

Action
as closed .
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.