Lightweight checkout on dead webhost in history prevents explorer opening

Bug #925951 reported by Martin Packman on 2012-02-03
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Explorer
High
Alexander Belchenko

Bug Description

We're running into a problem on a Windows 7 machine where the Bazaar Explorer does not open. The contents of the log are:

Thu 2012-02-02 13:16:30 -0700
0.078 bazaar version: 2.4.2
0.078 bzr arguments: [u'explorer']
0.094 looking for plugins in C:/Users/Skip/AppData/Roaming/bazaar/2.0/plugins
0.094 looking for plugins in C:/Program Files (x86)/Bazaar/plugins
1.295 encoding stdout as osutils.get_user_encoding() 'cp1252'
6.225 Deprecated method called
Called from:
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 165, in __init__
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 257, in _refresh_user_configuration
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 264, in get_default_editor
6.256 loading explorer extensions for clothes ['Bazaar support', 'Register on Launchpad']
6.318 explorer extensions provided by the colo plugin in C:/Program Files (x86)/Bazaar/plugins/colo/explorer
7.254 failed to load system host keys: [Errno 2] No such file or directory: 'C:\\Users\\Skip/.ssh/known_hosts'
7.270 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 946, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1150, in run_bzr
  File "bzrlib\commands.pyo", line 699, in run_argv_aliases
  File "bzrlib\commands.pyo", line 721, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\commands.py", line 162, in run
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 243, in __init__
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 1976, in do_welcome
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 690, in changed_view
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 1085, in _get_hosted_web_url
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\hosted_url_resolver.py", line 44, in get_branch_url
  File "C:/Program Files (x86)/Bazaar/plugins\launchpad\__init__.py", line 213, in _get_web_url
  File "C:/Program Files (x86)/Bazaar/plugins\launchpad\__init__.py", line 200, in _possible_locations
  File "bzrlib\branch.pyo", line 207, in open_containing
  File "bzrlib\bzrdir.pyo", line 1302, in open_branch
  File "bzrlib\branch.pyo", line 2304, in open
  File "bzrlib\bzrdir.pyo", line 828, in open
  File "bzrlib\bzrdir.pyo", line 863, in open_from_transport
  File "bzrlib\bzrdir.pyo", line 1590, in open
  File "bzrlib\remote.pyo", line 293, in _open
  File "bzrlib\remote.pyo", line 356, in __init__
  File "bzrlib\remote.pyo", line 368, in _probe_bzrdir
  File "bzrlib\remote.pyo", line 375, in _rpc_open_2_1
  File "bzrlib\remote.pyo", line 56, in _call
  File "bzrlib\smart\client.pyo", line 132, in call
  File "bzrlib\smart\client.pyo", line 145, in call_expecting_body
  File "bzrlib\smart\client.pyo", line 90, in _call_and_read_response
  File "bzrlib\smart\client.pyo", line 63, in _send_request
  File "bzrlib\smart\protocol.pyo", line 1309, in call
  File "bzrlib\smart\protocol.pyo", line 1133, in _write_end
  File "bzrlib\smart\protocol.pyo", line 1099, in flush
  File "bzrlib\smart\medium.pyo", line 395, in accept_bytes
  File "bzrlib\smart\medium.pyo", line 977, in _accept_bytes
  File "bzrlib\smart\medium.pyo", line 793, in _accept_bytes
  File "bzrlib\smart\medium.pyo", line 817, in _ensure_connection
  File "bzrlib\transport\ssh.pyo", line 332, in connect_ssh
  File "bzrlib\transport\ssh.pyo", line 287, in _connect
  File "bzrlib\transport\ssh.pyo", line 257, in _raise_connection_error
SocketConnectionError: Unable to connect to SSH host gdb.az.celestech.com; [Errno 11004] getaddrinfo failed

The host (gdb.az.celestech.com) has gone away and been replaced with a new machine but I can't find any config file or anything where Bazaar would be picking up the old address.

I removed the existing id_rsa file hoping that would help, but it did not. I have uninstalled, reinstalled, and even upgraded Bazaar, that also had not helped.

Alexander Belchenko (bialix) wrote :

Please, show us the content of .bzr/branch/branch.conf file of affected branch.

Changed in bzr-explorer:
status: New → Incomplete
Alexander Belchenko (bialix) wrote :

Also, please execute in the command line the following command and show its output:

bzr info PATH\TO\AFFECTED\LOCATION

Brian Cox (brian-cox) wrote :

Hi Alexander,

I actually deleted the branch since it was no longer needed and I thought that might be where Bazaar was picking up the old address.

I can try to restore the branch if you think that is the only way to move forward.

Thanks!
Brian

