aMule Forum

English => aMule Help => Topic started by: Radek on October 27, 2005, 06:34:33 PM

Title: Kademlia gets disconnected and can't reconnect
Post by: Radek on October 27, 2005, 06:34:33 PM
Hi, all!

I observed a, at least for me, strange behaviour of amuled concerning kad.

I use amuled/amuleweb/amulcmd on Debian Sarge w/o any gui. All three magic ports are forwarded to the PC and I have a high id.

After starting amuled I can see the usual lines in the log file. The first tells me, that 0 (sometimes more) kad contacts have been read (don't know the exact phrasing in English, as I'm using German version). Some minutes later I am connected to kad, but firewalled. Another few minutes later kad is OK. So far, so good.

But, after some time, again the message in the log file, that I am connected to kad (firewalled) and after a few minutes, that kad is OK. No message that kad was disconnected.

I get those disconnect messages, too, once in a while, so I know, that they do exist.

After some time, I get to the point that the web server tells me "Kad: off". If I take a look in the log file, the last line with the string "kad" in it, says "connected to Kad(firewalled)" and is 16 hours old. No mention of "disconnected" before or after.

Even if I manually do a "connect kad" in amulecmd (which is answered with "successfull"), nothing changes. Kad is still off and stays that way, until I restart amuled. Then the connection is OK again for some hours.

I can, of course, see the same with amulegui under WinXP. It makes no difference at all. Only mentioning this for the sake of completeness.

Any ideas about that? What about the settings concerning the learning of new servers from other clients? Do these have an effect on Kademlia?
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Aethereal on October 31, 2005, 10:13:52 AM
Just a brief note to confirm I have the same behaviour with CVS 20051028
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Kry on October 31, 2005, 03:32:54 PM
Hum.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: vdb on November 01, 2005, 10:38:53 AM
And I have to say that the same is happening for me on CVS 20051029. This is the logfile after starting the daemon:
2005-10-31 22:21:06: Read 161 Kad contacts
2005-10-31 22:21:07: Connected to Kad (firewalled)
2005-10-31 22:21:21: Connected to Kad (ok)
2005-11-01 00:21:11: Connected to Kad (firewalled)
2005-11-01 00:21:11: Connected to Kad (ok)
2005-11-01 03:21:08: Connected to Kad (firewalled)
2005-11-01 03:21:08: Connected to Kad (ok)
2005-11-01 04:52:35: Disconnected from Kad

Then I used the commandline to connect to kad and it shows:
2005-11-01 10:51:00: Read 8 Kad contacts

Something is happening, but it stays disconnected from kad.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Bambu75 on November 02, 2005, 05:59:08 PM
Same behavior also with the 20051101. I use a Mandrake 10.1 and aMule is compiled with the gui, but in my case Kad does not disconnect, simply somtimes is ok and sometimes is firewalled.

There is a new port to open on the firewall?

See you
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: thedude0001 on November 02, 2005, 06:02:52 PM
Only the three ports shown in preferences - connection.

Kad always starts assuming it is firewalled because it has no server that can tell amule 'The Kad port is reachable.' So it starts thinking it is firewalled and sets the status to OK after receiving the first Kad packages from the outside. So it is perfectly normal that Kad is in status firewalled some time after connecting.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Bambu75 on November 02, 2005, 06:40:05 PM
Also during dowloads? For instance, now my amule is downloading and kad is firewalled; 5 minutes ago was waiting and kad said me ok.
So, for some reason kad was disconnected and the reconnected automaticaly and next time I will see amule status will be ok? Is it right?

See you
Title: CVS 2005-11-22: still disconnecting from kad
Post by: Radek on November 23, 2005, 12:13:35 PM
Just a little update:

Yesterday's CVS (2005-11-22) still has the same behaviour. After some time kad disconnects and won't reconnect, even if saying so (response after executing "connect" in amulecmd).

The only noticeable difference was that now I have a message in the log about kad having disconnected. (Has been firewalled first, then ok for some time).

BTW: In said CVS I don't see any mentioning of kad in amuleweb anymore?! I'm using chicane template. I have to look into the log or "status" with amulecmd to see the kad status.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Kry on November 23, 2005, 12:17:26 PM
This seems to me like a network overload problem, to be fair.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Radek on November 24, 2005, 09:43:36 AM
On which side?

My network load at the internet connection is at maybe 10% or less. My intranet (min 3, max up to 10 computers of any flavours) has not much load, either. Exceptions are of course, while making software updates, but that's only for short times and not that often. I normally don't have many, if any, downloads over amule active. And I don't see, why I shouldn't be able to reconnect to kad manually.

The main point is for me the difference between the first connect after starting amuled, which invariably succeeds, and all following attempts after once losing the connection, which invariably fail...

I make all connections "by hand", by the way (entering "connect" in amulecmd).

It may of course be, that this behaviour is quite normal for kademlia, because I don't have any downloads, so the connected clients aren't really "needed". But a new connection attempt should be successfull, I believe, at least for a few minutes.

And I had this same behaviour while downloading an OS-Image with quite a lot of sources (no idea how many of these were ed2k and how many kad), so I don't really think that's the point.

Are there any traces I could activate to track this? I didn't look into the sources, yet, because of the "end of year == no time, everyone is going bananas"-problem. But I am system software developer, so if you have any suggestion where I could take a look or make a test - shoot ahead!
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: vdb on December 05, 2005, 12:39:41 AM
Just to open up an old thread again: CVS 20051203 (yes, I did get it to compile....)  is still having this "kad disconnect" issue. Perhaps the previous ones I tried have it as well, but since I use the daemon generally in detached mode there are no logs to show it (nudge Kry....)

My logfile of today shows:
 cat logfile | grep Kad
2005-12-04 12:11:29: Read 69 Kad contacts
2005-12-04 12:11:30: Connected to Kad (firewalled)
2005-12-04 12:11:36: Connected to Kad (ok)
2005-12-04 13:11:30: Connected to Kad (firewalled)
2005-12-04 13:11:31: Connected to Kad (ok)
2005-12-04 17:11:30: Connected to Kad (firewalled)
2005-12-04 17:11:30: Connected to Kad (ok)
2005-12-04 21:22:56: Disconnected from Kad
2005-12-05 00:36:39: Read 10 Kad contacts
2005-12-05 00:36:39: Connected to Kad (firewalled)

The first entry is related to the starting of the daemon, the last entry was because I used the command "connect kad". However, nothing really happens, amulegui and amuleweb still happily report Kad to be off.  And status in amulecmd: Not connected.

Checking the logfiles of both amule and system nothing out of the ordinary shows up at or around 21:22.

As for downloads, the last one finished around 18:11, and I started 2 downloads around 00:20. Can't really be a network problem, since my DSL line is showing usage of around 150 kbps up and 0 down on a 600/3000 subscription.

One odd thing too is that the reconnects always occur on the same minute of the hour....... Exactly the minute the daemon was started.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Radek on December 05, 2005, 12:06:39 PM
I just checked my logs and can confirm this behaviour (CVS 2005-12-04).

The reconnects always happen at about the same minute of the hour (+/- 10-15 seconds)

As my kad is disconnected for about 23 hours ("connected" lasted only about 140 minutes), I entered "connect kad" in amulecmd which produced a "Operation was successful". The output of "status" tells me "Kad: Not connected", whereas the log says "Reading 86 kad contacts | Kad connected (firewalled)" (or something like that, I have the german version).

Every snapshot I tried, up to the mentioned one, had this behaviour.

BTW: In amuleweb with "chicane" there is no indication of kad status anymore. The connection to "Razorback 2.0" is mentioned, as are IP address and port number, but nothing about kad. Not really important but maybe connected somehow?
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Aethereal on December 06, 2005, 01:22:04 PM
I still (CVS 2005-12-05 ) get the same behaviour as usual (at least for me): Kad connect, initially firewalled then Ok, and after about 1h30m get disconnected (regardless of the fact that there are active downloads or uploads) and NEVER reconnect, even after several hours...
There is something I can monitor? I'd like to understand why...
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: DigitoErgoSum on December 11, 2005, 11:44:44 PM
Quote
Originally posted by Aethereal
I still (CVS 2005-12-05 ) get the same behaviour as usual (at least for me): Kad connect, initially firewalled then Ok, and after about 1h30m get disconnected (regardless of the fact that there are active downloads or uploads) and NEVER reconnect, even after several hours...
There is something I can monitor? I'd like to understand why...
Are you a fastweb user ???? (could it be caused by a nat problem ???? )
I got similar "error"...
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Aethereal on December 12, 2005, 10:01:40 AM
Nope, the server running aMuled is not on Fastweb, but it is NATted.
Both the local and the public addresses are static, so I don't see why it should stop working after some time...
I noticed Kad is working in the first 1h30m, because I am able to do searches on it, if it were a NAT issue it shouldn't work from the beginning... but I am not a Kad guru...
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Radek on December 12, 2005, 10:45:31 AM
Same environment here: More or less constant public IP-address and constant internal IP-address behind NAT/NAPT with (working) port forwardings. I'm in Germany, so no Fastweb.

It maybe worth mentioning though , that my router (Bintec X1200 II) has a symmetric NAT. Most SoHo-Routers don't have that. It is almost exclusively found in the more expensive router variants.

Last time I restarted amuled (CVS 2005-12-07) I had a kad connection for some 24+ hours, with several reconnects during that period. The behaviour didn't change at all since last post.

I'll try today's snapshot later.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: vdb on December 12, 2005, 11:10:40 AM
For CVS 20051210 I can say that it does the same again. I don't have the logs to verify the connect/disconnect behaviour (running detached daemon), but it seems that after roughly 26 hours the connection to Kad is gone again. Only way to connect to it is shutting down and restarting the daemon.

I also run the daemon behind a NATtin router, with the 3 ports forwarded to the Linux box. The provider I use claims to not use traffic shaping devices of any sorts on their network.

I'll run the monolith for a while today to see if it the Kad connect also appears on that one. To be continued.....
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: vdb on December 22, 2005, 09:02:54 AM
To bring this thread to a close, I think it is fixed now, thanks guys:

2005-12-19 09:14:39: Read 0 Kad contacts
2005-12-19 09:14:40: Kad started.
2005-12-19 09:14:46: Kad stopped.
2005-12-19 09:14:46: Connected to Kad (firewalled)
2005-12-19 09:17:41: Connected to Kad (ok)
2005-12-19 10:14:40: Connected to Kad (firewalled)
2005-12-19 10:14:41: Connected to Kad (ok)
2005-12-19 12:14:43: Connected to Kad (firewalled)
2005-12-19 12:14:43: Connected to Kad (ok)
2005-12-19 14:14:45: Connected to Kad (firewalled)

2005-12-22 07:15:48: Connected to Kad (firewalled)
2005-12-22 07:15:48: Connected to Kad (ok)
2005-12-22 08:15:47: Connected to Kad (firewalled)
2005-12-22 08:15:47: Connected to Kad (ok)
2005-12-22 09:15:47: Connected to Kad (firewalled)
2005-12-22 09:15:47: Connected to Kad (ok)

It seems the disconnect no longer happens, although there still is this odd behaviour where it connects every few hours. But if it stays on Kad, I'm happy  :)
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: stefanero on December 22, 2005, 09:06:44 AM
btw is there something happening every houre at your pc?
since this looks to me like a self made problem with the

firewalled -- ok

it happens once every houre, you could almost set the clock
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: mithrandir77 on December 22, 2005, 11:34:31 AM
I have had this problem for two days...

Today it seems to work correctly
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: vdb on December 22, 2005, 11:55:38 AM
There are lots of things happening every hour: Cron jobs checking things. But these are all scheduled to run on minute 1 or 2 of the hour.

