Bug 28361 - Cannot cope with servers blocking multiple connections
Summary: Cannot cope with servers blocking multiple connections
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: ftp (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 62221 95233 121024 200911 227160 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-07-07 15:18 UTC by Unknown
Modified: 2010-08-04 17:24 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Faure 2001-07-07 14:58:09 UTC
On Saturday 07 July 2001 17:03 alane@geeksrus.net wrote:
> Package: konqueror
> Version: cvs 20010629 (using KDE 2.2.0 CVS/CVSup/Snapshot)
> Severity: normal
> Installed from:    Compiled sources
> Compiler:          gcc-2.96-93
> OS:                Linux
> OS/Compiler notes: Not Specified
> 
> Try:
> 
>  ftp://ftp.netwinder.org/pub/build/gcc/i386/20010707/summary.log
> 
> works fine w/commandline ftp client (or ncftpget "url"). konqueror says it needs a username and password. even if i give it "anonymous" + email-addr it still fails ("Login failed").

Works for me with Konqueror.
Are you using a proxy ?
What is the debug output from kio_ftp ? (you can find it in ~/.xsession-errors or ~/.X.err
or in the terminal where you restart kdeinit)
Maybe the site was just too busy (kio_ftp can't detect the difference in
error message between that and password needed).
I assume you get the same on simply "ftp://ftp.netwinder.org/" ?

-- 
David FAURE david@mandrakesoft.com faure@kde.org
http://perso.mandrakesoft.com/~david/ http://www.konqueror.org/
KDE Making The Future of Computing Available Today
Comment 1 Alan Eldridge 2001-07-07 15:03:56 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           konqueror
Version:           cvs 20010629 (using KDE 2.2.0 CVS/CVSup/Snapshot)
Severity:          normal
Installed from:    Compiled sources
Compiler:          gcc-2.96-93
OS:                Linux
OS/Compiler notes: Not Specified

Try:

 ftp://ftp.netwinder.org/pub/build/gcc/i386/20010707/summary.log

works fine w/commandline ftp client (or ncftpget "url"). konqueror says it needs a username and password. even if i give it "anonymous" + email-addr it still fails ("Login failed").

this is not a password protected site.


(Submitted via bugs.kde.org)
Comment 2 Alan Eldridge 2001-07-08 02:51:28 UTC
On Saturday 07 July 2001 10:58 am you wrote:
> On Saturday 07 July 2001 17:03 alane@geeksrus.net wrote:
> > Package: konqueror
> > Version: cvs 20010629 (using KDE 2.2.0 CVS/CVSup/Snapshot)
> > Severity: normal
> > Installed from:    Compiled sources
> > Compiler:          gcc-2.96-93
> > OS:                Linux
> > OS/Compiler notes: Not Specified
> >
> > Try:
> >
> >  ftp://ftp.netwinder.org/pub/build/gcc/i386/20010707/summary.log
> >
> > works fine w/commandline ftp client (or ncftpget "url"). konqueror says
> > it needs a username and password. even if i give it "anonymous" +
> > email-addr it still fails ("Login failed").
>
> Works for me with Konqueror.

Using konqueror cvs 20010629 fails everytime.
Using ncftpget suceeds every time.
Site is not loaded with users.

> Are you using a proxy ?

Using direct connection.

> What is the debug output from kio_ftp ? (you can find it in
> ~/.xsession-errors or ~/.X.err or in the terminal where you restart
> kdeinit)

No output. I'll have to rebuild it I guess. What needs to be rebuilt with 
debugging output on?

> Maybe the site was just too busy (kio_ftp can't detect the difference in
> error message between that and password needed).

See above. Never a failure using ncftpget. Start 'em one right after the 
other.


> I assume you get the same on simply "ftp://ftp.netwinder.org/" ?

Nope. Different. First time works OK. Try it again in the same window or try 
to go down to a subdir by selecting its icon and 1) first time get "timeout 
on ftp.netwinder.org" but 2) all subsequent times get "Error. Could not write 
to file.". Try a new konqueror window and it works the first time again. 
There's something state-dependent that is getting mucked up it looks like.
Comment 3 Alan Eldridge 2001-07-08 02:59:12 UTC
On Saturday 07 July 2001 10:58 am you wrote:
> On Saturday 07 July 2001 17:03 alane@geeksrus.net wrote:
> > Package: konqueror
> > Version: cvs 20010629 (using KDE 2.2.0 CVS/CVSup/Snapshot)
> > Severity: normal
> > Installed from:    Compiled sources
> > Compiler:          gcc-2.96-93
> > OS:                Linux
> > OS/Compiler notes: Not Specified
> >
> > Try:
> >
> >  ftp://ftp.netwinder.org/pub/build/gcc/i386/20010707/summary.log
> >
> > works fine w/commandline ftp client (or ncftpget "url"). konqueror says
> > it needs a username and password. even if i give it "anonymous" +
> > email-addr it still fails ("Login failed").
>

More detail. 

First time I click on the URL above in KMail:

1. Opening connection .... dialog box w/progress bar.
2. "Save to disk" "Open" "Cancel" dialog box. Select "Open".
3. Open with application.... dialog box. Select "Editors/text editor".
4. Opening connection .... dialog box w/progress bar.
5. User/password dialog. Enter anonymous/email-addr.
6. "Login failed.'

Click on same link in Kmail a second and subsequent times:

Skip straight to (3) above.

We skip the "Save" dialog box on all subsequent attempts to open. So I can't 
change my mind now about just saving it.
Comment 4 Alan Eldridge 2001-07-08 03:11:35 UTC
Stopping and restarting KMail has no effect. I have lost the ability to save 
this file to disk instead of opening it with an application *from* *KMail*.

