Bug 1661951 - "buildbot try" does not work (a bytes-like object is required, not 'str')
Summary: "buildbot try" does not work (a bytes-like object is required, not 'str')
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: buildbot
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gianluca Sforna
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-24 19:17 UTC by Tom Tromey
Modified: 2019-08-27 18:37 UTC (History)
8 users (show)

Fixed In Version: buildbot-2.3.1-2.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-27 18:37:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Proposed fix (1.66 KB, patch)
2019-06-19 19:17 UTC, Sergio Durigan Junior
no flags Details | Diff

Description Tom Tromey 2018-12-24 19:17:22 UTC
Description of problem:

buildbot does not work properly.
Even something as simple as "buildbot --help" fails with:

bapiya. buildbot --help
Traceback (most recent call last):
  File "/bin/buildbot", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3095, in <module>
    @_call_aside
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3079, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 888, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 774, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Tempita>=0.4' distribution was not found and is required by sqlalchemy-migrate


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

bapiya. rpm -q buildbot
buildbot-1.6.0-2.fc28.noarch

How reproducible:

Always.


Additional info:

I tried installing python3-tempita to get around this.

Then it complained about another package, so I installed python3-sqlparse.

However with these installed it now fails like:

bapiya. buildbot try -b Fedora-x86_64-m32 -b Fedora-s390x-m64 -b NetBSD-x86_64-m64 -b Solaris11-sparcv9-m64
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/twisted/internet/_baseprocess.py", line 64, in maybeCallProcessEnded
    proto.processEnded(Failure(reason))
  File "/usr/lib64/python3.6/site-packages/twisted/internet/utils.py", line 163, in processEnded
    self.deferred.callback((out, err, code))
  File "/usr/lib64/python3.6/site-packages/twisted/internet/defer.py", line 459, in callback
    self._startRunCallbacks(result)
  File "/usr/lib64/python3.6/site-packages/twisted/internet/defer.py", line 567, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib64/python3.6/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3.6/site-packages/buildbot/clients/tryclient.py", line 921, in trapSystemExit
    why.trap(SystemExit)
  File "/usr/lib64/python3.6/site-packages/twisted/python/failure.py", line 371, in trap
    self.raiseException()
  File "/usr/lib64/python3.6/site-packages/twisted/python/failure.py", line 399, in raiseException
    raise self.value.with_traceback(self.tb)
  File "/usr/lib64/python3.6/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3.6/site-packages/buildbot/clients/tryclient.py", line 337, in fixBranch
    for l in remotes.split("\n"):
builtins.TypeError: a bytes-like object is required, not 'str'


I wonder whether buildbot is truly Python-3-ready.

Comment 1 Ben Cotton 2019-05-02 20:06:10 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Upstream Release Monitoring 2019-05-23 03:02:10 UTC
Latest upstream release: 2.3.1 Current version/release in rawhide: 2.0.1-1.fc30 URL: http://buildbot.net/ Please consult the package updates policy before you issue an update to a stable branch: https://fedoraproject.org/wiki/Updates_Policy More information about the service that created this bug can be found at: https://fedoraproject.org/wiki/Upstream_release_monitoringPlease keep in mind that with any upstream change, there may also be packaging changes that need to be made. Specifically, please remember that it is your responsibility to review the new version to ensure that the licensing is still correct and that no non-free or legally problematic items have been added upstream.Based on the information from anitya: https://release-monitoring.org/project/228/

Comment 3 Upstream Release Monitoring 2019-05-23 03:02:11 UTC
Skipping the scratch build because an SRPM could not be built: ['git', 'clone', 'https://src.fedoraproject.org/cgit/rpms/buildbot.git', '/var/tmp/thn-y3swc6n4'] returned 128: b"Cloning into '/var/tmp/thn-y3swc6n4'...\nfatal: repository 'https://src.fedoraproject.org/cgit/rpms/buildbot.git/' not found\n"

Comment 4 Fedora Update System 2019-05-28 12:42:17 UTC
buildbot-2.3.1-2.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-3270dc130b

Comment 5 Ben Cotton 2019-05-28 18:54:43 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Fedora Update System 2019-05-29 01:35:57 UTC
buildbot-2.3.1-2.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-3270dc130b

Comment 7 Fedora Update System 2019-06-07 00:58:16 UTC
buildbot-2.3.1-2.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Sergio Durigan Junior 2019-06-17 19:37:47 UTC
Reopening because I'm still facing the problem with "buildbot try":

Traceback (most recent call last):
  File "/usr/lib64/python3.7/site-packages/twisted/internet/_baseprocess.py", line 64, in maybeCallProcessEnded
    proto.processEnded(Failure(reason))
  File "/usr/lib64/python3.7/site-packages/twisted/internet/utils.py", line 163, in processEnded
    self.deferred.callback((out, err, code))
  File "/usr/lib64/python3.7/site-packages/twisted/internet/defer.py", line 460, in callback
    self._startRunCallbacks(result)
  File "/usr/lib64/python3.7/site-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib64/python3.7/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3.7/site-packages/buildbot/clients/tryclient.py", line 921, in trapSystemExit
    why.trap(SystemExit)
  File "/usr/lib64/python3.7/site-packages/twisted/python/failure.py", line 460, in trap
    self.raiseException()
  File "/usr/lib64/python3.7/site-packages/twisted/python/failure.py", line 488, in raiseException
    raise self.value.with_traceback(self.tb)
  File "/usr/lib64/python3.7/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3.7/site-packages/buildbot/clients/tryclient.py", line 335, in fixBranch
    for l in remotes.split("\n"):
builtins.TypeError: a bytes-like object is required, not 'str'

Comment 9 Sergio Durigan Junior 2019-06-19 19:17:37 UTC
Created attachment 1582364 [details]
Proposed fix

This patch fixes the problem for me.  It is a mix of the patch proposed here:

https://github.com/buildbot/buildbot/pull/4765

With:

-        for l in remotes.split("\n"):
+        for l in str (remotes).split("\n"):

Using this patch, I am now able to submit try builds normally.

Comment 10 Gary Benson 2019-07-10 08:20:22 UTC
This issue is now fixed upstream:

https://github.com/buildbot/buildbot/commit/5747da2163dcae7582921342ce53030283b6c159

FWIW str() will create a string from a bytes object, but it's an oddity and best avoided:

bash$ python3
>>> str(b"hello", "utf8")
'hello'
>>> str(b"hello")
"b'hello'"

You could read https://docs.python.org/3/library/stdtypes.html#str for the full gory details, or you could just use decode which isn't weird like str:

>>> b"hello".decode()
'hello'
>>> b"hello".decode("utf-8")
'hello'

Comment 11 Sergio Durigan Junior 2019-08-27 18:36:16 UTC
buildbot-2.4.0-1.fc30 has been released, which should fix this issue.  I'm closing it.


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