Bug 1661676

Summary: taskotron fails with AttributeError: 'ProgressBar' object has no attribute 'maxval'
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: libtaskotronAssignee: Fedora QA Tools SIG <qa-tools-sig>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fzatlouk, mkrizek, pviktori, qa-tools-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libtaskotron-0.9.4-3.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-27 17:30:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1654746    
Bug Blocks: 1648728    

Description Miro Hrončok 2018-12-22 00:08:55 UTC
Description of problem:
The testsuite of https://github.com/fedora-python/taskotron-python-versions fails on rawhide.

Digging into it, I found the cause.

This script (provided by taskotron devs): https://github.com/fedora-python/taskotron-python-versions/blob/develop/download_rpms.py

Runs koji_directive from libtaskotron.directives and fails.

Version-Release number of selected component (if applicable):
python3-libtaskotron-0.9.4-1.fc30.noarch
python3-progressbar2-3.39.2-2.fc30.noarch

How reproducible:
Easy, run the download_rpms.py on rawhide.

Steps to Reproduce:
1. install the above packages
2. python3 download_rpms.py python-admesh-0.98.5-3.fc25 /tmp x86_64,noarch,src

Actual results:
Downloading rpms for python-admesh-0.98.5-3.fc25 into /var/tmp/task-dist.python-versions_tilx8x8j
Traceback (most recent call last):
  File "download_rpms.py", line 48, in <module>
    **args
  File "download_rpms.py", line 28, in download_rpms
    koji.process(params, arg_data)
  File "/usr/lib/python3.7/site-packages/libtaskotron/directives/koji_directive.py", line 210, in process
    debuginfo=debuginfo, src=src)
  File "/usr/lib/python3.7/site-packages/libtaskotron/ext/fedora/koji_utils.py", line 262, in get_nvr_rpms
    rpm_file = file_utils.download(url, dest, cachedir=cachedir)
  File "/usr/lib/python3.7/site-packages/libtaskotron/file_utils.py", line 134, in download
    _download(url, dl_dest)
  File "/usr/lib/python3.7/site-packages/libtaskotron/file_utils.py", line 200, in _download
    pbar.update(min(read, pbar.maxval))
AttributeError: 'ProgressBar' object has no attribute 'maxval'

Expected results:
Should download the RPMs.

Additional info:
This is directly caused by python3-progressbar2 providing/obsoleting/replacing python3-progressbar.

https://bugzilla.redhat.com/show_bug.cgi?id=1648728
https://bugzilla.redhat.com/show_bug.cgi?id=1654746

Comment 1 František Zatloukal 2018-12-23 00:08:56 UTC
Fix should be in libtaskotron-0.9.4-2.fc30 [0]. It's more of a hotfix than something proper for now.

Is it working for you?

[0] https://koji.fedoraproject.org/koji/buildinfo?buildID=1175379

Comment 2 Miro Hrončok 2018-12-27 00:09:27 UTC
> Is it working for you?

No. You have not applied the patch.

<mock-chroot> sh-4.4# rpm -q python3-libtaskotron
python3-libtaskotron-0.9.4-2.fc30.noarch

<mock-chroot> sh-4.4# python3 download_rpms.py python-admesh-0.98.5-3.fc25 /tmp x86_64,noarch,src
Running script: ['download_rpms.py', 'python-admesh-0.98.5-3.fc25', '/tmp', 'x86_64,noarch,src']
Requested arches: ['x86_64', 'noarch', 'src']
DEBUG:libtaskotron:Using config file: /etc/taskotron/taskotron.yaml
DEBUG:libtaskotron:Using config profile: development
Downloading rpms for python-admesh-0.98.5-3.fc25 into /tmp
INFO:libtaskotron:Querying Koji for a list of RPMs for: python-admesh-0.98.5-3.fc25 (arches ['noarch', 'src', 'x86_64'])
INFO:libtaskotron:Fetching 3 RPMs for: python-admesh-0.98.5-3.fc25 (into /tmp)
DEBUG:libtaskotron:Already downloaded: /var/cache/taskotron/python-admesh-0.98.5-3.fc25.src.rpm
DEBUG:libtaskotron:Downloading (cached): https://kojipkgs.fedoraproject.org/packages/python-admesh/0.98.5/3.fc25/x86_64/python-admesh-0.98.5-3.fc25.x86_64.rpm
N/A%|                                                                                   |ETA:  --:--:--  0.0 s/BTraceback (most recent call last):
  File "download_rpms.py", line 48, in <module>
    **args
  File "download_rpms.py", line 28, in download_rpms
    koji.process(params, arg_data)
  File "/usr/lib/python3.7/site-packages/libtaskotron/directives/koji_directive.py", line 210, in process
    debuginfo=debuginfo, src=src)
  File "/usr/lib/python3.7/site-packages/libtaskotron/ext/fedora/koji_utils.py", line 262, in get_nvr_rpms
    rpm_file = file_utils.download(url, dest, cachedir=cachedir)
  File "/usr/lib/python3.7/site-packages/libtaskotron/file_utils.py", line 134, in download
    _download(url, dl_dest)
  File "/usr/lib/python3.7/site-packages/libtaskotron/file_utils.py", line 200, in _download
    pbar.update(min(read, pbar.maxval))
AttributeError: 'ProgressBar' object has no attribute 'maxval'
100%|#################################################################################|Time:  0:00:00130.4 KiB/s

Comment 3 Miro Hrončok 2018-12-27 00:13:44 UTC
Here you go https://src.fedoraproject.org/rpms/libtaskotron/pull-request/2

Comment 4 František Zatloukal 2018-12-27 00:41:56 UTC
Yeah :/ ... I've forgot to push the latest spec I had localy... merged, build submitted, thanks!

Comment 5 Miro Hrončok 2018-12-27 17:30:16 UTC
Thanks, it works now.