Brian Cox пишет:
> Hi Alexander,
>
> I actually deleted the branch since it was no longer needed and I
> thought that might be where Bazaar was picking up the old address.
>
> I can try to restore the branch if you think that is the only way to
> move forward.

That information is needed to understand why you had this problem.

Are you still experiencing this problem with new branch even though the
old branch has been deleted?

If you're not then you don't have to bother restore your old branch.

Brian, if this error was only happening in that one location, then certainly restoring that branch so we can work out what was different about it would help. Was it a checkout or bound to the remote branch, do you remember?

Brian Cox (brian-cox) wrote :

Alexander - We haven't been able to open Bazaar Explorer long enough to access a new branch with it.

Martin - I believe it was a branch from before we switched over to using checkouts.

I will have access to this user's machine again on Monday and will try to restore the branch and provide the information you guys requested.

Thank you both again for the help.

Brian Cox пишет:
> Alexander - We haven't been able to open Bazaar Explorer long enough to
> access a new branch with it.

What do you mean?

I think the suggestion form Martin to rename/remove history.dat is correct one.

Alexander Belchenko (bialix) wrote :

@Martin, more interesting thing that actually internal launchpad plugin has raised SocketConnectionError, while the code in explorer expects to get NotLaunchpadBranch only. See explorer/lib/hosted_url_resolver.py:

    def get_branch_url(self, location='.'):
        """Get the web branch URL for a given location.

        @return: the URL as a string or None if none.
        """
        # TODO: generalise this to support sites other than Launchpad, e.g.
        # Savannah and/or Loggerhead on an Intranet server.
        try:
            # Note: this only checks the public location and the push location.
            # I think it ought to check the bound and parent locations as well.
            # See https://bugs.launchpad.net/bzr/+bug/488057.
            return self._lp_open_cmd._get_web_url(self._lp_service, location)
        except NotLaunchpadBranch:
            return None

So, should we catch socket errors here? Or should launchpad plugin be improved in that area?

Brian Cox пишет:
> I will have access to this user's machine again on Monday and will try
> to restore the branch and provide the information you guys requested.

Brian, if you have access to that machine you can help us to understand
what's wrong by inspecting history.dat (to check that dead URL is indeed
saved there), and also you can help me to test some patches for explorer
itself.

  • original Edit (399 bytes, application/x-ns-proxy-autoconfig)

Thanks for your patience guys. Here is what I was able to find out this morning:

1. Please, show us the content of .bzr/branch/branch.conf file of affected branch.

