Bzr ftp support does not handle 250 response from Windows 2003 server for mkdir

Bug #224373 reported by Felix Otieno Okoth
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin Pool
Python
Fix Released
Unknown

Bug Description

Bellow is the stacktrace. I wonder if it is treating the response message from the remore folder as exceptions cause the message indicates success .

Environment:
Windows 2003 Server (the location where the command was run but I belive www.onlinefilefolder.com operates on Linux/Unix environment not sure though)
Dell Inspiron 530 Duol-core processor
Bazaar (bzr) 1.3.1

C:\Depot\Nyadendis\POS\BackEndModule>bzr push ftp://www.onlinefilefolder.com/Home/SourceDepot
bzr: ERROR: ftplib.error_reply: 250 Create folder operation successful.

Traceback (most recent call last):
  File "bzrlib\commands.pyc", line 834, in run_bzr_catch_errors
  File "bzrlib\commands.pyc", line 790, in run_bzr
  File "bzrlib\commands.pyc", line 492, in run_argv_aliases
  File "bzrlib\builtins.pyc", line 776, in run
  File "bzrlib\transport\__init__.pyc", line 1664, in do_catching_redirections
  File "bzrlib\builtins.pyc", line 768, in make_directory
  File "bzrlib\transport\ftp.pyc", line 349, in mkdir
  File "ftplib.pyc", line 521, in mkd
  File "ftplib.pyc", line 619, in parse257
error_reply: 250 Create folder operation successful.

bzr 1.3.1 on python 2.5.2.final.0 (win32)
arguments: ['bzr', 'push', 'ftp://www.onlinefilefolder.com/Home/SourceDepot']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  launchpad C:\Program Files\Bazaar\plugins\launchpad [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

C:\Depot\Nyadendis\POS\BackEndModule>

Tags: easy ftp win32

Related branches

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

It seems that the server is *supposed* to return a response code of 257, not 250.
250 Requested file action okay, completed.
257 "PATHNAME" created.

According to:
http://www.altools.com/image/support/alftp/ALFTP_35_help/FTP_response_codes_rfc_959_messages.htm

We probably could trap and specifically allow 250. Otherwise it should be considered a bug in the Python standard library ftplib ftp processing.

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 224373] Re: bzr push ftp://www.onlinefilefolder.com/ to a folder path throws exception after creating the first folder

On Tue, 2008-04-29 at 20:15 +0000, John A Meinel wrote:
> It seems that the server is *supposed* to return a response code of 257, not 250.
> 250 Requested file action okay, completed.
> 257 "PATHNAME" created.
>
> According to:
> http://www.altools.com/image/support/alftp/ALFTP_35_help/FTP_response_codes_rfc_959_messages.htm
>
> We probably could trap and specifically allow 250. Otherwise it should
> be considered a bug in the Python standard library ftplib ftp
> processing.

Let me just say 'yay microsoft'. Recently we've had to add a workaround
to squid for microsoft violating RFC2616 as well on microsoft.com, so it
is no surprise to find this too.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
FooBar (foobar-jaspervries) wrote :

Hi, I'm new to Bazaar. While still trying to figure stuff out, I ran into this very error while trying to set up a central repository using ftp.
Bazaar 1.12 on Win Vista and ftp server on *NIX. Is there a workaround of fix other than using a different ftp server or operating system?

Here's the traceback:

e:\>bzr push ftp://<email address hidden>/firs
FTP <email address hidden> password:
bzr: ERROR: ftplib.error_reply: 250 Directory created.

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 896, in run_bzr_catch_errors
  File "bzrlib\commands.pyo", line 842, in run_bzr
  File "bzrlib\commands.pyo", line 542, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 981, in run
  File "bzrlib\push.pyo", line 82, in _show_push_branch
  File "bzrlib\transport\__init__.pyo", line 1680, in do_catching_redirections
  File "bzrlib\push.pyo", line 73, in make_directory
  File "bzrlib\transport\ftp\__init__.pyo", line 355, in mkdir
  File "ftplib.pyo", line 521, in mkd
  File "ftplib.pyo", line 619, in parse257
error_reply: 250 Directory created.

bzr 1.12 on python 2.5.2 (win32)
arguments: ['bzr', 'push', 'ftp://<email address hidden>/fir
s']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [1.12]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [unknown]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store
[unknown]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.9.8]
  svn C:\Program Files\Bazaar\plugins\svn [0.5.2]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Revision history for this message
alphablue52 (torsten-doerschel) wrote :

Cause of bug:
Windows Server does not respond according to RFC959 with code 257 for a successful directory creation but 250.
That causes python ftplib to raise the error.
That in turn keeps bazaar from using windows server ftp webspace.

