Bug 986389

Summary: python-bugzilla url_to_query aborts on url containing 'cmdtype=...' - Server error: <Fault 53: 'cmdtype is not a valid parameter for the Bugzilla::Bug::match function.'>
Product: [Fedora] Fedora Reporter: Frantisek Reznicek <freznice>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: bugs.michael, crobinso, dzickus, esammons, freznice, jskarvad, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-25 13:53:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frantisek Reznicek 2013-07-19 16:14:38 UTC
Description of problem:

python-bugzilla has feature to select bugs using web bugzilla URL.
This feature does not work (aborts) when URL contains cmdtype=

# bugzilla query  --from-url='https://bugzilla.redhat.com/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=mrgm-3.0.0-all&sharer_id=211011'

Server error: <Fault 53: 'cmdtype is not a valid parameter for the Bugzilla::Bug::match function.'>


Version-Release number of selected component (if applicable):
both python-bugzilla-0.9.0-1.el6.noarch and python-bugzilla-0.8.0-2.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. bugzilla query  --from-url='https://bugzilla.redhat.com/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=mrgm-3.0.0-all&sharer_id=211011'

Actual results:
URL to query useless for some queries.

Expected results:
URL to query should be functional.

Additional info:

Traceback from bzps.py tool:
python ./bzps.py --mode-alllists --bz-query-csv-summary-ena --bz-query-csv-save_fn=result.csv --bz-query-url 'https://bugzilla.redhat.com/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=mrgm-3.0.0-all&sharer_id=211011'
INFO:bugzilla:Connecting to https://bugzilla.redhat.com/xmlrpc.cgi
INFO:bugzilla:Bugzilla v0.9.0 initializing
INFO:bugzilla:Using RHBugzilla for URL containing bugzilla.redhat.com
INFO:bugzilla:Chose subclass RHBugzilla v0.1
INFO:bugzilla:Bugzilla query in progress.
Traceback (most recent call last):
  File "./bzps.py", line 1295, in <module>
    main(int_opts);
  File "./bzps.py", line 671, in main
    bzquery_out = bz.query(bzquery_in);
  File "/usr/lib/python2.6/site-packages/bugzilla/base.py", line 925, in query
    r = self._query(query)
  File "/usr/lib/python2.6/site-packages/bugzilla/base.py", line 915, in _query
    return self._proxy.Bug.search(query)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/site-packages/bugzilla/base.py", line 166, in request
    return self.parse_response(stringio)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1361, in parse_response
    return self._parse_response(file, None)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 53: 'cmdtype is not a valid parameter for the Bugzilla::Bug::match function.'>

Comment 1 Cole Robinson 2013-07-23 19:04:55 UTC
How did you generate that search URL in the bugzilla web UI?

Comment 2 Frantisek Reznicek 2013-07-25 12:19:14 UTC
(In reply to Cole Robinson from comment #1)
> How did you generate that search URL in the bugzilla web UI?

Very good question, I took it from MRG meeting minutes, so I do not know how it was generated.

Comment 3 Frantisek Reznicek 2013-07-25 12:21:27 UTC
The obvious workaround is to use the URL, go 'edit search' change nothing and return to that bug-list with much longer BZ URL query which is functional as far as I checked.

Comment 4 Frantisek Reznicek 2013-07-25 12:24:25 UTC
(In reply to Cole Robinson from comment #1)
> How did you generate that search URL in the bugzilla web UI?

Actually I figured it out, using Bugzilla Web UI clicking on 'Remember Search' + providing custom bug-list name

Comment 5 Cole Robinson 2013-07-25 13:53:02 UTC
Thanks for the info Frantisek. Looking at the docs, seems like the bugzilla xmlrpc interface does not provide a way to access saved searches. So the only way around this is to resolve the saved search with a browser like you mentioned, then copy that full URL to the command line.