Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Rebol, FTP and quotas

 [1/11] from: henrik:webz:dk at: 9-Mar-2002 13:57


Hi I'm getting a quota problem with two different ftp-servers, when I try to manipulate (delete, write) the files on the ftp-server: ftp-dir: <some-ftp-server> files: read ftp-dir foreach file files [delete ftp-dir/:file] gives: User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes Why is this an error?? The servers work perfectly outside Rebol and I can manipulate files normally. Reading directories works fine, but trying to read the contents of a file gives: User Error: Server error: tcp 200 PORT command successful. This seems illogical to me. :-) Regards, Henrik Mikael Kristensen

 [2/11] from: gscottjones::mchsi::com at: 9-Mar-2002 9:21


From: "Henrik Mikael Kristensen"
> I'm getting a quota problem with two different ftp-servers, when I try to
manipulate (delete, write) the files on the ftp-server:
> ftp-dir: <some-ftp-server> > > files: read ftp-dir > foreach file files [delete ftp-dir/:file] > > gives: > > User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes > > Why is this an error??
I don't know either, but, depending on your needs, you may be able to achieve similar functionality with the following: ftp-dir: ftp://user-name:[user-pass--ftp--my-ftp-site--com]/a-folder/ files: read ftp-dir foreach file files [delete join ftp-dir [file]]
> The servers work perfectly outside Rebol and I can manipulate files
normally.
> Reading directories works fine, but trying to read the contents of a file
gives:
> User Error: Server error: tcp 200 PORT command successful.
Are you using a form soemthing like the following to read the contents of a file? ftp-dir: ftp://user-name:[user-pass--ftp--my-ftp-site--com]/a-folder/ print read ftp-dir ["a-file-name"]
> <rest snipped>
Hope this helps. --Scott Jones

 [3/11] from: henrik:webz:dk at: 9-Mar-2002 22:03


09-03-2002 16:21:14, "G. Scott Jones" <[gscottjones--mchsi--com]> wrote:
>From: "Henrik Mikael Kristensen" >> I'm getting a quota problem with two different ftp-servers, when I try to
<<quoted lines omitted: 15>>
>files: read ftp-dir >foreach file files [delete join ftp-dir [file]]
Same result... but I just figured that it's not just manipulation which goes wrong this way (I should have checked the directory contents before posting. Sorry...). When it's empty or I input a wrong filepath, I get "User Error: Server error: tcp 200 PORT command successful.". So the 200 error is forgivable. But every time I access a correct file, I get 226 Quota errors. And this only happens with two servers: A local ProFTPD and an a remote ProFTPD ftp-server. Others work just fine (including other ProFTPD servers). I have no firewall set up. Could this be a ProFTPD config problem? I tried 'trace/net on' and the following output was generated when I tried to access a file in a directory:
>> print read join ftp-dir ["<dir-to-read-from>"]
URL Parse: <user> <pass> <url> none none <dir-to-read-from> Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<server>)]} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <some-server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ [join "LIST " port/target] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." Net-log: [ ["PORT" port/locals/active-check] "200"] ** User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes ** Near: print read join ftp-dir ["<dir-to-read-from>"] It seems the ftp-transfer itself is successful, but Rebol chokes after that.
> The servers work perfectly outside Rebol and I can manipulate files
normally.
> Reading directories works fine, but trying to read the contents of a file
gives:
> User Error: Server error: tcp 200 PORT command successful. > Are you using a form soemthing like the following to read the contents of a file? > ftp-dir: ftp://user-name:[user-pass--ftp--my-ftp-site--com]/a-folder/ > print read ftp-dir ["a-file-name"]
Irrelevant now, but it is the url-syntax you mentioned which I use.
> Hope this helps.
Well, it didn't... dammit :-) Regards, Henrik Mikael Kristensen

 [4/11] from: dockimbel:free at: 9-Mar-2002 22:16


