Bug 824241 - Multicall queries trigger "Cannot locate object method _bug_to_hash" error
Multicall queries trigger "Cannot locate object method _bug_to_hash" error
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: python-bugzilla (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Will Woods
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-23 00:33 EDT by Luke Macken
Modified: 2013-03-22 17:17 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-03-22 17:17:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Luke Macken 2012-05-23 00:33:48 EDT
Using python-bugzilla-0.6.3-1.fc17

{'call': {'methodName': 'Bug.search',
          'params': [{'bug_status': ['CLOSED'],
                      'component': 'nethack',
                      'product': 'Fedora'}]},
 'error': 'Can\\'t locate object method "_bug_to_hash" via package "Bugzilla::Extension::RedHat::WebService::System" at Bugzilla/WebService/Bug.pm line 506.\\n'},
Comment 1 Luke Macken 2012-05-25 12:05:40 EDT
Seems to be an issue with multicall support.

>>> import bugzilla
>>> bz = bugzilla.Bugzilla(url='https://bugzilla.redhat.com/xmlrpc.cgi')
>>> mc = bz._multicall()
>>> mc._query({'product': 'Fedora', 'component': 'nethack', 'status': 'NEW'})
>>> print(mc.run())
[{'call': {'methodName': 'Bug.search', 'params': [{'status': 'NEW', 'product': 'Fedora', 'component': 'nethack'}]}, 'error': 'Can\'t locate object method "_bug_to_hash" via package "Bugzilla::Extension::RedHat::WebService::System" at Bugzilla/WebService/Bug.pm line 506.\n'}]
Comment 2 Luke Macken 2012-05-25 12:23:05 EDT
I can confirm that this is still an issue with the latest python-bugzilla in git as of today.
Comment 3 Don Zickus 2012-05-29 22:19:51 EDT
Hi Luke,

What is the command you are using?  I have a collection of fixes and want to verify they work with your test case.

Cheers,
Don
Comment 4 Luke Macken 2012-05-30 11:16:55 EDT
Hi Don,

I'm not quite sure what command you're asking about. The example in Comment #1 replicates the issue we're hitting with our Fedora Packages webapps. In the mean time, I have disabled our multicall queries until this is resolved.
Comment 5 Don Zickus 2012-05-30 11:43:19 EDT
(In reply to comment #4)
> Hi Don,
> 
> I'm not quite sure what command you're asking about. The example in Comment
> #1 replicates the issue we're hitting with our Fedora Packages webapps. In
> the mean time, I have disabled our multicall queries until this is resolved.

Ah, I see you have your own app but use the python-bugzilla library.  Sorry about that.  I am just used to seeing broken cli issues.

Curious, what are you using multi-call for that can't be done with an array?

Cheers,
Don
Comment 6 Luke Macken 2012-05-30 19:46:41 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > Hi Don,
> > 
> > I'm not quite sure what command you're asking about. The example in Comment
> > #1 replicates the issue we're hitting with our Fedora Packages webapps. In
> > the mean time, I have disabled our multicall queries until this is resolved.
> 
> Ah, I see you have your own app but use the python-bugzilla library.  Sorry
> about that.  I am just used to seeing broken cli issues.
> 
> Curious, what are you using multi-call for that can't be done with an array?

Here is the code for the multicall I'm making:

    https://fedorahosted.org/fedoracommunity/browser/fedoracommunity/connectors/bugzillaconnector.py?rev=a09789d639c1369230b5537fac52a8c76dd80cab#L93

which is used to generate stats for this widget:

    https://apps.fedoraproject.org/packages/python

Is there a more efficient way to do those? I'm not very pleased with that code, as I have to create a blacklist and skip the queries that count the number of new & closed bugs for things like the kernel, because the query times out.
Comment 7 Luke Macken 2012-12-07 12:08:17 EST
It now looks like multicall support is broken within python-bugzilla itself. python-bugzilla-0.7.0-2.fc18.noarch

>>> import bugzilla
>>> bz = bugzilla.Bugzilla(url='https://bugzilla.redhat.com/xmlrpc.cgi')
>>> mc = bz._multicall()
>>> mc._query({'product': 'Fedora', 'component': 'nethack', 'status': 'CLOSED'})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/bugzilla/rhbugzilla.py", line 582, in _query
    for bug in ret['bugs']:
TypeError: 'NoneType' object has no attribute '__getitem__'
Comment 8 Cole Robinson 2012-12-28 16:00:06 EST
All the multicall stuff has now been dropped upstream.

multicall originally existed to speed up multiple bug lookups using RH bugzilla's custom getbug call which could only handle one lookup at a time. RH bugzilla is dropping that old call soon, so python-bugzilla has switched to using the upstream Bug.get() API which can return multiple bugs at once

If bodhi or any other app is messing directly with the private rhbugzilla._multicall function, it will break when the next version of python-bugzilla comes out. Passing the multicall parameter to RHBugzilla.__init__() will not error however and just be a no-op

Granted, in a month, if python-bugzilla isn't updated, bodhi is going to be broken anyways. To be clear, I'm working on making sure python-bugzilla will work optimally with the RHBZ 4.4 upgrade
Comment 9 Fedora Update System 2013-02-16 10:21:43 EST
python-bugzilla-0.8.0-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-bugzilla-0.8.0-1.fc17
Comment 10 Fedora Update System 2013-03-04 17:18:29 EST
python-bugzilla-0.8.0-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-bugzilla-0.8.0-2.fc17
Comment 11 Fedora Update System 2013-03-05 18:20:47 EST
Package python-bugzilla-0.8.0-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-bugzilla-0.8.0-2.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3435/python-bugzilla-0.8.0-2.fc17
then log in and leave karma (feedback).
Comment 12 Fedora Update System 2013-03-22 17:17:04 EDT
python-bugzilla-0.8.0-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.