How to expand lp: prefix manually?

Asked by anatoly techtonik

I've got a problem with bazaar "checkouts" behind a proxy with lp: prefix and I wonder how can I expand it manually to test different protocols?

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
John A Meinel
Solved:
Last query:
Last reply:
Revision history for this message
Best John A Meinel (jameinel) said :
#1

It depends on the form of the prefix. If you are doing "lp:~user/project/branch" that maps directly to either
  http://bazaar.launchpad.net/~user/project/branch
or
  bzr+ssh://bazaar.launchpad.net/~user/project/branch

It is a bit trickier for things like "lp:project". However, Launchpad has a nice redirect built-in to http:// urls. So if you go to access:

  bzr branch https://code.launchpad.net/project

It will automatically redirect you to the correct location.

bzr itself expands the lp: prefix using an XML-RPC call to xmlrpc.launchpad.net, which is probably why you are having problems with a proxy.

Revision history for this message
anatoly techtonik (techtonik) said :
#2

You are absolutely right about the proxy - XML-RPC library doesn't work with them - http://bugs.python.org/issue648658

bzr branch http://code.launchpad.net/project works ok and redirects to http://code.launchpad.net/projects

Revision history for this message
anatoly techtonik (techtonik) said :
#3

Thanks John A Meinel, that solved my question.

Revision history for this message
anatoly techtonik (techtonik) said :
#4

Pardon, redirects to https://code.launchpad.net/projects
There is another problem with the proxies that HTTPS scheme required additional HTTPS_PROXY environment variable.

Revision history for this message
John A Meinel (jameinel) said :
#5

That is the way proxy vars work (at least as I understand them). You set "<SCHEME>_PROXY" to define the proxy for http versus https, versus ftp, etc.
I think you can set "ALL_PROXY=XXX", but maybe you *don't* want to proxy some things.

Revision history for this message
anatoly techtonik (techtonik) said :
#6

BTW, this URL also works
  https://code.launchpad.net/~user/project/branch
but strangely enought - this one doesn't
  https://bazaar.launchpad.net/~user/project/branch

While the latter fails with
  bzr: ERROR: pycurl.error: (56, 'Received HTTP code 503 from proxy after CONNECT')
when accessing with plain http the branch is created without problems, i.e.
  http://bazaar.launchpad.net/~user/project/branch

Revision history for this message
John A Meinel (jameinel) said :
#7

bazaar.launchpad.net does not have HTTPS access. Only {bugs,code,answers}.launchpad.net allow https access. I'm not sure exactly why, but that is by design.

I suppose they didn't want people causing too much CPU load for SSL encryption when just transferring bulk data.

Revision history for this message
anatoly techtonik (techtonik) said :
#8

Sounds fair.

ALL_PROXY works like a charm. But you are right - environment variables are really the last in the list of things I would like to look for while troubleshooting software. I still hope to see them isolated in config file in a subversion way.