However since I've been wanting to try this I started new Konqeror window 
pasted the full file URL in there and chose "Save to disk". Saves perfectly.

So looks like there may be more than one thing going on and the 
username/password problem only manifests when I have to pick an application 
to open the file with. Save to disk works fine doesn't ask me anything.

Now about those "Error. Could not write to file." dialogs... Write to WHAT? 
WTF is it trying to write to? And why do those only occur following the 
"timeout" which only occurs on the second attempt (and none thereafter) at 
the same ftp server from the same window?

----------  Forwarded Message  ----------

First time I click on the URL above in KMail:

1. Opening connection .... dialog box w/progress bar.
2. "Save to disk" "Open" "Cancel" dialog box. Select "Open".
3. Open with application.... dialog box. Select "Editors/text editor".
4. Opening connection .... dialog box w/progress bar.
5. User/password dialog. Enter anonymous/email-addr.
6. "Login failed.'

Click on same link in Kmail a second and subsequent times:

Skip straight to (3) above.

We skip the "Save" dialog box on all subsequent attempts to open. So I can't
change my mind now about just saving it.

-------------------------------------------------------
Comment 5 Dawit Alemayehu 2001-07-08 05:59:00 UTC
On Saturday 07 July 2001 22:51 Alan Eldridge wrote:
> On Saturday 07 July 2001 10:58 am you wrote:
> > On Saturday 07 July 2001 17:03 alane@geeksrus.net wrote:
> > >  ftp://ftp.netwinder.org/pub/build/gcc/i386/20010707/summary.log
> > >
> > > works fine w/commandline ftp client (or ncftpget "url"). konqueror says
> > > it needs a username and password. even if i give it "anonymous" +
> > > email-addr it still fails ("Login failed").
> >
> > Works for me with Konqueror.
>
> Using konqueror cvs 20010629 fails everytime.
> Using ncftpget suceeds every time.
> Site is not loaded with users.
>
> > Are you using a proxy ?
>
> Using direct connection.
>
> > What is the debug output from kio_ftp ? (you can find it in
> > ~/.xsession-errors or ~/.X.err or in the terminal where you restart
> > kdeinit)
>
> No output. I'll have to rebuild it I guess. What needs to be rebuilt with
> debugging output on?

Don't bother.  I already know the reason why but I do not know if there is much
that can be done besides forcing kio_ftp to close the connection after it does a
"stat" and presenting a more appropriate prompt to the user whenever login fails
for whatever reason...

This particular problem occurs because ftp.netwinder.org restricts all users (at least
all anonymous ones) to a single connection at a time!!  You can duplicate this using 
any two ftp clients.  Just simply attempt to login in with the second client without 
logging out from the first one and see the response you get.  

The reason why you get the password prompt in konuqeror is as David already explained 
the FTP protocol does not use unique status codes for different responses and as such 
kio_ftp does not know how to distinguish when it should or should not prompt for 
password!

Anyways the failure when you click from kmail occur for the same reason I mentioned
above.  That is two separate kio_ftp's are used to fullfil the request.  The first one 
attempts to "stat" the remote machine to find out what type of resource it is dealing with
(file directory file size) so it can properly decide what application to open it with.  However
when the "stat" completes sucessfully the connection is not closed and the scheduler thinks
that this io-slave is busy and attempts to open a new connection to the remote machine which
of course results in an error message because this particular machine does not allow more than
one connection at a time!  AFAICT all the other errors you mentioned also seem to stem from 
this issue since the second connection is not properly closed once the server returns an error 
refusing to connect.

Regards
Dawit A.
Comment 6 Willy De la Court 2003-03-26 16:10:44 UTC
It seesm it has nothing to do with the ftp io_slave. I see two ssh logins with
the fish io_slave too. I'v been trying to track the bug down it must be
somewhere in the copyjob. I first saw this when working on the fish io_slave and
doing the following.

fish://someuser@somehost/home/someuser
asks for login info i enter it without checking the save password. 
konq displays the directory.
Right click "Create New..." "Directory"
a second connection to the remote host is opened.
Comment 7 Ismail Donmez 2003-06-19 20:17:19 UTC
Works for me on KDE cvs-head. 
Comment 8 Tommi Tervo 2005-02-02 14:48:59 UTC
*** Bug 95233 has been marked as a duplicate of this bug. ***
Comment 9 Tommi Tervo 2005-02-02 15:12:50 UTC
*** Bug 62221 has been marked as a duplicate of this bug. ***
Comment 10 Tommi Tervo 2006-01-30 10:04:06 UTC
*** Bug 121024 has been marked as a duplicate of this bug. ***
Comment 11 Andreas Hartmetz 2010-02-23 01:51:33 UTC
Kind of fixed with the new KIO scheduler in trunk, although the number of allowed connections per server is not configurable and higher than one. See bug 64647 (which I'm not going to close for the time being) for that.
Comment 12 Andreas Hartmetz 2010-02-23 01:57:04 UTC
*** Bug 200911 has been marked as a duplicate of this bug. ***
Comment 13 Andreas Hartmetz 2010-02-23 01:59:29 UTC
*** Bug 227160 has been marked as a duplicate of this bug. ***
Comment 14 Kevin Funk 2010-05-26 19:09:49 UTC
Is this really fixed? Still happening for me in KDE 4.4.3...
Comment 15 Simon 2010-08-04 17:24:59 UTC
In 4.4.5 as well.

Please really fix this bug.