I restored the branch, but I did not see a branch.conf file. All I saw was a format file and a location file. (contents of location = bzr+ssh://<email address hidden>/home/bazaar/dev/skip/) Maybe I was looking in the wrong place?

2. Also, please execute in the command line the following command and show its output:

bzr info PATH\TO\AFFECTED\LOCATION

c:\GDB\.bzr\branch>bzr info c:\GDB
bzr: ERROR: Unable to connect to SSH host gdb.az.celestech.com; [Errno
11004] getaddrinfo failed

3. Renamed history.dat to history_backup.dat. Bazaar Explorer still did not open. I'm attaching The original history.dat (renamed to history_backup.dat, and the new history.dat file.

I'm also attaching the .bzr.log in case there is something helpful in there.

Brian Cox (brian-cox) wrote :

Adding history.dat

Brian Cox (brian-cox) wrote :

Adding .bzr.log

Brian Cox (brian-cox) wrote :

>Brian Cox пишет:
>> Alexander - We haven't been able to open Bazaar Explorer long enough to
>> access a new branch with it.
>
>What do you mean?

Sorry I wasn't clear here. You asked if we were experiencing this problem with a new branch, and I meant to say that we were not able to create a new branch with Bazaar Explorer to try to access it. I can try to create one from the command line and see if the behavior changes at all.

Brian Cox (brian-cox) wrote :

And I should have mentioned, I'd be happy to help test any patches you want to send my way.

Brian Cox (brian-cox) wrote :

Not sure if this is a related problem or not, but I tried to create a checkout of a branch through the command line. I got this error:

c:\brian>bzr checkout
bzr+ssh://<email address hidden>/home/bazaar/dev/ticket_78 .
Connected (version 2.0, client OpenSSH_5.3p1)
Authentication (publickey) successful!
Secsh channel 1 opened.
bzr: ERROR: Failed to rename C:/brian/.bzr/checkout/limbo/new-3 to
C:/brian/src:
 [Error 5] Access is denied

Also, the .bzr.log is attached again for this attempt and my attempt to open the Explorer right after that.

Martin Packman (gz) wrote :

Brian, I'm still not clear from your report if running bzr explorer in that one location doesn't work, or if running bzr explorer doesn't work at all. I can see the issue with a broken checkout, and from your log also a variation on bug 922395, but you need to spell it out for me if there's still something that's not working for you.

Martin Packman (gz) wrote :

Alexander, right, I see two issues with the code. One is that the launchpad plugin tries to open the branch without dealing with the consequences, and on the bigger level, explorer does way too much work on init before running the qt main loop. That stops the pretty error handling from being used for code that's not actually essential for startup, giving a traceback or worse nothing at all if run from the shortcut.

Brian Cox (brian-cox) wrote :

Sorry for the confusion. Bzr explorer is not running at all.

Alexander Belchenko (bialix) wrote :

Brian, can you send me the content of "C:/Users/Skip/AppData/Roaming/bazaar/2.0/explorer" folder from affected machine?

Changed in bzr-explorer:
importance: Undecided → High

Brian Cox пишет:
> Thanks for your patience guys. Here is what I was able to find out this
> morning:
>
> 1. Please, show us the content of .bzr/branch/branch.conf file of
> affected branch.
>
> I restored the branch, but I did not see a branch.conf file. All I saw
> was a format file and a location file. (contents of location =
> bzr+ssh://<email address hidden>/home/bazaar/dev/skip/) Maybe I was
> looking in the wrong place?

No, that's fine. You had lightweight checkout, that's why there is no
branch.conf but only location file pointed to your dead server.
That's explain a thing or two about your problem but still don't make
the clear picture.

Brian, I'd like you to test the following workaround to suppress the error you've got.

Alexander Belchenko (bialix) wrote :

Also workaround code can be found in the branch: lp:~bialix/bzr-explorer/bug-925951

Brian Cox (brian-cox) wrote :

Contents of C:/Users/Skip/AppData/Roaming/bazaar/2.0/explorer attached.

Brian Cox (brian-cox) wrote :

I updated the code as requested and got this in my .bzr.log file:

this is a debug log for diagnosing/reporting problems in bzr
you can delete or truncate this file, or include sections in
bug reports to https://bugs.launchpad.net/bzr/+filebug

Tue 2012-02-07 16:26:41 -0700

[ 3104] 2012-02-07 16:26:41.707 INFO: tbzrcache running...

Tue 2012-02-07 16:26:43 -0700
0.047 bazaar version: 2.4.2
0.047 bzr arguments: [u'explorer']
0.063 looking for plugins in C:/Users/Skip/AppData/Roaming/bazaar/2.0/plugins
0.063 looking for plugins in C:/Program Files (x86)/Bazaar/plugins
0.125 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.437 Deprecated method called
Called from:
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 165, in __init__
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 257, in _refresh_user_configuration
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 264, in get_default_editor
0.437 loading explorer extensions for clothes ['Bazaar support', 'Register on Launchpad']
0.437 explorer extensions provided by the colo plugin in C:/Program Files (x86)/Bazaar/plugins/colo/explorer
0.515 failed to load system host keys: [Errno 2] No such file or directory: 'C:\\Users\\Skip/.ssh/known_hosts'
0.531 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 946, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1150, in run_bzr
  File "bzrlib\commands.pyo", line 699, in run_argv_aliases
  File "bzrlib\commands.pyo", line 721, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\commands.py", line 162, in run
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 243, in __init__
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 1976, in do_welcome
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 690, in changed_view
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 1085, in _get_hosted_web_url
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\hosted_url_resolver.py", line 49, in get_branch_url
AttributeError: 'module' object has no attribute 'SocketConectionError'

0.531 couldn't find apport bug-reporting library: No module named apport
0.531 return code 4

Alexander Belchenko (bialix) wrote :

Sorry, that's because of silly typo. Should be double-n in "SocketConnectionError"

Alexander Belchenko (bialix) wrote :

Brian, if you changed the code manually, please fix the typo. Or apply my patch, I've re-uploaded it.

Brian Cox (brian-cox) wrote :

Ah yes, I fat-fingered it when I typed it in.

But... Good news! This allowed me to finally open Bazaar Explorer and I was able to check out a branch. So I think we are all set for this user. I do have another user also unable to open Bazaar Explorer, but I'm willing to bet that it's the same issue.

Thank you both for all the help!

Brian Cox пишет:
> But... Good news! This allowed me to finally open Bazaar Explorer and I
> was able to check out a branch. So I think we are all set for this user.

That's good news indeed. I'm going to land this workaround to explorer's
trunk.

> I do have another user also unable to open Bazaar Explorer, but I'm
> willing to bet that it's the same issue.

I think so. If there will be another problem feel free to ask.

Changed in bzr-explorer:
assignee: nobody → Alexander Belchenko (bialix)
milestone: none → 1.2.2
status: Incomplete → Fix Committed
summary: - Branch on dead webhost in history prevents explorer opening
+ Lightweight checkout on dead webhost in history prevents explorer
+ opening
Changed in bzr-explorer:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions