Bug 1686473

Summary: rhpkg module-build-local fails with AttributeError: 'str' object has no attribute 'decode'
Product: [Fedora] Fedora Reporter: Matus Honek <mhonek>
Component: module-build-serviceAssignee: Matt Prahl <mprahl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 29CC: fvalder, jkaluza, mprahl, otaylor, rbean
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: module-build-service-2.18.1-1.fc29 module-build-service-2.18.1-1.fc30 module-build-service-2.18.1-1.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-23 02:57:15 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:

Description Matus Honek 2019-03-07 14:17:57 UTC
Description of problem:
Building module locally throws exception (see Actual results).

Version-Release number of selected component (if applicable):
module-build-service-2.14.0-2.fc29.noarch

How reproducible:
always

Steps to Reproduce:
1. rhpkg module-build-local
2.
3.

Actual results:
2019-03-07 14:44:36,613 - MainThread - urllib3.util.retry - DEBUG - Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
2019-03-07 14:44:36,808 - MainThread - moksha.hub - WARNING - Cannot find qpid python module. Make sure you have python-qpid installed.
Traceback (most recent call last):
  File "/usr/bin/mbs-manager", line 11, in <module>
    load_entry_point('module-build-service==2.14.0', 'console_scripts', 'mbs-manager')()
  File "/usr/lib/python3.7/site-packages/module_build_service/manage.py", line 238, in manager_wrapper
    manager.run()
  File "/usr/lib/python3.7/site-packages/flask_script/__init__.py", line 417, in run
    result = self.handle(argv[0], argv[1:])
  File "/usr/lib/python3.7/site-packages/flask_script/__init__.py", line 386, in handle
    res = handle(*args, **config)
  File "/usr/lib/python3.7/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/module_build_service/manage.py", line 154, in build_module_locally
    username, handle, str(stream), skiptests, optional_params)
  File "/usr/lib/python3.7/site-packages/module_build_service/utils/submit.py", line 400, in submit_module_build_from_yaml
    yaml_file = handle.read().decode("utf-8")
AttributeError: 'str' object has no attribute 'decode'
Could not execute module_build_local: Failed to execute command.


Expected results:
Building works, no tracebacks.

Additional info:
Downgrading to module-build-service-2.12.2-1.fc29.noarch makes this work again.

Comment 1 Matt Prahl 2019-03-18 15:44:50 UTC
This should fix this specific exception:
https://pagure.io/fm-orchestrator/pull-request/1172

Comment 2 Owen Taylor 2019-03-18 19:00:16 UTC
A backport of the fix into the current F29/F30 packages would be really appreciated!

Comment 3 Fedora Update System 2019-03-20 20:24:10 UTC
module-build-service-2.18.1-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-7271b9fe81

Comment 4 Fedora Update System 2019-03-20 20:24:19 UTC
module-build-service-2.18.1-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-e5bc7a4bcb

Comment 5 Fedora Update System 2019-03-20 20:24:33 UTC
module-build-service-2.18.1-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2b7c399008

Comment 6 Fedora Update System 2019-03-21 19:12:17 UTC
module-build-service-2.18.1-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2b7c399008

Comment 7 Fedora Update System 2019-03-21 21:18:53 UTC
module-build-service-2.18.1-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-e5bc7a4bcb

Comment 8 Fedora Update System 2019-03-21 21:48:53 UTC
module-build-service-2.18.1-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-7271b9fe81

Comment 9 Fedora Update System 2019-03-23 02:57:15 UTC
module-build-service-2.18.1-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2019-03-29 19:18:41 UTC
module-build-service-2.18.1-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2019-03-31 03:11:18 UTC
module-build-service-2.18.1-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.