Bug 824241 - Multicall queries trigger "Cannot locate object method _bug_to_hash" error
Summary: Multicall queries trigger "Cannot locate object method _bug_to_hash" error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-bugzilla
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Will Woods
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-23 04:33 UTC by Luke Macken
Modified: 2016-09-20 02:43 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-03-22 21:17:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Luke Macken 2012-05-23 04:33:48 UTC
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 16:05:40 UTC
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 16:23:05 UTC
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-30 02:19:51 UTC
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 15:16:55 UTC
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 15:43:19 UTC
(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 23:46:41 UTC
(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 17:08:17 UTC
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 21:00:06 UTC
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 15:21:43 UTC
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 22:18:29 UTC
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 23:20:47 UTC
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 21:17:04 UTC
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.