Bug 1142535 - [regression] "rlJournalStart: Failed to initialize the journal. Bailing out..." on RHEL5
Summary: [regression] "rlJournalStart: Failed to initialize the journal. Bailing out.....
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: beakerlib
Version: el5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Dalibor Pospíšil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-17 01:23 UTC by Jun'ichi NOMURA
Modified: 2014-12-18 00:26 UTC (History)
11 users (show)

Fixed In Version: beakerlib-1.10-1.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-17 05:34:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
a naive workaround patch (648 bytes, patch)
2014-09-17 05:15 UTC, Jun'ichi NOMURA
no flags Details | Diff
patch (1.67 KB, patch)
2014-09-19 06:37 UTC, Dan Callaghan
no flags Details | Diff
patch (1.71 KB, patch)
2014-09-19 07:22 UTC, Dan Callaghan
no flags Details | Diff

Description Jun'ichi NOMURA 2014-09-17 01:23:18 UTC
Description of problem:
  rlJournalStart fails to initialize journal on RHEL5.
  As a result, test programs which use beakerlib fail.

Version-Release number of selected component (if applicable):
  beah-0.7.6-1.el5
  beakerlib-1.9-4.el5
  rpm-python-4.4.2.3-34.el5

How reproducible:
  Always

Steps to Reproduce:
  Run this from shell:
    . /usr/share/beakerlib/beakerlib.sh
    rlJournalStart

Actual results:
  # . /usr/share/beakerlib/beakerlib.sh 
  # rlJournalStart
  Traceback (most recent call last):
    File "/usr/bin/beakerlib-journalling", line 861, in ?
      sys.exit(main())
    File "/usr/bin/beakerlib-journalling", line 794, in main
      return Journal.initializeJournal(options.test, package)
    File "/usr/bin/beakerlib-journalling", line 397, in initializeJournal
      beakerlib_redhat_rpm = mi.next()
  StopIteration
  rlJournalStart: Failed to initialize the journal. Bailing out...

Expected results:
  rlJournalStart should not crash.

Additional info:
  Package "beakerlib-redhat" does not exist in our lab.

  The problem wasn't observed on newer distros (RHEL6, RHEL7).
  So this could be due to behavior change in rpm-python that the harness has to care about.

  # python
  Python 2.4.3 (#1, Oct 23 2012, 22:02:41) 
  [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import rpm
  >>> ts = rpm.ts()
  >>> mi = ts.dbMatch("name", "beakerlib")
  >>> print mi
  <rpm.mi object at 0x2b06cc618300>
  >>> print "%(name)s-%(version)s-%(release)s " % mi.next()
  beakerlib-1.9-4.el5 
  >>> mi = ts.dbMatch("name", "beakerlib-redhat")
  >>> print mi
  <rpm.mi object at 0x2b06cc6182d8>
  >>> print "%(name)s-%(version)s-%(release)s " % mi.next()
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  StopIteration

Comment 1 Jun'ichi NOMURA 2014-09-17 05:15:41 UTC
Created attachment 938333 [details]
a naive workaround patch

Just in case, attached is a naive workaround.

# . /usr/share/beakerlib/beakerlib.sh
# rlJournalStart
# rlJournalPrint
...
	<beakerlib_rpm>
		beakerlib-1.9-4.el5 
	</beakerlib_rpm>
	<beakerlib_redhat_rpm>
		not installed
	</beakerlib_redhat_rpm>
...

Comment 2 Dan Callaghan 2014-09-19 06:36:35 UTC
(In reply to Jun'ichi NOMURA from comment #0)
>   The problem wasn't observed on newer distros (RHEL6, RHEL7).
>   So this could be due to behavior change in rpm-python that the harness has
> to care about.

Yes, it looks like the rpm.mi type grew bool coercion in rpm 4.8.1 (RHEL6+):

http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=9a93c9364d15cb569c6c9492be9ed992d28a3fc3

Easiest fix would be to just check the len() of the rpm.mi objects instead of relying on bool coercion. Patch to come.

Comment 3 Dan Callaghan 2014-09-19 06:37:35 UTC
Created attachment 939101 [details]
patch

Haven't verified this patch yet.

Comment 4 Dan Callaghan 2014-09-19 07:00:41 UTC
Actually I just found this patch which changes a len() to .count(), I guess because some (even older?) versions of RPM don't support len() on rpm.mi either?

https://git.fedorahosted.org/cgit/beakerlib.git/commit/?id=f38e47bd18676b87db9aecbe878954b6896b569a

Comment 5 Dan Callaghan 2014-09-19 07:03:34 UTC
rpm.mi only added len() support in RPM 4.8.0 as well.

http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=909982b1b5d2bccbf28ecfb38064ab86e09d4523

Comment 6 Dan Callaghan 2014-09-19 07:22:02 UTC
Created attachment 939109 [details]
patch

Second attempt at a patch, still haven't verified it.

Corresponding test package is here:
https://fedorapeople.org/~dcallagh/beakerlib-1.9-4.el5.bz1142535test.noarch.rpm

Comment 7 Jun'ichi NOMURA 2014-09-19 08:27:23 UTC
(In reply to Dan Callaghan from comment #6)
> Corresponding test package is here:
> https://fedorapeople.org/~dcallagh/beakerlib-1.9-4.el5.bz1142535test.noarch.
> rpm

Thanks, I tried the test package and it works for me.

Except from journal.xml:
  <BEAKER_TEST>
    <test_id>1155290</test_id>
    <package>distribution</package>
    <pkgnotinstalled>distribution</pkgnotinstalled>
    <beakerlib_rpm>beakerlib-1.9-4.el5.bz1142535test </beakerlib_rpm>
    <beakerlib_redhat_rpm>not installed</beakerlib_redhat_rpm>
    ..

Comment 9 Fedora Update System 2014-10-06 15:05:31 UTC
beakerlib-1.9-5.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/beakerlib-1.9-5.el5

Comment 10 Fedora Update System 2014-10-08 18:04:17 UTC
beakerlib-1.9-6.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/beakerlib-1.9-6.el5

Comment 11 Fedora Update System 2014-12-01 15:54:07 UTC
beakerlib-1.10-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/beakerlib-1.10-1.el5

Comment 12 Fedora Update System 2014-12-17 05:34:54 UTC
beakerlib-1.10-1.el5 has been pushed to the Fedora EPEL 5 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.