Please check earlier for error condition "Target directory "%s" already exists." (in 'bzr branch')

Bug #564953 reported by Daniel Hahler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
bzr (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: bzr

bzr took 15 seconds to error out with "target directory" already exists.

Please check earlier for this.

$ time bzr branch lp:ubuntu/popfile
bzr: ERROR: Target directory "popfile" already exists.

real 0m14.997s
user 0m0.240s
sys 0m0.104s

$ rm -rf popfile
$ time bzr branch lp:ubuntu/popfile
Branched 12 revision(s).

real 0m13.247s
user 0m2.028s
sys 0m0.300s

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: bzr 2.1.1-1
ProcVersionSignature: Ubuntu 2.6.32-21.31-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-generic i686
Architecture: i386
Date: Fri Apr 16 21:27:41 2010
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: bzr

Revision history for this message
Daniel Hahler (blueyed) wrote :
Andrew Bennetts (spiv)
summary: Please check earlier for error condition "Target directory "%s" already
- exists."
+ exists." (in 'bzr branch')
Changed in bzr (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Robert Collins (lifeless) wrote :

We already check as pretty much the second thing we do:
 - we open the branch
 - we mkdir the target directory.

So if its taking 15 seconds, this bug probably really wants to be 'taking 15 seconds to open a branch'. Could you please run with bzr -Dhpss and attach the ~/.bzr.log output for that? Thanks.

Changed in bzr (Ubuntu):
status: Confirmed → Incomplete
Changed in bzr:
status: New → Incomplete
Revision history for this message
Andrew Bennetts (spiv) wrote : Re: [Bug 564953] Re: Please check earlier for error condition "Target directory "%s" already exists." (in 'bzr branch')

Robert Collins wrote:
> We already check as pretty much the second thing we do:
> - we open the branch
> - we mkdir the target directory.
>
> So if its taking 15 seconds, this bug probably really wants to be
> 'taking 15 seconds to open a branch'. Could you please run with bzr
> -Dhpss and attach the ~/.bzr.log output for that? Thanks.

Well, "open the branch" often involves resolving “lp:foo” into a real
URL, and then that real location is often a bzr+ssh URL. The SSH
handshake, plus multiple HPSS calls to open the branch (4 IIRC, and more
if stacked)... so more than 5 seconds would be pretty common I think.

15 seconds seems a bit high, so I'm also interested in the -Dhpss output
in this case, but I think this is a valid bug regardless.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 564953] Re: Please check earlier for error condition "Target directory "%s" already exists." (in 'bzr branch')

I think its a valid bug, but checking the target dir earlier will add
unnecessary network round trips, so I don't think its valid *as described*.

Revision history for this message
Daniel Hahler (blueyed) wrote :
Download full text (4.8 KiB)

Cannot you run this yourself?
What's your time for the same command?

$ time bzr -Dhpss branch lp:ubuntu/popfile > /tmp/foo.log
Branched 13 revision(s).uild phase:Apply phase:adding file 20/26
HPSS calls: 11 (0 vfs) SmartSSHClientMedium(bzr+ssh://<email address hidden>/)

real 0m19.047s
user 0m0.508s
sys 0m0.184s

Mo 2010-04-19 19:31:49 +0200
0.937 bazaar version: 2.1.1
0.937 bzr arguments: [u'-Dhpss', u'branch', u'lp:ubuntu/popfile']
1.337 looking for plugins in /home/daniel/.bazaar/plugins
3.439 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
3.596 Plugin name fastimport already loaded
3.840 Plugin name search already loaded
4.034 Plugin name bzrtools already loaded
4.544 encoding stdout as sys.stdin encoding 'UTF-8'
5.977 hpss: Built a new medium: SmartSSHClientMedium
5.985 hpss call: 'BzrDir.open_2.1', '~ubuntu-branches/ubuntu/lucid/popfile/lucid/'
5.985 (to bzr+ssh://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile/lucid/)
6.928 ssh implementation is OpenSSH
12.917 result: ('yes', 'no')
12.918 hpss call: 'BzrDir.open_branchV3', '~ubuntu-branches/ubuntu/lucid/popfile/lucid/'
12.918 (to bzr+ssh://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile/lucid/)
13.046 result: ('branch', 'Bazaar Branch Format 7 (needs bzr 1.6)\n')
13.047 hpss call: 'BzrDir.find_repositoryV3', '~ubuntu-branches/ubuntu/lucid/popfile/lucid/'
13.047 (to bzr+ssh://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile/lucid/)
13.114 result: ('ok', '', 'yes', 'no', 'yes', 'Bazaar repository format 2a (needs bzr 1.16 or later)\n')
13.136 hpss call: 'Branch.get_stacked_on_url', '~ubuntu-branches/ubuntu/lucid/popfile/lucid/'
13.136 (to bzr+ssh://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile/lucid/)
13.204 result: ('NotStacked',)
13.204 hpss call: 'Branch.last_revision_info', '~ubuntu-branches/ubuntu/lucid/popfile/lucid/'
13.204 (to bzr+ssh://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile/lucid/)
13.278 result: ('ok', '13', '<email address hidden>')
13.325 hpss call: 'BzrDir.cloning_metadir', '~ubuntu-branches/ubuntu/lucid/popfile/lucid/', 'False'
13.325 (to bzr+ssh://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile/lucid/)
13.382 result: ('Bazaar-NG meta directory, format 1\n', 'Bazaar repository format 2a (needs bzr 1.16 or later)\n', ('bran
14.206 Using fetch logic to copy between RemoteRepository(bzr+ssh://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile
14.206 fetch up to rev {<email address hidden>}
14.207 hpss call w/body: 'Repository.get_parent_map', '~ubuntu-branches/ubuntu/lucid/popfile/lucid/', 'include-missing:', 'ubu
<email address hidden>' ('\n\n0'...)
14.207 3 bytes
14.265 result: ('ok',)
14.265 731 body bytes read
14.376 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x99b8acc> in f...

Read more...

Changed in bzr:
status: Incomplete → Confirmed
status: Confirmed → New
Revision history for this message
Robert Collins (lifeless) wrote :

Yes I can run it, but if you are the one seeing a problem, it can be an
environmental issue. And, at least partly, it is:

4.544 encoding stdout as sys.stdin encoding 'UTF-8'

It takes you 4.5 seconds to get bzr up and running.

5.977 hpss: Built a new medium: SmartSSHClientMedium

1.5 seconds to do the lp: lookup and determine the url to branch from

5.985 (to bzr+ssh://
bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/popfile/lucid/<http://bazaar.launchpad.net/%7Eubuntu-branches/ubuntu/lucid/popfile/lucid/>
)
6.928 ssh implementation is OpenSSH

1 second to probe for your SSH command.

12.917 result: ('yes', 'no')

6 seconds to log into launchpad over ssh.

After that it proceeds reasonably quickly.

-Rob

Revision history for this message
Daniel Hahler (blueyed) wrote :

So, what's the environment issue exactly?
Therefore it might be interesting to have output for comparison.

(btw: this is with a cold disk cache)

Changed in bzr (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Robert Collins (lifeless) wrote :

Its taking 5 seconds after loading bzr's core to finish loading enough to
start processing your command. --profile-imports might help diagnose that.

Revision history for this message
Daniel Hahler (blueyed) wrote :

This fails with:
$ bzr --profile-imports
Traceback (most recent call last):
  File "/usr/bin/bzr", line 59, in <module>
    import profile_imports
ImportError: No module named profile_imports

I've found https://lists.ubuntu.com/archives/bazaar/2006q2/013825.html and tried it with "lp:bzr":

daniel@base { /tmp/bzr }
$ ./bzr --profile-imports branch lp:ubuntu/popfile > /tmp/bzr-profile-imports.log 2>&1

Output attached - hope that helps (and makes sense).

Vincent Ladeuil (vila)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.