Hi, As far as i understand, this kind of errors occurs because the FTP handler doesn't recognize the response code sent by the server. Try this patch before starting your ftp session :
>> system/schemes/ftp/handler/rmfile-check/2: ["250" "226"] >> append system/schemes/ftp/handler/read-check/2 "200"
When you encounter such error, you should turn trace/net on and if possible, send the log to the ml. HTH, -DocKimbel. Henrik Mikael Kristensen wrote:

 [5/11] from: dockimbel:free at: 10-Mar-2002 0:39


Hi Henrik, This patch will correct your error:
>> system/schemes/ftp/handler/active-check/2: ["200" "226"]
-DocKimbel. Henrik Mikael Kristensen wrote: [...]

 [6/11] from: henrik:webz:dk at: 10-Mar-2002 2:01


09-03-2002 22:16:35, Nenad Rakocevic <[dockimbel--free--fr]> wrote:
>Hi, > >As far as i understand, this kind of errors occurs because the FTP handler doesn't recognize the response code sent by >the server.
OK
>Try this patch before starting your ftp session : > >>> system/schemes/ftp/handler/rmfile-check/2: ["250" "226"] >>> append system/schemes/ftp/handler/read-check/2 "200" >When you encounter such error, you should turn trace/net on and if possible, send the log to the ml. > >HTH, > >-DocKimbel. >
ok, thanks, I tried it and this is the result from a fresh new rebol session (usernames, passwords and urls removed):
>> system/schemes/ftp/handler/rmfile-check/2: ["250" "226"]
== [ ["DELE" port/locals/file] ["250" "226"] ]
>> append system/schemes/ftp/handler/read-check/2 "200"
== ["150" "125" "200"]
>> trace/net on >> ftp-dir: ftp://<user>:<pass>@<url>/path/
== ftp://<user>:<pass>@<url>/path/ Now I tried reading the directory which was empty:
>> print read ftp-dir
URL Parse: <user> <pass> <url> none path/ none Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<path>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ ["LIST"] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: [ "PASV" "227"] ** User Error: Server error: tcp 200 PORT command successful. ** Near: print read ftp-dir Same as before. Then I put a file there manually with an FTP-program:
>> print read ftp-dir
URL Parse: <user> <pass> <url> none path/ none Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<server>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ ["LIST"] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." file.txt Which seemed to work just fine Then I tried to read the contents of the file:
>> print read join ftp-dir ["file.txt"]
URL Parse: <user> <pass> <url> none path/ none Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<server>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ [join "LIST " port/target] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." Net-log: [ ["PORT" port/locals/active-check] "200"] ** User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes ** Near: print read join ftp-dir ["file.txt"] Again same error as before. Just to make sure:
>> print join ftp-dir ["file.txt"]
ftp://<user>:<pass>@<url>/path/file.txt The syntax for the URL is correct.
>> system/version
== 1.2.1.3.1 and it's Rebol/View I'm running. Regards, Henrik Mikael Kristensen

 [7/11] from: henrik:webz:dk at: 10-Mar-2002 3:19


Hi, Doc 10-03-2002 00:39:22, Nenad Rakocevic <[dockimbel--free--fr]> wrote:
>This patch will correct your error: >>> system/schemes/ftp/handler/active-check/2: ["200" "226"]
Thanks! :-) It helped along with the two other patches, but another error shows up (session continued from last posting):
>> system/schemes/ftp/handler/active-check/2: ["200" "226"]
== [ ["PORT" port/locals/active-check] ["200" "226"] ]
>> print read join ftp-dir ["file.txt"]
URL Parse: <user> <pass> <url> none path/ file.txt Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<server>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] ["200" "226"]] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ [join "LIST " port/target] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." Net-log: [ ["PORT" port/locals/active-check] ["200" "226"]] Net-log: "226 Quotas on: using 0.00 of 10.00 MegaBytes" Net-log: [ ["TYPE I"] ["200"]] Net-log: "200 PORT command successful." Net-log: [ ["RETR" port/target] ["150" "125" "200"]] Net-log: "200 Type set to I." Net-log: ["low level read of " 1985 "bytes"] Net-log: ["low level read of " 1485 "bytes"] Net-log: ["low level read of " 985 "bytes"] Net-log: ["low level read of " 485 "bytes"] Net-log: [ none "226"] ** Access Error: Port none not open ** Where: halt-view ** Near: print read join ftp-dir ["file.txt"] I've seen this one before in another posting, where the directory was empty, but it's not empty here and I'm sure I'm reading the file correctly. Actually I performed this three times (I've shown the second, the third is identical to the second), but the first one didn't show the last two low level reads: Net-log: ["low level read of " 985 "bytes"] Net-log: ["low level read of " 485 "bytes"] as if it stops reading at a random position. file.txt is 1985 bytes long, so I presume it has been read correctly, but other things are still considered garbage to Rebol.
>> Net-log: [ >> ["PORT" port/locals/active-check] "200"] >> ** User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes >> ** Near: print read join ftp-dir ["<dir-to-read-from>"]
Regards, Henrik Mikael Kristensen

 [8/11] from: brett:codeconscious at: 10-Mar-2002 14:02


