"unable to rename" pack file when pushing to sftp server

Bug #421776 reported by TravisD
48
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin von Gagern

Bug Description

I get a strange error when trying to push a branch to a repository I have set up on my university sftp server. Here are the steps:

$ bzr init-repo --no-trees sftp://user@host/~/bzr_projects/SameGameSolver
Shared repository (format: pack-0.92)
Location:
  shared repository: sftp://user@host/~/bzr_projects/SameGameSolver/
$ bzr init sftp://user@host/~/bzr_projects/SameGameSolver/trunk
Created a repository branch (format: pack-0.92)
Using shared repository: sftp://user@host/~/bzr_projects/SameGameSolver/

$ bzr log
------------------------------------------------------------
revno: 1
committer: Travis Dick
branch nick: SameGameJava
timestamp: Sun 2009-08-30 12:11:09 -0600
message:
  Initial Import

$ bzr push sftp://user@host/~/bzr_projects/SameGameSolver/trunk
bzr: ERROR (ignored): GraphIndex('sftp://user@host/~/bzr_projects/SameGameSolver/.bzr/repository/indices/904bda77bfd1ba65ea5e551d8529329d.rix')
bzr: ERROR: Generic path error: 'gpcun2qkdun89kpbh9ch.pack': Failure: unable to rename to '../packs/904bda77bfd1ba65ea5e551d8529329d.pack')

Tags: easy packs sftp

Related branches

Revision history for this message
Martin Pool (mbp) wrote :

Thanks for the report.

Do you know what sftp server software is being used here?

Could you please look for the tracebacks for these errors in ~/.bzr.log and attach them to this bug?

summary: - can't push branch to sftp server
+ "unable to rename" pack file when pushing to sftp server
Changed in bzr:
status: New → Incomplete
importance: Undecided → Low
importance: Low → Medium
Revision history for this message
Jason Spashett (jspashett) wrote :

I get this if for some reason the sftp connection fails part way though, or I press ctrl-c. Server is as below on ubuntu 8.10

Package: openssh-server
Maintainer: Colin Watson <email address hidden>
Original-Maintainer: Debian OpenSSH Maintainers <email address hidden>
Architecture: i386
Source: openssh
Version: 1:5.1p1-3ubuntu1
Replaces: openssh-client (<< 1:3.8.1p1-11), ssh, ssh-krb5
Provides: ssh-server
Depends: libc6 (>= 2.8~20080505), libcomerr2 (>= 1.01), libkrb53 (>= 1.6.dfsg.2), libpam0g (>= 0.99.7.1), libselinux1 (>= 2.0.59), libssl0.9.8 (>= 0.9.8g-9), libwrap0 (>= 7.6-4~), zlib1g (>= 1:1.1.4), debconf (>= 1.2.0) | debconf-2.0, libpam-runtime (>= 0.76-14), libpam-modules (>= 0.72-9), adduser (>= 3.9), dpkg (>= 1.9.0), openssh-client (= 1:5.1p1-3ubuntu1), lsb-base (>= 3.2-13)

Jelmer Vernooij (jelmer)
Changed in bzr:
status: Incomplete → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

I can reproduce this by kicking off two simultaneous pushes of the same branch to the same location. They are both trying to create the same pack file. One of the succeeds first; the other will then probably see that the file already exists and its rename will fail. I guess the sftp rename error is too generic for bzr to understand that the problem is the destination file exists. It should be easy to teach it to check for that case.

./bzr push sftp://example/~/test
bzr: ERROR (ignored): 'sftp://example/~/test/.bzr/repository/upload/heip5l4m8068u548ad9q.pack'
bzr: ERROR: Generic path error: 'heip5l4m8068u548ad9q.pack': Failure: unable to rename to 'e26130c3dd7986d4ddcd43d3945367f9.pack')

tags: added: easy packs sftp
Revision history for this message
Martin von Gagern (gagern) wrote :

Attached script will reproduce the error on linux. Could be useful for testing.

It doesn't abort a real bzr connection, but instead simply creates a combination between a successful push that includes repacking and the state before the push, thus simulating a partial push. It doesn't take care to simulate the exact order in which bzr push will upload files, as I was content to know that the error exists in real life.

Interestingly enough, while original comment here as well as my own duplicate bug #516179 reported issues while overwriting an index file, that alone doesn't seem to be a problem with current bzr.dev, so I guess someone might have deliberately fixed that. Perhaps the fix could be reused in some way for pack files as well.

Revision history for this message
Martin Pool (mbp) wrote :

Thanks, Martin!

Changed in bzr:
assignee: nobody → Martin von Gagern (gagern)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.