bzr-1.15-1 Windows standalone claims " Unable to look up default port for ssh" for sftp connections

Bug #384813 reported by John A Meinel
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Medium
Unassigned
Bazaar Subversion Plugin
Fix Released
High
Jelmer Vernooij

Bug Description

I have a branch on both my local PC and a central repository, with which I communicate using SFTP. Whenever I enter a command that requires a URL (e.g. push, bind), bzr requires that I enter the SSH port number. If I don't specify the port, I get the following error:

bzr: ERROR: Unable to look up default port for ssh

It seems unusual to me that I should have to specify the port when I am using the default port 22. Should I file a bug report for this?

I am using bzr 1.15-1, installed using the Windows standalone installer.

An example:

C:\Documents and Settings\Nick\My Documents\nicks-project\trunk>bzr bind sftp://<email address hidden>/~/nicks-repository/trunk
Connected (version 2.0, client OpenSSH_4.3)
bzr: ERROR: Unable to look up default port for ssh

C:\Documents and Settings\Nick\My Documents\nicks-project\trunk>bzr bind sftp://<email address hidden>:22/~/nicks-repository/trunk
Connected (version 2.0, client OpenSSH_4.3)
SSH <email address hidden>:22 password:
Authentication (password) successful!
Secsh channel 1 opened.
[chan 1] Opened sftp connection (server version 3)
[/ ] sftp > 0KB 0KB/s |
C:\Documents and Settings\Nick\My Documents\nicks-project\trunk>

Related branches

Revision history for this message
John A Meinel (jameinel) wrote :

Note, I haven't been able to reproduce this, but if Nick can, then we should certainly try to sort out the problem.

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Nick Griffiths (nicholasgriffiths) wrote :

As requested by John in the related question, here is the output of the command when using the -Derror flag:

C:\Documents and Settings\Nick\My Documents\nicks-project\trunk>bzr bind -Derror sftp://<email address hidden>/~/nicks-repository/trunk
Connected (version 2.0, client OpenSSH_4.3)
bzr: ERROR: bzrlib.errors.BzrError: Unable to look up default port for ssh

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 729, in exception_to_return_code
  File "bzrlib\commands.pyo", line 924, in run_bzr
  File "bzrlib\commands.pyo", line 560, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 4357, in run
  File "bzrlib\branch.pyo", line 140, in open
  File "bzrlib\bzrdir.pyo", line 837, in open
  File "bzrlib\bzrdir.pyo", line 867, in open_from_transport
  File "bzrlib\transport\__init__.pyo", line 1642, in do_catching_redirections
  File "bzrlib\bzrdir.pyo", line 854, in find_format
  File "bzrlib\bzrdir.pyo", line 1785, in find_format
  File "bzrlib\bzrdir.pyo", line 1795, in probe_transport
  File "bzrlib\transport\sftp.pyo", line 427, in get
  File "bzrlib\transport\sftp.pyo", line 399, in _get_sftp
  File "bzrlib\transport\sftp.pyo", line 391, in _create_connection
  File "bzrlib\transport\ssh.pyo", line 321, in connect_sftp
  File "bzrlib\transport\ssh.pyo", line 317, in _connect
  File "bzrlib\transport\ssh.pyo", line 492, in _paramiko_auth
  File "bzrlib\config.pyo", line 1196, in get_password
  File "bzrlib\config.pyo", line 1086, in get_credentials
  File "bzrlib\config.pyo", line 1266, in get_fallback_credentials
  File "C:/Program Files/Bazaar/plugins\svn\auth.py", line 244, in get_credentials
  File "C:/Program Files/Bazaar/plugins\svn\auth.py", line 224, in _get_realm
BzrError: Unable to look up default port for ssh

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 384813] Re: bzr-1.15-1 Windows standalone claims " Unable to look up default port for ssh" for sftp connections

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nick Griffiths wrote:
> As requested by John in the related question, here is the output of the
> command when using the -Derror flag:
>
> C:\Documents and Settings\Nick\My Documents\nicks-project\trunk>bzr bind -Derror sftp://<email address hidden>/~/nicks-repository/trunk
> Connected (version 2.0, client OpenSSH_4.3)
> bzr: ERROR: bzrlib.errors.BzrError: Unable to look up default port for ssh
>
> Traceback (most recent call last):
...

> File "bzrlib\config.pyo", line 1266, in get_fallback_credentials
> File "C:/Program Files/Bazaar/plugins\svn\auth.py", line 244, in get_credentials
> File "C:/Program Files/Bazaar/plugins\svn\auth.py", line 224, in _get_realm
> BzrError: Unable to look up default port for ssh
>

So this seems to be a bug in the bzr-svn plugin...

  affects bzr-svn

I'm not sure what is going on with this, but I would guess it is
something new with bzr-svn 0.6+

I'll note that if you did "bzr bind --no-plugins sftp://" then it should
'just work' without having to specify a :port.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkotZKQACgkQJdeBCYSNAAOVcwCeLA95OXZnLM3N+KiBXltng1b/
/jAAnRV9j/7tRMROBPyzlgVXRmBgziXn
=fgiq
-----END PGP SIGNATURE-----

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

bzr-svn does socket.getservbyname() calls and apparently windows doesn't know the default port for "ssh". I guess the only thing we can do in this case is pretend we don't know the credentials.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

bzr-svn now just claims to not know credentials if it can't lookup the scheme's port and mutters about it rather than failing.

Changed in bzr:
status: Triaged → Invalid
Changed in bzr-svn:
assignee: nobody → Jelmer Vernooij (jelmer)
importance: Undecided → High
status: New → Fix Released
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jelmer Vernooij wrote:
> bzr-svn does socket.getservbyname() calls and apparently windows doesn't
> know the default port for "ssh". I guess the only thing we can do in
> this case is pretend we don't know the credentials.
>

So here I get:

>>> print socket.getservbyname('ssh')
22
>>> print socket.getservbyname('sftp')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.error: service/proto not found

So I wonder if the problem is about 'sftp' versus 'ssh'.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkotcQ8ACgkQJdeBCYSNAAPWmgCfenamT9HsS6EX330gGwjwzSG2
glEAn1Gi3txnNtzsolE1aRnlBHQG3sFY
=WrEc
-----END PGP SIGNATURE-----

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.