Hi
> User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes
Try this line and repeat your tests: do http://www.codeconscious.com/rebsite/rebol-library/patches.r If fixes a bug in the FTP scheme that handles response 226. The bug does not exist in some later versions of Rebol. Brett.

 [9/11] from: henrik::webz::dk at: 10-Mar-2002 6:23

Re: Rebol, FTP and quotas (fixed!)


Hi, Brett 10-03-2002 04:02:51, "Brett Handley" <[brett--codeconscious--com]> wrote:
>Hi > >> User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes > >Try this line and repeat your tests: > > do http://www.codeconscious.com/rebsite/rebol-library/patches.r
ok, here goes (fresh rebol session):
>> do %/c/rebol/patches.r
== {Replace DEBASE to avoid crash - Applied. ctx-text/back-field to cycle properly - Applied. FTP Scheme for 226 multiline server r...
>> ftp-dir: ftp://<user>:<pass>@<url>/path/ >> trace/net on >> print read join ftp-dir ["file.txt"]
URL Parse: <user> <pass> <url> none path/ file.txt Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<server>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ [join "LIST " port/target] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." Net-log: [ ["PORT" port/locals/active-check] "200"] ** User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes ** Near: print read join ftp-dir ["file.txt"] Nope. Same error. But not to worry, this has a happy ending. :-) I checked if it really applied it (fresh rebol session):
>> print do http://www.codeconscious.com/rebsite/rebol-library/patches.r
Replace DEBASE to avoid crash - Applied. ctx-text/back-field to cycle properly - Applied. FTP Scheme for 226 multiline server response bug - Not Applied. and it didn't.
>If fixes a bug in the FTP scheme that handles response 226. >The bug does not exist in some later versions of Rebol.
Which is why it doesn't apply the 226 patch. I checked my Rebol/View version
>> system/version
== 1.2.1.3.1 Then I peeked at your code and changed the minimum version number from 1.2.0.255.255 to 1.2.1.255.255 so the patch would be applied to Rebol/view. After that the 226 error was gone! Thanks for your help everyone. :-) Regards, Henrik Mikael Kristensen

 [10/11] from: chalz:earthlink at: 10-Mar-2002 1:17

Re: Rebol, FTP and quotas


Something just struck me, and I'm kind of late replying, so smack me on the side of the head if it's already been fixed. For instance: files: read ftp-dir foreach file files [delete join ftp-dir [file]] Wouldn't that attempt to delete . and .. not to mention subdirectories (which can result in a no-no - haven't tried it with REBOL)? --Charles

 [11/11] from: brett:codeconscious at: 10-Mar-2002 20:22

Re: Rebol, FTP and quotas (fixed!)


Hi,
> Then I peeked at your code and changed the minimum version number from
1.2.0.255.255 to 1.2.1.255.255 so the patch would be applied to Rebol/view.
> After that the 226 error was gone!
Thats great :) Looks like the system version check in patches.r is too conservative. I'll change it. Regards, Brett.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted