#12950 closed defect (fixed)
'Error loading tickets.'
Reported by: | ntmlod | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Component: | XmlRpcPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
I got this message just under the ticket summary but the scripts in question in the log are from XmlRpcPlugin
File "build/bdist.linux-x86_64/egg/tracrpc/web_ui.py", line 158, in _rpc_process result = (XMLRPCSystem(self.env).get_method(method_name)(req, args))[0] File "build/bdist.linux-x86_64/egg/tracrpc/api.py", line 197, in __call__ result = self.callable(req, *args) File "build/bdist.linux-x86_64/egg/tracrpc/search.py", line 60, in performSearch for result in source.get_search_results(req, query, filters): ServiceException: 'NoneType' object is not iterable
Attachments (0)
Change History (9)
comment:2 Changed 8 years ago by
Component: | DuplicateTicketSearchPlugin → XmlRpcPlugin |
---|---|
Owner: | changed from Ryan J Ollos to osimons |
That is a XmlRpcPlugin issue.
The get_search_results()
can return None
. Please try the following patch.
See also:
- trac:source:/tags/trac-1.0.13/trac/wiki/web_ui.py@:777-778#L776
- trac:source:/tags/trac-1.0.13/trac/search/web_ui.py@:213-214#L210
-
tracrpc/search.py
diff --git a/tracrpc/search.py b/tracrpc/search.py index aeba287..0c78321 100644
a b class SearchRPC(Component): 57 57 58 58 results = [] 59 59 for source in self.search_sources: 60 for result in source.get_search_results(req, query, filters) :60 for result in source.get_search_results(req, query, filters) or []: 61 61 results.append(['/'.join(req.base_url.split('/')[0:3]) 62 62 + result[0]] + list(result[1:])) 63 63 return results
comment:4 follow-up: 5 Changed 8 years ago by
In my testing I cannot actually get it to fail, so must be an explanation that I cannot understand or a set of circumstances that I cannot replicate.
What would be an example of a broken search.performSearch(query, filters)
call that I could test?
comment:5 Changed 8 years ago by
Replying to osimons:
In my testing I cannot actually get it to fail, so must be an explanation that I cannot understand or a set of circumstances that I cannot replicate.
What would be an example of a broken
search.performSearch(query, filters)
call that I could test?
Ah, sorry. I misunderstood. WikiModule.get_search_results()
never return None
because it uses yield
.
However, it seems DiscussionCore.get_search_results()
in DiscussionPlugin leads the issue. The module doesn't use yield
. See discussionplugin/1.0/tracdiscussion/core.py@15556:155-159#L155.
comment:6 Changed 8 years ago by
I see that the Trac search API is somewhat short on documentation, but it says: "Return a list of search results matching each search term in terms
."
All my plugins use iterators for all cases, but it looks like Trac is patched to handle None in addition to all iterators (including empty)?
If that is the case then I suppose RPC better to it too, and just gracefully handle "bugs" in other plugins... :-)
I forgot the revision numbers:
Also AccountManagerPlugin 0.4.4 (r13806) is enabled too but only the API component so the standard login module is still in operation.