Bug 1456869 - TaskotronError: Some packages are not installed. Please run "dnf install rpm-python" to install all required packages.
Summary: TaskotronError: Some packages are not installed. Please run "dnf install rpm-...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libtaskotron
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora QA Tools SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-30 14:59 UTC by Miro Hrončok
Modified: 2017-06-13 13:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-13 13:24:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2017-05-30 14:59:59 UTC
Description of problem:
When I run taskotron locally (using tox from [1]), it shouts on me I need rpm-python:

Version-Release number of selected component (if applicable):
libtaskotron-0.4.20-1.fc26.noarch

[libtaskotron] 14:33:46 INFO    Execution started at: 2017-05-30 14:33:46 UTC
[libtaskotron] 14:33:46 DEBUG   Using libtaskotron 0.4.20
[libtaskotron] 14:33:46 DEBUG   Parsed arguments: Namespace(arch='noarch', debug=False, item='python-twine-1.8.1-3.fc26', jobid='-1', libvirt=False, local=False, no_destroy=False, override=[], patch=None, ssh=None, ssh_privkey=None, task='runtask.yml', type='koji_build', uuid='20170530_143346_886492')
[libtaskotron] 14:33:46 DEBUG   Using config file: /etc/taskotron/taskotron.yaml
[libtaskotron] 14:33:46 DEBUG   Using config profile: development
[libtaskotron] 14:33:46 INFO    Task artifacts will be saved in: /var/lib/taskotron/artifacts/20170530_143346_886492
[libtaskotron] 14:33:46 INFO    Checking installed state of 1 packages...
[libtaskotron] 14:33:47 WARNING No DNF cache available, metadata will be need to be downloaded. If your DNF cache doesn't persist across task executions (e.g. on a disposable VM), consider creating the cache in your base system image to speed up execution.
[libtaskotron] 14:33:47 CRITICAL Traceback (most recent call last):
  File "/usr/bin/runtask", line 11, in <module>
    load_entry_point('libtaskotron==0.4.20', 'console_scripts', 'runtask')()
  File "/usr/lib/python2.7/site-packages/libtaskotron/main.py", line 156, in main
    overlord.start()
  File "/usr/lib/python2.7/site-packages/libtaskotron/overlord.py", line 96, in start
    runner.execute()
  File "/usr/lib/python2.7/site-packages/libtaskotron/executor.py", line 60, in execute
    self._prepare_task()
  File "/usr/lib/python2.7/site-packages/libtaskotron/executor.py", line 77, in _prepare_task
    % " ".join([pipes.quote(rpm) for rpm in rpms]))
TaskotronError: Some packages are not installed. Please run "dnf install rpm-python" to install all required packages.


This is of course not true, as no such package exists on Fedora 26, but I have the thing that provides it:

$ LANG=C.utf8 sudo dnf install rpm-python
Package python2-rpm-4.13.0.1-4.fc26.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

The package is specified in the runtask section:

    environment:
        rpm:
            - rpm-python

But when I change it to:

    environment:
        rpm:
            - python2-rpm

It sill tracebacks:

TaskotronError: Some packages are not installed. Please run "dnf install python2-rpm" to install all required packages.

$ rpm -q python2-rpm
python2-rpm-4.13.0.1-4.fc26.x86_64

I believe rpm_utils.is_installed() is broken. Also I was curious that "sudo dnf install rpm-python" actually fixed the problem for a while and I realized it's the sudo that fixes it. I.e. when I run "sudo echo" and enter the password, the code in rpm_utils.is_installed() goes into the os_utils.has_sudo() condition and uses sudo and that fixes the problem.

I've examined the problem further. Running with --debug:

