bzr based snap builds with "base: core20" fail

Bug #1876948 reported by Michael Vogt
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Breezy
Triaged
Critical
Jelmer Vernooij

Bug Description

I tried to build a bzr repo "test-snapd-sh-core20" snap today that uses "base: core20".

When trying this I got a crash from bzr during the build, the full build log is here:
https://launchpadlibrarian.net/478363687/buildlog_snap_ubuntu_focal_s390x_test-snapd-sh-core20_BUILDING.txt.gz

The crash is:
"""
Running repo phase...
brz: ERROR: AttributeError: can't set attribute

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/builtins.py", line 1465, in run
    accelerator_tree, br_from = controldir.ControlDir.open_tree_or_branch(
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 799, in open_tree_or_branch
    controldir = klass.open(location)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 705, in open
    t = _mod_transport.get_transport(base, possible_transports)
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1573, in get_transport
    _mod_location.location_to_url(base, purpose=purpose),
  File "/usr/lib/python3/dist-packages/breezy/location.py", line 61, in location_to_url
    location = directories.dereference(location, purpose)
  File "/usr/lib/python3/dist-packages/breezy/directory_service.py", line 89, in dereference
    return directory.look_up(name, url, purpose=purpose)
  File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_directory.py", line 122, in look_up
    return self._resolve(url)
  File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_directory.py", line 178, in _resolve
    result = self._resolve_via_xmlrpc(path, url, _request_factory)
  File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_directory.py", line 154, in _resolve_via_xmlrpc
    result = resolve.submit(service)
  File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_registration.py", line 244, in submit
    return service.send_request(self._methodname, self._request_params())
  File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_registration.py", line 173, in send_request
    result = method(*method_params)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_registration.py", line 100, in request
    response = self._opener.open(request)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3/dist-packages/breezy/transport/http/_urllib2_wrappers.py", line 942, in https_open
    connect = _ConnectRequest(request)
  File "/usr/lib/python3/dist-packages/breezy/transport/http/_urllib2_wrappers.py", line 583, in __init__
    Request.__init__(self, 'CONNECT', request.get_full_url(),
  File "/usr/lib/python3/dist-packages/breezy/transport/http/_urllib2_wrappers.py", line 528, in __init__
    urllib_request.Request.__init__(
  File "/usr/lib/python3.8/urllib/request.py", line 328, in __init__
    self.full_url = url
  File "/usr/lib/python3.8/urllib/request.py", line 354, in full_url
    self._parse()
  File "/usr/lib/python3.8/urllib/request.py", line 384, in _parse
    self.host, self.selector = _splithost(rest)
AttributeError: can't set attribute

brz 3.0.2 on python 3.8.2 (Linux-4.4.0-178-generic-s390x-with-glibc2.29)
arguments: ['/usr/bin/bzr', 'branch', 'lp:~snappy-dev/snappy-hub/test-snapd-
    sh-core20', 'test-snapd-sh-core20']
plugins: bash_completion[3.0.2], changelog_merge[3.0.2],
    commitfromnews[3.0.2], cvs[3.0.2], darcs[3.0.2], email[3.0.2],
    fastimport[3.0.2], launchpad[3.0.2], mtn[3.0.2],
    netrc_credential_store[3.0.2], news_merge[3.0.2], po_merge[3.0.2],
    propose[3.0.2], repodebug[3.0.2], stats[3.0.2], upload[3.0.2],
    weave_fmt[3.0.2]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'C.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/brz/+filebug
    including this traceback and a description of the problem.
Build failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 256, in run
    self.repo()
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 175, in repo
    self.vcs_fetch(self.args.name, cwd="/build", env=env)
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/vcs.py", line 94, in vcs_fetch
    self.backend.run(cmd, cwd=cwd, env=full_env)
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lxd.py", line 537, in run
    subprocess.check_call(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['lxc', 'exec', 'lp-focal-s390x', '--env', 'LANG=C.UTF-8', '--env', 'SHELL=/bin/sh', '--env', 'http_proxy=http://10.10.10.1:8222/', '--env', 'https_proxy=http://10.10.10.1:8222/', '--env', 'GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy', '--', '/bin/sh', '-c', "cd /build && linux64 bzr branch 'lp:~snappy-dev/snappy-hub/test-snapd-sh-core20' test-snapd-sh-core20"]' returned non-zero exit status 4
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=focal --arch=s390x SNAPBUILD-940030
Scanning for processes to kill in build SNAPBUILD-940030
"""

