Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1691310 - xmlrpc Bug.create sometimes fails with Fault 101: Bug does not exist.
Summary: xmlrpc Bug.create sometimes fails with Fault 101: Bug does not exist.
Keywords:
Status: NEW
Alias: None
Product: Bugzilla
Classification: Community
Component: Creating/Changing Bugs
Version: 5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: 5.0-RH5
Assignee: PnT DevOps Devs
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-21 11:31 UTC by Martin Malina
Modified: 2019-03-26 04:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Martin Malina 2019-03-21 11:31:29 UTC
Description of problem:
Sometimes when we create a bug with our script, it fails with:
Fault 101: Bug does not exist.

It seems that inside the xmlrpc call of Bug.create, the bug is created, but then the server fails to retrieve the just created bug to return it.

The full log is here:
http://post-office.corp.redhat.com/archives/pnt-devops-e2e/2019-March/msg00386.html

Some lines from the log:
  File "./create_bug.py", line 161, in bug_create
    self._bug = self.bugzilla.createbug(bug_data)
  File "/usr/lib/python3.6/site-packages/bugzilla/base.py", line 1741, in createbug
    rawbug = self._proxy.Bug.create(data)
  File "/usr/lib64/python3.6/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
...
  File "/usr/lib64/python3.6/xmlrpc/client.py", line 656, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 101: 'Bug #1690639 does not exist.'>

Here's our code:
https://gitlab.cee.redhat.com/rad/rad-release-e2e-test-scripts/blob/master/create_bug.py#L140

We use python-bugzilla and here's the relevant snippet:
https://github.com/python-bugzilla/python-bugzilla/blob/master/bugzilla/base.py#L1747


Version-Release number of selected component (if applicable):
Python 3.6.8
python-bugzilla==2.2.0

How reproducible:
It's quite simple to reproduce what we do, but unfortunately the failure occurs
only in a small percentage of cases for us.
Last month it happened for about 2% of our created bugs (we create around 15-20 bugs a day). This month it's less common, but it still happened a couple of times.
Also, at least in the last month, we only saw this issue in prod bugzilla instance, not in partner bugzilla where we also create bugs regularly.

Steps to Reproduce:
1. Create a bug in prod bugzilla using python-bugzilla

Actual results:
Most of the time it's ok, but from time to time this fails with bug not found.

Expected results:
It works every time.

Additional info:
Here's a simple script to replicate what we do. To use it, install python-bugzilla (pip3 install python-bugzilla) and then run is like this:
E2E_BUGZILLA_USER='example@redhat.com' E2E_BUGZILLA_PWD='pass' python3 create_simple_bug.py . I could run this in a loop and eventually I could see it fail, but I don't want to polute BZ with too many bugs. Please let me know if you need help trying to replicate this.

import bugzilla
import os

user = os.environ['E2E_BUGZILLA_USER']
pwd = os.environ['E2E_BUGZILLA_PWD']

bugzilla = bugzilla.Bugzilla(
                url='https://bugzilla.redhat.com/xmlrpc.cgi',
                user=user,
                password=pwd,
                cookiefile=None, tokenfile=None)

bug_data = {
            'product': 'Release End2End Test',
            'component': 'releng',
            'version': 'unspecified',
            'description': 'This is a test bug to ensure proper operation of our release infrastructure.',
            'summary': 'Automated e2e testing bug: test run #0',
            'groups': 'private',
            'keywords': ['Rebase'],
        }

bug = bugzilla.createbug(bug_data)
print('Created bug: {}'.format(bug.id))


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