This behaviour of aMule is happening every hour on the starting time of aMule, independant of what time that actually is. It must be something within aMule to trigger this. (or perhaps something in my router, but it doesn't show anything in it's logs, and then why would it do something on just port 4676?). Also you might note that it does not happen every hour, sometimes it skips one or two hours before doing the firewall/ok sequence.

Perhaps noteworthy that I do not use the standard aMule ports on my Linux daemon, I have upped them a few to be able to run 2 mules simultaniously.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Kry on December 22, 2005, 12:04:43 PM
aMule recheckes the firewalled state every hour. If the re-check ping packets don't get back, it assumes its firewalled. Later, they get back and it marks as OK. So it's perfectly normal behaviour.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: vdb on December 23, 2005, 10:12:49 AM
Thanks for this explanation, and again, a great job fixing all these things!
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Radek on December 23, 2005, 02:40:36 PM
I'm testing CVS-20051222 since 21:00  yesterday and till now everything is ok. Kad stays connected with it's more or less hourly status messages.

Too early for me to state something but looking good...

BTW: What do these
Quote
2005-12-22 21:03:27: Kad started.
2005-12-22 21:03:27: Servers: Connected
2005-12-22 21:03:27: Verbindung hergestellt auf: Razorback 2.0
2005-12-22 21:03:27: Verbunden zu Razorback 2.0 mit hoher ID
...
2005-12-22 21:03:27: Servernachricht: nicht geloggt werden. Wir arbeiten mit First-Laod zusammen und empfehlen euch einen 14 Tage Testaccount.
2005-12-22 21:03:27: Servernachricht: http://ng.razorback2.com
2005-12-22 21:03:32: Kad stopped.
2005-12-22 21:03:32: Kad verbunden (firewalled)
2005-12-22 21:03:52: Kad verbunden (ok)
red lines mean? Kad starts, then stops, and after that is connected?! It's somewhat confusing for me ?(
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Radek on December 24, 2005, 11:04:51 AM
Not looking so good anymore - some hours later kad got disconnected again :-(

Partial Log
Code: [Select]
2005-12-22 21:03:26: Servers: Trying to connect
2005-12-22 21:03:26: Verbinde zu Razorback 2.0 (195.245.244.243 - 195.245.244.243:4661)
2005-12-22 21:03:26: Lese 39 Kad-Kontakte
2005-12-22 21:03:27: Verbunden zu Razorback 2.0 (195.245.244.243:4661)
2005-12-22 21:03:27: Kad started.
2005-12-22 21:03:27: Servers: Connected
2005-12-22 21:03:27: Verbindung hergestellt auf: Razorback 2.0
...
2005-12-22 21:03:32: Kad stopped.
2005-12-22 21:03:32: Kad verbunden (firewalled)
2005-12-22 21:03:52: Kad verbunden (ok)
...
2005-12-23 03:03:29: Kad verbunden (firewalled)
2005-12-23 03:03:29: Kad verbunden (ok)
...
2005-12-23 11:03:31: Kad verbunden (firewalled)
2005-12-23 11:03:31: Kad verbunden (ok)
2005-12-23 14:03:30: Kad verbunden (firewalled)
2005-12-23 14:03:30: Kad verbunden (ok)
...
2005-12-23 19:03:56: Kad getrennt
where the german "verbunden" means "connected" and "getrennt" means "disconnected"

"status" in amulecmd told me, that kad was stopped(!).

Some hours later I tried "connect kad" in amulecmd: Reply was "successfull", but nothing happened at all.
Next was "connect" in amulecmd, which told me sth like "servers already connected" and "connecting to kad".
The corresponding part of the log shows
Code: [Select]
2005-12-24 00:34:48: Lese 200 Kad-Kontakte
2005-12-24 00:34:48: Kad started.
and nothing more about kad until now (some 10 hours). But now "status" replies "kad disconnected".

CVS-20051222 amuled/amulecmd/amuleweb on Debian Sarge
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: vdb on December 24, 2005, 11:15:20 AM
Unfortunately I have the same thing here again with CVS 20051217:
[me@mine .aMule]$ cat logfile | grep Kad
2005-12-23 23:55:00: Read 0 Kad contacts
2005-12-23 23:55:01: Connected to Kad (firewalled)
2005-12-23 23:55:06: Connected to Kad (ok)
2005-12-24 03:55:02: Connected to Kad (firewalled)
2005-12-24 03:55:02: Connected to Kad (ok)
2005-12-24 05:32:21: Disconnected from Kad
[me@mine .aMule]$

Again nothing happening even closely around this time, it just goes "poof". And it did so wel the last few days.

Now that I think of it, until tonight I was constantly downloading multiple files. Tonight I had only 2 left to finish and they were going very intermittently. Maybe the disconnect occurs if there is no activity for a while on the download side of Kad?
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Radek on December 24, 2005, 11:24:26 AM
Quote
Maybe the disconnect occurs if there is no activity for a while on the download side of Kad?
That's exactly my idea of some weeks ago. I also have quite few downloads which are very rare, too. So it might be a problem connected to not having much traffic. Or maybe the settings concerning the learning of new servers have some impact? I disabled this learning from other clients, because it was considered dangerous in some other threads.
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: acehigh on December 30, 2005, 10:15:26 PM
Thanks to Radek that showed me this thread.

I found the same problems you are pointing here in this thread (http://forum.amule.org/thread.php?threadid=8361&sid=).

I noticed the same connect every hour or two and the explanation from Kry fits.

I think the true problem is instead the disconnection from Kad and the inability to reconnect again without a restar of the daemon. I can't test the gui version because amuled runs in a machine where there is no X.
Has someone do some tests on the monolithic version?
I'm currently running the cvs 29122005 and still has the same disconnection problem. I tried the 04122055, 22122005 and this.

Someone of the developers can put some sort of debug info in the logfile when the kad disconnection happens so we can post the logfile in that occurrence?
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: acehigh on December 30, 2005, 10:17:25 PM
In any case: Happy new year to everybody!
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Pinky's Brain on January 26, 2006, 10:05:06 AM
New user here, running 2.10 from debian unstable suffering from the same problem.

If I try to bootstrap with amulegui it fails, and the log file simply reads something like this :
2006-01-26 09:38:04: Read 200 Kad contacts
2006-01-26 09:38:04: Kad started.
2006-01-26 09:41:52: Kad stopped.

If I try to start kad with amulecmd it simply says it succeeds, but it really doesnt.

Has this been fixed in CVS? The changelog in the daily tarball mentions no such thing, and Im a little hesitant to run from CVS given the horror stories on the front page ;)
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: stefanero on January 26, 2006, 10:15:57 AM
nope not fixed in cvs,

there is another thread about this also ;) on forum

some guy reported he can reconnect with the remote-gui and it stays connected, maybe you can give that a try
Title: Re: Kademlia gets disconnected and can't reconnect
Post by: Pinky's Brain on January 26, 2006, 10:20:12 AM
Yeah, sorry ... noticed the bugs forum a little late :/

Ill check it out, thanks.
Title: same problem, 2.1.3
Post by: ziggolo on November 14, 2006, 10:43:07 PM
Hi all,

Amuled + amulegui + amuleweb is fantastic but I've the same problem running Ubuntu

Server with amuled 2.1.3.   The problem occurs after  8-10hours.

Now the real problem is that lots of edonkey servers require protocol obfuscation and

without Kad network is not possible to search files.

There must be a way to reconnect to Kad without stopping amuled daemon. This

means losing the queue and wait few hours before downloading again at a reasonable

speed. :)

My little box without X server doesn't really want to move to emule in a stupid windows

enviroment :-)

I'd like also to try cvs version but reading your posts it doesn't seems that this could solve

this problem.   It's possible to re-install amule with the previous enviroment, I mean..

without losing credits etc..

How can we help to solve this problem?!

Thanks & Regards

Andrea