Can't clone private repo hosted on Launchpad

Bug #2039396 reported by Haw Loeung
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Breezy
New
Undecided
Unassigned
breezy (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

Just upgraded to `mantic`, which ships with `brz 3.3.4`. Unfortunately, I can't clone private repositories:

| $ bzr branch lp:~hloeung/my-private-repo
| brz: ERROR: lazr.restfulclient.errors.ServerError: HTTP Error 500: Internal Server Error
| Response headers:
| ---
| connection: close
| content-length: 14
| content-type: text/plain;charset=utf-8
| date: Sun, 15 Oct 2023 22:22:50 GMT
| server: gunicorn
| status: 500
| x-lazr-oopsid: OOPS-ddcf9d2b6990edac4388b89b5ba70d6a
| x-powered-by: Zope (www.zope.org), Python (www.python.org)
| x-request-id: 7d2be1eb-5779-4008-851d-59d017e64c3b
| x-vcs-revision: bd6cfd0cfc024dbe1dcd7d5d91165fb4f6a6c596
| ---
| Response body:
| ---
| b'AssertionError'
| ---
|
|
| Traceback (most recent call last):
| File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1032, in exception_to_return_code
| return the_callable(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1224, in run_bzr
| ret = run(*run_argv)
| ^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/commands.py", line 774, in run_argv_aliases
| return self.run(**all_cmd_args)
| ^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/commands.py", line 799, in run
| return class_run(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/builtins.py", line 1456, in run
| accelerator_tree, br_from = controldir.ControlDir.open_tree_or_branch(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 885, in open_tree_or_branch
| controldir = klass.open(location)
| ^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 789, in open
| t = _mod_transport.get_transport(base, possible_transports)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1594, in get_transport
| location_to_url(base, purpose=purpose),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/location.py", line 141, in location_to_url
| location = directories.dereference(location, purpose)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/directory_service.py", line 87, in dereference
| return directory.look_up(name, url, purpose=purpose)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_directory.py", line 137, in look_up
| return _resolve(url)
| ^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_directory.py", line 106, in _resolve
| result = _resolve_via_api(path, url)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/breezy/plugins/launchpad/lp_directory.py", line 91, in _resolve_via_api
| join(lp_branch.composePublicURL(scheme='http'), *subpaths)]}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 642, in __call__
| response, content = self.root._browser._request(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 484, in _request
| raise error
| lazr.restfulclient.errors.ServerError: HTTP Error 500: Internal Server Error
| Response headers:
| ---
| connection: close
| content-length: 14
| content-type: text/plain;charset=utf-8
| date: Sun, 15 Oct 2023 22:22:50 GMT
| server: gunicorn
| status: 500
| x-lazr-oopsid: OOPS-ddcf9d2b6990edac4388b89b5ba70d6a
| x-powered-by: Zope (www.zope.org), Python (www.python.org)
| x-request-id: 7d2be1eb-5779-4008-851d-59d017e64c3b
| x-vcs-revision: bd6cfd0cfc024dbe1dcd7d5d91165fb4f6a6c596
| ---
| Response body:
| ---
| b'AssertionError'
| ---
|
|
| brz 3.3.4 on python 3.11.6 (Linux-6.5.0-9-generic-x86_64-with-glibc2.38)
| arguments: ['bzr', 'branch', 'lp:~hloeung/my-private-repo']
| plugins: bash_completion[3.3.4], changelog_merge[3.3.4],
| commitfromnews[3.3.4], cvs[3.3.4], darcs[3.3.4], email[3.3.4],
| etckeeper[unknown], fastimport[3.3.4], flake8[unknown], fossil[3.3.4],
| github[3.3.4], gitlab[3.3.4], hg[3.3.4], launchpad[3.3.4], mtn[3.3.4],
| netrc_credential_store[3.3.4], news_merge[3.3.4], po_merge[3.3.4],
| propose[3.3.4], pypi[3.3.4], quilt[unknown], repodebug[3.3.4],
| rewrite[unknown], stats[3.3.4], svn[3.3.4], upload[3.3.4],
| weave_fmt[3.3.4], webdav[3.3.4], zsh_completion[3.3.4]
| encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_US.utf8'
|
| *** Breezy has encountered an internal error. This probably indicates a
| bug in Breezy. 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.

The OOPS showing:

| result = self._getMethod()(**params)
| Module lp.code.model.branch, line 854, in composePublicURL
| assert not (self.private and scheme in public_schemes), (
| AssertionError: Private branch ~hloeung/my-private-repo/trunk has no public URL.

Any ideas what's wrong here?

I've tried `bzr lp-logout` and `bzr lp-login` without any success.

Haw Loeung (hloeung)
summary: - Can't clone private repo
+ Can't clone private repo hosted on Launchpad
Revision history for this message
Colin Watson (cjwatson) wrote :

I think the correct fix here would be for `breezy.plugins.launchpad.lp_directory._resolve_via_api` to handle the case where the `scheme='http'` call returns an error, and omit the http:// URL from the list of URLs that it returns in that case. `scheme='http'` will always fail for private branches. 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.