This effects all Strato users, like me.

Suggested solution:
go for a "try" in python!

Sorry, I am learning python myself right now and want to use bazaar+webspace for my project. Central repo required b/c I develop on different desktops (home, 2*work). No rights to install another VCS on my webspace.
Please please! As far as I can see this is easy to fix! But I don't know how to browse bzr code, and create+submit a patch here. For me this is a critical bug!

Martin Pool (mbp)
tags: added: easy ftp win32
Martin Pool (mbp)
Changed in bzr:
status: Confirmed → In Progress
assignee: nobody → Martin Pool (mbp)
Revision history for this message
Martin Pool (mbp) wrote :

Thanks for all the tracebacks.

There's a proposed fix here: https://code.edge.launchpad.net/~mbp/bzr/224373-2.2-ftp-response/+merge/32731

If someone would like to check out that bzr branch and try running it, and tell us whether it fixes it, that would be great.

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

It would be nice to also fix this in upstream python <http://bugs.python.org/issue9601>, but there seems it will only go into python 3.2 and perhaps not even then. So it's still worth working around it in bzr.

Changed in python:
status: Unknown → New
Revision history for this message
FooBar (foobar-jaspervries) wrote :

I'm not using bzr any more, but if you like I can give temporary access to a Strato ftp location.
Just send me an email and I can set something up.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 224373] Re: Bzr ftp support does not handle 250 response from Windows 2003 server for mkdir

Apparently I can get a free trial account from onlinefilefolder.com so
I'll try that...

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

I tested this branch against an onlinefilefolder.com account, and it does let the mkdir succeed. So I think this is worth merging, at least to trunk. Unfortunately it then fails because the lock info file can't be read after it's created, I would presume because there's an incoherent server side cache or something similar.

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

The other problem is probably bug 412244: just after you create a file, the Windows ftp server says it doesn't exist. I might try polling to see if it was actually there.

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

It turns out onlinefilefolder.com at least claims to be running vsftp, not windows ftpd. The bug is a bit like bug 412244, but not quite the same. At the moment my uploads fail with

"FTP temporary error: 451 Failure writing to OFF database, saving file, 1003.."

which I think is not something we can do much about. The only other description of this is <http://www.computergripes.com/onlinefilefolder.html>

To summarize, the fix for the "250" error should be in bzr2.2.1 and the next 2.2beta. If people hit other problems please let us know; I'm not going to push this any further today.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 224373] Re: Bzr ftp support does not handle 250 response from Windows 2003 server for mkdir

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

Martin Pool wrote:
> It turns out onlinefilefolder.com at least claims to be running vsftp,
> not windows ftpd. The bug is a bit like bug 412244, but not quite the
> same. At the moment my uploads fail with
>
> "FTP temporary error: 451 Failure writing to OFF database, saving file,
> 1003.."
>
> which I think is not something we can do much about. The only other
> description of this is
> <http://www.computergripes.com/onlinefilefolder.html>
>
> To summarize, the fix for the "250" error should be in bzr2.2.1 and the
> next 2.2beta. If people hit other problems please let us know; I'm not
> going to push this any further today.
>

You mean 2.3beta, right?

John
=:->

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

iEYEARECAAYFAkxqCqEACgkQJdeBCYSNAANL1gCgtTqPEkOdBN6oJnINBNI1V1/c
5nIAn2HnXeMQ8WQeKijQWUt6IlUSonNC
=AU3b
-----END PGP SIGNATURE-----

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 224373] Re: Bzr ftp support does not handle 250 response from Windows 2003 server for mkdir

On 17 August 2010 14:05, John A Meinel <email address hidden> wrote:
> You mean 2.3beta, right?

Yes

Revision history for this message
alphablue52 (torsten-doerschel) wrote :

@ #5: Thank you Martin! This fix is working on my Strato webspace. Now I can start using bazaar.

One question: How can I apply this fix to the Windows version of Bazaar? I found the transport/ftp/__init__.pyo inside the library.zip there, but do not know how to compile this bytefile.

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

On 18 August 2010 06:37, alphablue52 <email address hidden> wrote:
> @ #5: Thank you Martin! This fix is working on my Strato webspace. Now I
> can start using bazaar.

Great, thanks for letting us know.

> One question: How can I apply this fix to the Windows version of Bazaar?
> I found the transport/ftp/__init__.pyo inside the library.zip there, but
> do not know how to compile this bytefile.

You shouldn't need to compile it; just put the .py file into the
library in the appropriate place. There should be a Windows build of
the next beta fairly soon.

--
Martin

Changed in python:
status: New → Fix Released
Martin Packman (gz)
Changed in bzr:
milestone: none → 2.2.0
status: In Progress → Fix Released
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.