Bug 1405986 - beaker-wizard fails when parsing attachments from Bugzilla 5: KeyError: 'description'
Summary: beaker-wizard fails when parsing attachments from Bugzilla 5: KeyError: 'desc...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Beaker
Classification: Retired
Component: wizard
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: beaker-dev-list
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-19 12:35 UTC by Lukáš Zachar
Modified: 2017-03-28 07:33 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-28 07:33:30 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1422385 0 unspecified CLOSED beaker-wizard fails with python-bugzilla 2.0: AttributeError: Bug object has no attribute 'attachments' 2021-02-22 00:41:40 UTC

Internal Links: 1422385

Description Lukáš Zachar 2016-12-19 12:35:57 UTC
Description of problem:
beaker-wizard is not able to download attachments from Bugzilla 5.

Version-Release number of selected component (if applicable):
beaker-client-23.3-1.el7sed.noarch
python-bugzilla-1.2.2-1.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Modify wizard.py:
BugzillaUrl = 'https://beta.bugzilla.redhat.com/show_bug.cgi?id='
BugzillaXmlrpc = 'https://beta.bugzilla.redhat.com/bugzilla/xmlrpc.cgi'

2. beaker-wizard -b 1361348

Actual results:
Fetching details for BZ#1361348
Examining attachments for possible reproducers
Traceback (most recent call last):
  File "/usr/bin/beaker-wizard", line 9, in <module>
    load_entry_point('bkr.client==23.3', 'console_scripts', 'beaker-wizard')()
  File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 3064, in main
    test = Test(options)
  File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1130, in __init__
    self.init()
  File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 2734, in init
    self.testname = Name(self.options)
  File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1130, in __init__
    self.init()
  File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1941, in init
    self.bugs.fetchBugDetails()
  File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1866, in fetchBugDetails
    self.reproducers.find(self.bug)
  File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 2013, in find
    if RegExpReproducer.search(attachment['description']) or \
KeyError: 'description'


Expected results:
Downloads relevant attachments

Additional info:
Randomly picked attachment can be downloaded using python-bugzilla 
$ bugzilla --bugzilla=https://beta.bugzilla.redhat.com/bugzilla/xmlrpc.cgi attach --get 1211410
Wrote error-2016-12-19.html

Comment 1 Dan Callaghan 2017-02-23 16:00:30 UTC
Maybe fix/test at the same time as bug 1422385.

Comment 2 Dan Callaghan 2017-02-24 13:45:46 UTC
Seems like Bugzilla 5 beta moved to https://beta-bugzilla.redhat.com/ (not beta.bugzilla.redhat.com).

Comment 4 Dan Callaghan 2017-02-24 14:25:12 UTC
After hacking beaker-wizard to point at beta-bugzilla.redhat.com and skip cert validation, I can't actually reproduce this problem... Neither with python-bugzilla 1.2.2, nor with python-bugzilla 2.0 and a corresponding fix (bug 1422385).

So I am wondering if this was just an issue on the Bugzilla side (not returning attachment descriptions) which has now been fixed?

Comment 5 Lukáš Zachar 2017-02-24 17:41:12 UTC
Hm, I have different error now (rhel-7.3):
python-bugzilla-1.2.2-1.el7.noarch
beaker-client-24.0-1.el7sed.noarch

Changes:

BugzillaUrl = 'https://beta-bugzilla.redhat.com/show_bug.cgi?id='
BugzillaXmlrpc = 'https://beta-bugzilla.redhat.com/bugzilla/xmlrpc.cgi'
self.bugzilla = Bugzilla(url=BugzillaXmlrpc, sslverify=False)

Contacting bugzilla...
Fetching details for BZ#1361348
/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
Sorry, could not get details for 1361348
no element found: line 1, column 0

Comment 6 Dan Callaghan 2017-02-24 17:48:47 UTC
(In reply to Lukas Zachar from comment #5)
> BugzillaXmlrpc = 'https://beta-bugzilla.redhat.com/bugzilla/xmlrpc.cgi'

Shouldn't this be:

BugzillaXmlrpc = 'https://beta-bugzilla.redhat.com/xmlrpc.cgi'

with /bugzilla/ ?

Comment 7 Dan Callaghan 2017-02-24 17:49:53 UTC
I mean, without /bugzilla/.

Comment 8 Ales Zelinka 2017-03-15 09:35:30 UTC
Lukas, can you please check if this is still an issue? Thank you

Comment 9 Lukáš Zachar 2017-03-15 10:10:53 UTC
(In reply to Dan Callaghan from comment #7)
> I mean, without /bugzilla/.

Indeed, well, /bugzilla/ used to be required in the past.  Sorry for ignoring your reply for such long time.

Good news is that works with 
python-bugzilla-1.2.2-1.el7.noarch
beaker-client-24.1-1.el7sed.noarch

(even without sslverify=False)

Comment 10 Dan Callaghan 2017-03-28 07:33:30 UTC
Okay great, closing this under the assumption it was a temporary glitch with our deployment of Bugzilla 5 beta.


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