Bug 961121 - Beakerlib 1.7 failing in Fedora 19
Beakerlib 1.7 failing in Fedora 19
Product: Fedora
Classification: Fedora
Component: beakerlib (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Muller
Fedora Extras Quality Assurance
: 966019 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2013-05-08 16:36 EDT by Scott Poore
Modified: 2016-09-19 22:09 EDT (History)
9 users (show)

See Also:
Fixed In Version: beakerlib-1.8-1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 971833 (view as bug list)
Last Closed: 2013-06-29 14:03:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Scott Poore 2013-05-08 16:36:08 EDT
Description of problem:

I'm seeing issues with beakerlib in Fedora 19.   

[root@f19-1 ~]# . /usr/share/beakerlib/beakerlib.sh
readlink: invalid option -- 'b'
Try 'readlink --help' for more information.

[root@f19-1 ~]# rlJournalStart
Traceback (most recent call last):
  File "/usr/bin/beakerlib-journalling", line 717, in <module>
  File "/usr/bin/beakerlib-journalling", line 655, in main
    return Journal.initializeJournal(options.test, options.package)
  File "/usr/bin/beakerlib-journalling", line 418, in initializeJournal
    return Journal.saveJournal(newdoc)
  File "/usr/bin/beakerlib-journalling", line 426, in saveJournal
  File "/usr/lib64/python2.7/xml/dom/minidom.py", line 46, in toxml
    return self.toprettyxml("", "", encoding)
  File "/usr/lib64/python2.7/xml/dom/minidom.py", line 61, in toprettyxml
    return writer.getvalue()
  File "/usr/lib64/python2.7/StringIO.py", line 271, in getvalue
    self.buf += ''.join(self.buflist)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)
rlJournalStart: Failed to initialize the journal. Bailing out...

I'm seeing this when I'm trying to setup a server to run IPA related tests, so the server was a minimal install and then freeipa-server (and all of it's dependencies) were installed.

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1.  install f19 to a VM on local desktop from Alpha release ISO here:

2. select minimal install with no other software selections
3. yum -y install freeipa-server
4. yum -y update --enablerepo=updates-testing 
5. . /usr/share/beakerlib/beakerlib.sh
6. rlJournalStart
Actual results:

errors seen as shown above.

Expected results:

sourcing in beakerlib.sh at step 5 should not throw an error.

rlJournalStart should not throw an error either.  inst

Additional info:

I'm not sure what logs or other output to provide but, will gladly add that if needed.  

Could this be a result of me just missing some rpm?

Comment 1 Petr Muller 2013-05-09 11:35:13 EDT
The second problem is caused by the umlaut in F19 release name (Schroedinger), which is not ASCII-sanitized after fetch. I have a fix for that in koji and prepared for update: http://koji.fedoraproject.org/koji/buildinfo?buildID=417846

The first issue puzzles me, though. I can see no such usage anywhere in beakerlib. I do not see the issue on my F19, too. Can you confirm that there is no plugin (which are sourced too when you source in beakerlib), i.e. there are no files in /usr/share/beakerlib/plugins/ ?
Comment 2 Scott Poore 2013-05-15 22:09:52 EDT
Tested the update from koji and it looks like it fixed my problem.  I don't see it in bohdi to give karma though.

As for the first error:

in /usr/share/beakerlib/beakerlib.sh:
export BEAKERLIB=${BEAKERLIB:-"/usr/share/beakerlib"}
. $BEAKERLIB/libraries.sh


[root@f19-1 beakerlib]# . $BEAKERLIB/libraries.sh
readlink: invalid option -- 'b'
Try 'readlink --help' for more information.

So, looks like my issue is  in /usr/share/beakerlib/libraries.sh

Then from there., I see this when manually testing:

[root@f19-1 beakerlib]# SOURCE="$(readlink -f $0)"
readlink: invalid option -- 'b'
Try 'readlink --help' for more information.

[root@f19-1 beakerlib]# readlink -f $0
readlink: invalid option -- 'b'
Try 'readlink --help' for more information.

[root@f19-1 beakerlib]# echo $0

[root@f19-1 beakerlib]# bash

[root@f19-1 beakerlib]# echo $0

[root@f19-1 beakerlib]# readlink -f $0

[root@f19-1 beakerlib]#  . $BEAKERLIB/libraries.sh
[root@f19-1 beakerlib]# 

So, a difference in how the shell is executed by ssh maybe?
Comment 3 Petr Muller 2013-05-23 07:53:40 EDT
*** Bug 966019 has been marked as a duplicate of this bug. ***
Comment 4 Scott Poore 2013-05-30 13:57:41 EDT
So, any word on when this will hit F19?
Comment 5 Miroslav Franc 2013-06-06 08:04:28 EDT
(In reply to Scott Poore from comment #2)

I seems like beakerlib is trying to find out where the script which uses it is located.  If you source commands in the current shell $0 will contain name of the shell (instead of name of the script, since there's no script).  In case of login shell the name is prefixed by '-'.  But it does not make sense to run readlink on it anyway.  I guess beakerlib should detect this as a special case.  I often test things within the current shell as well.
Comment 6 Petr Muller 2013-06-07 07:17:01 EDT
Thanks for the hint, Mirek! I shall modify the code so that the readlink arg is checked for existence, that should be enough.
Comment 8 Miroslav Franc 2013-06-07 07:48:38 EDT
(In reply to Petr Muller from comment #6)
> Thanks for the hint, Mirek! I shall modify the code so that the readlink arg
> is checked for existence, that should be enough.

Be aware that you can easily get:

# echo $0

Especially when running things in screen or similar.
Comment 9 Petr Muller 2013-06-07 09:21:05 EDT
Yeah. But the library search code is just a bunch of attempts, and the "traverse upwards from the script location" is just the last of them. It should not be harmful in any way.
Comment 10 Fedora Update System 2013-06-10 08:16:03 EDT
beakerlib-1.8-1.fc19 has been submitted as an update for Fedora 19.
Comment 11 Petr Muller 2013-06-10 09:18:28 EDT
Sorry this took so long.
Comment 12 Fedora Update System 2013-06-10 10:38:47 EDT
Package beakerlib-1.8-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.8-1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 13 Fedora Update System 2013-06-29 14:03:25 EDT
beakerlib-1.8-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 14 Petr Muller 2013-07-23 11:16:19 EDT
*** Bug 987100 has been marked as a duplicate of this bug. ***

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