I worked around it by just using git but I wanted to report it as a low priority issue.

Revision history for this message
JL (blablup007) wrote :

Most properbly it is about the proxy setting. I have the same issue, but if I do it without environment vars "http_proxy" and "https_proxy" it does work.

Revision history for this message
Colin Watson (cjwatson) wrote :

This seems like a breezy bug - I'm not sure there's much we can do about it in Launchpad itself. As far as I can see, urllib.request.Request tries to set self.selector, but breezy.transport.http._ConnectRequest defines selector as a read-only property. Jelmer, does this seem familiar?

affects: launchpad → brz
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Yes, this seems familiar - it's fixed in newer versions of Breezy. Unfortunately I don't have the bug # here, but a more recent Breezy release should address this.

Changed in brz:
status: New → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote :
Download full text (4.4 KiB)

Sorry, but this is still reproducible with current Breezy trunk, r7521. Trying to reproduce it against Launchpad runs into other problems which I need to look into, but here's a reproducer with a random branch I had lying around on my home network, and assuming that you have a CONNECT-capable proxy on port 3128:

$ https_proxy=http://localhost:3128/ BRZ_PLUGIN_PATH=-site:-user ./brz info https://riva.dynamic.greenend.org.uk/~cjwatson/bzr/pcmciautils/upstream
brz: ERROR: AttributeError: can't set attribute

Traceback (most recent call last):
  File "/home/cjwatson/src/bzr/brz/brz/breezy/commands.py", line 1017, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/commands.py", line 1206, in run_bzr
    ret = run(*run_argv)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/commands.py", line 757, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/commands.py", line 782, in run
    return class_run(*args, **kwargs)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/commands.py", line 1223, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/builtins.py", line 1913, in run
    show_bzrdir_info(controldir.ControlDir.open_containing(location)[0],
  File "/home/cjwatson/src/bzr/brz/brz/breezy/controldir.py", line 771, in open_containing
    return klass.open_containing_from_transport(transport)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/controldir.py", line 792, in open_containing_from_transport
    result = klass.open_from_transport(a_transport)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/controldir.py", line 754, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/home/cjwatson/src/bzr/brz/brz/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/controldir.py", line 742, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/home/cjwatson/src/bzr/brz/brz/breezy/controldir.py", line 1165, in find_format
    return prober.probe_transport(transport)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/bzr/__init__.py", line 111, in probe_transport
    server_version = medium.protocol_version()
  File "/home/cjwatson/src/bzr/brz/brz/breezy/bzr/smart/medium.py", line 829, in protocol_version
    client_protocol.query_version()
  File "/home/cjwatson/src/bzr/brz/brz/breezy/bzr/smart/protocol.py", line 797, in query_version
    self.call(b'hello')
  File "/home/cjwatson/src/bzr/brz/brz/breezy/bzr/smart/protocol.py", line 635, in call
    self._request.finished_writing()
  File "/home/cjwatson/src/bzr/brz/brz/breezy/bzr/smart/medium.py", line 611, in finished_writing
    self._finished_writing()
  File "/home/cjwatson/src/bzr/brz/brz/breezy/transport/http/__init__.py", line 2533, in _finished_writing
    data = self._medium.send_http_smart_request(self._buffer)
  File "/home/cjwatson/src/bzr/brz/brz/breezy/transport/http/__init__.py", line 2498, in send_http_smart_request
    code, body_filelike = t._post(bytes)
  File "/home/cjwatson/src/bzr/brz...

Read more...

Jelmer Vernooij (jelmer)
Changed in brz:
status: Fix Released → Triaged
importance: Undecided → Critical
assignee: nobody → Jelmer Vernooij (jelmer)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.