[libtaskotron] 14:49:31 INFO    Execution started at: 2017-05-30 14:49:31 UTC
[libtaskotron] 14:49:31 DEBUG   Using libtaskotron 0.4.20
[libtaskotron] 14:49:31 DEBUG   Parsed arguments: Namespace(arch='noarch', debug=True, item='python-twine-1.8.1-3.fc26', jobid='-1', libvirt=False, local=False, no_destroy=False, override=[], patch=None, ssh=None, ssh_privkey=None, task='runtask.yml', type='koji_build', uuid='20170530_144931_095987')
[libtaskotron] 14:49:31 DEBUG   Using config file: /etc/taskotron/taskotron.yaml
[libtaskotron] 14:49:31 DEBUG   Using config profile: development
[libtaskotron:logger.py:182] 2017-05-30 14:49:31 DEBUG   Stream logging enabled with level: DEBUG
[libtaskotron:overlord.py:38] 2017-05-30 14:49:31 DEBUG   Found task: dist.python-versions
[libtaskotron:overlord.py:90] 2017-05-30 14:49:31 INFO    Task artifacts will be saved in: /var/lib/taskotron/artifacts/20170530_144931_095987
[libtaskotron:overlord.py:74] 2017-05-30 14:49:31 DEBUG   Execution mode: local
[libtaskotron:rpm_utils.py:184] 2017-05-30 14:49:31 INFO    Checking installed state of 1 packages...
[libtaskotron:os_utils.py:37] 2017-05-30 14:49:31 DEBUG   Deciding whether we have a password-less sudo access. Running: sudo --validate --non-interactive
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 861, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 465, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 329, in getMessage
    msg = msg % self.args
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 11: ordinal not in range(128)
Logged from file os_utils.py, line 43
[libtaskotron:rpm_utils.py:229] 2017-05-30 14:49:31 DEBUG   Deciding whether DNF cache is available. Running: dnf --cacheonly repolist
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 861, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 465, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 329, in getMessage
    msg = msg % self.args
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 19: ordinal not in range(128)
Logged from file rpm_utils.py, line 234
[libtaskotron:rpm_utils.py:191] 2017-05-30 14:49:31 WARNING No DNF cache available, metadata will be need to be downloaded. If your DNF cache doesn't persist across task executions (e.g. on a disposable VM), consider creating the cache in your base system image to speed up execution.
[libtaskotron:os_utils.py:37] 2017-05-30 14:49:31 DEBUG   Deciding whether we have a password-less sudo access. Running: sudo --validate --non-interactive
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 861, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 465, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 329, in getMessage
    msg = msg % self.args
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 11: ordinal not in range(128)
Logged from file os_utils.py, line 43
[libtaskotron:rpm_utils.py:198] 2017-05-30 14:49:31 DEBUG   Running: dnf --assumeno --disableplugin=noroot install rpm-python
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 861, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 465, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 329, in getMessage
    msg = msg % self.args
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 14: ordinal not in range(128)
Logged from file rpm_utils.py, line 203
[libtaskotron:logger.py:88] 2017-05-30 14:49:32 CRITICAL Traceback (most recent call last):
  File "/usr/bin/runtask", line 11, in <module>
    load_entry_point('libtaskotron==0.4.20', 'console_scripts', 'runtask')()
  File "/usr/lib/python2.7/site-packages/libtaskotron/main.py", line 156, in main
    overlord.start()
  File "/usr/lib/python2.7/site-packages/libtaskotron/overlord.py", line 96, in start
    runner.execute()
  File "/usr/lib/python2.7/site-packages/libtaskotron/executor.py", line 60, in execute
    self._prepare_task()
  File "/usr/lib/python2.7/site-packages/libtaskotron/executor.py", line 77, in _prepare_task
    % " ".join([pipes.quote(rpm) for rpm in rpms]))
TaskotronError: Some packages are not installed. Please run "dnf install rpm-python" to install all required packages.

Now I have a pretty decent idea what's going on here.

$ sudo --validate --non-interactive
sudo: je vyžadováno heslo

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 11: ordinal not in range(128)

Char 11 is ž.


$ \dnf --assumeno --disableplugin=noroot install rpm-python
Chyba: Tento příkaz musí být spuštěn pod uživatelem root.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 14: ordinal not in range(128)

Char 14 is ř.

I believe I've identified several problems here:

 1) You are using Python 2 and thus you handle unicode in "I don't care" mode - be careful or use Python 3 instead to fix that :)
 2) You are calling external commands and doing stuff with the output but you do not set locale to English
 3) dnf --disableplugin=noroot does not work on Fedora 26

[1] https://github.com/fedora-python/taskotron-python-versions

Comment 1 Kamil Páral 2017-06-13 13:24:35 UTC
Thanks, Miro. We'll track this upstream. I created a report here:
https://phab.qa.fedoraproject.org/T957


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