Better ftp support for bzr push
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin Pool |
Bug Description
When trying to push to ftp, ran into three seperate issues that caused the operation to fail. After spending some time on irc://irc.
The command we're trying to get to work:
bzr push ftp://localhost
(from in a tiny branch consisting of just a "test.txt" file)
### 1 ###
First it failed with:
bzr: ERROR: socket.error: (10061, 'Connection refused')
and traceback.
This turned out to be a side effect of the server being set up so that it uses 'external' IP for PASV. Using aftp://
### 2 ###
Then failed (after some long time) with:
bzr: ERROR: Could not acquire lock LockDir(ftp://localhost
and hundreds of files like:
/somewhere/
The .bzr.log recorded lots of:
FTP mkd: /somewhere/
FTP put: /somewhere/
unable to understand error for path: /somewhere/
contention on LockDir(ftp://localhost
FTP get: /somewhere/
last_info: None, new info: None
So, this is bzr not understanding a real-world 550 error that should indicate NoSuchFile, and then behaving very badly (giving up at some point before 137 failed locks seems sensible).
### 3 ###
Then failed (after a short while) with:
bzr: ERROR: Generic path error: '/somewhere/
The ftp log shows it did do:
MKD /somewhere/
but doesn't create any of the sub-directories of /knits/ leading to an error when it tries to put a file in say, /65/ like so:
STOR /somewhere/
550 test.txt-
This is bzr not creating all the directories it needs to do the push, and not falling back to the right make-new-dir command on a particular failure condition.
(note, this is a somewhat simplified history, in the interests of clarity)
Changed in bzr: | |
assignee: | nobody → mbp |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in bzr: | |
status: | Confirmed → Fix Committed |
status: | Fix Committed → Confirmed |
So, solutions:
#1 Use aftp instead
#2 Understand "file doesn't exist" as NoSuchFile
#3 Fallback to mkdir when it's needed
Very simple patch attached, top part by me, bottom part from jam-laptop.