Edgewall Software
Modify

Opened 9 years ago

Last modified 14 months ago

#12458 new defect

TypeError: coercing to Unicode: need string or buffer, NoneType found

Reported by: Jun Omae Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: ticket system Version: 1.0.10
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

It seems that this issue occurs when timeline view shows th:#12742 which has blank summary.

How to Reproduce

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

Request parameters:

{}

User agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0

System Information

Trac 1.0.10
Babel 2.1.1
dnspython 1.12.0
Docutils 0.12
FullBlog 0.1.5
Genshi 0.6 (without speedups)
httplib2 0.9.2
mod_wsgi 4.3.0 (WSGIProcessGroup /srv/trac-hacks.org WSGIApplicationGroup %{GLOBAL})
Pillow 3.0.0
psycopg2 2.6.1
Pygments 2.1
Python 2.7.9 (default, Mar 1 2015, 13:01:26)
[GCC 4.9.2]
python-oauth2 1.9.0.post1
pytz 2015.7
RPC 1.1.5
setuptools 20.2.2
SpamBayes 1.1b2
Subversion 1.8.10 (r1615264)
jQuery 1.7.2
jQuery UI 1.8.21
jQuery Timepicker 1.0.1

Enabled Plugins

BlogDraftPlugin N/A
ChangeLogMacro 0.4.dev0
EmailProcessor r10962
FootNoteMacro 1.5
SvnAuthzAdminPlugin 1.0.dev0
TracAccountManager 0.5.dev0
TracAcronyms 0.2
TracAutoWikify 0.2
TracExtractUrl 0.3
TracFullBlogPlugin 0.1.5
TracHacks 3.0.1.dev0
TracIncludeMacro 3.0.0.dev0
TracIniAdminPanel 1.0.1
TracNewsFlash 1.0.2
TracPoll 0.3.0.dev0
TracServerSideRedirectPlugin 1.0.0
TracSpamFilter 1.0.9.dev0
TracTags 0.9.dev0
TracTocMacro 11.0.0.5
TracVote 0.5.1.dev0
TracWikiExtras 1.0.dev0
TracXMLRPC 1.1.5

Python Traceback

Traceback (most recent call last):
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/web/main.py", line 554, in _dispatch_request
    dispatcher.dispatch(req)
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/web/main.py", line 267, in dispatch
    iterable=chrome.use_chunked_encoding)
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/web/chrome.py", line 1114, in render_template
    encoding='utf-8')
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 183, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/output.py", line 58, in encode
    for chunk in iterator:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/output.py", line 339, in __call__
    for kind, data, pos in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/output.py", line 826, in __call__
    for kind, data, pos in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/output.py", line 670, in __call__
    for kind, data, pos in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/output.py", line 771, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/output.py", line 586, in __call__
    for ev in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/web/chrome.py", line 1309, in _generate
    for kind, data, pos in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 686, in _unmark
    for mark, event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 1145, in __call__
    for mark, event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 714, in __call__
    for mark, event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 682, in _mark
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 686, in _unmark
    for mark, event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 1081, in __call__
    for mark, event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 117, in __iter__
    event = self.stream.next()
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 714, in __call__
    for mark, event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/filters/transform.py", line 682, in _mark
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/markup.py", line 327, in _match
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/base.py", line 565, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/base.py", line 277, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/timeline/templates/timeline.html", line 59, in <Expression u"event.render('title', context)">
    <span class="time">${format_time(event.date, 'short')}</span> ${event.render('title', context)}
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/timeline/web_ui.py", line 366, in <lambda>
    provider.render_timeline_event(context, field, event)
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/ticket/web_ui.py", line 394, in render_timeline_event
    resolution, type)
  File "/srv/trac-hacks.org/pve/lib/python2.7/site-packages/trac/ticket/api.py", line 576, in format_summary
    summary = type + ': ' + summary
TypeError: coercing to Unicode: need string or buffer, NoneType found

Attachments (0)

Change History (10)

comment:1 by Jun Omae, 9 years ago

Reporter: changed from jun66j5 to Jun Omae

comment:2 by Ryan J Ollos, 9 years ago

I deleted the ticket using trac-admin. I wonder how it was possible to create the ticket without a summary.

comment:3 by Jun Omae, 9 years ago

Ticket without a summary can be created using ticket.create via https://trac-hacks.org/jsonrpc.

The validation for summary field is implemented in source:/tags/trac-1.0.10/trac/ticket/web_ui.py@:1250-1253#L1250. Ticket model doesn't have the same validation.

comment:4 by Ryan J Ollos, 9 years ago

I was thinking that we only allowed authenticated users to create tickets through xml-rpc on trac-hacks.org, but that's not the case. I created th:#12749.

Last edited 8 years ago by Ryan J Ollos (previous) (diff)

comment:5 by Rick van Hattem <wolph@…>, 8 years ago

Is there any reason the summary column is nullable if the code actually expects the summary to be non-null?

in reply to:  5 comment:6 by Ryan J Ollos, 8 years ago

Replying to Rick van Hattem <wolph@…>:

Is there any reason the summary column is nullable if the code actually expects the summary to be non-null?

It appears all 3 database backends support NOT NULL for columns in the schema. I've heard differing opinions on whether such enforcement should be done in the model or schema. Making a change at this time might break a lot of unit tests in plugins, and we can just as well fix this particular issue in XmlRpcPlugin.

I think any change to the model or schema would best be done in the scope of a major refactoring of the application, like suggested in comment:15:ticket:10125. I've documented this particular issue in TracDev/ScratchPad/DataModels@3#NOTNULLcolumns.

Last edited 8 years ago by Ryan J Ollos (previous) (diff)

comment:7 by Ryan J Ollos, 8 years ago

Milestone: next-stable-1.0.xnext-stable-1.2.x

Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.

comment:8 by Jun Omae, 5 years ago

I just encountered the same issue via th:TicketImportPlugin on Trac 1.0.x.

comment:9 by Ryan J Ollos, 5 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:10 by Ryan J Ollos, 14 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.