aMule Forum

English => en_Bugs => Topic started by: danilapus on May 08, 2007, 09:47:55 PM

Title: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: danilapus on May 08, 2007, 09:47:55 PM
(Note: The problem has been previously discussed here: http://forum.amule.org/index.php?topic=8361. However, there was neither conclusion nor suggestions.)

I am running amuled and amuleweb on debian. I didn't compile amule from source, I've just installed the corresponding .deb packages.

The problem: after some time (sometimes hours, sometimes days) Kad network gets disconnected:

Code: [Select]
> Kad: Not running
The command connect kad in amulecmd doesn't make Kad connect again. Kad's status just changes to Not connected and stays like that. The only way to get Kad working again is to restart the daemon. Any clues?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: skolnick on May 09, 2007, 06:22:11 AM
The status of this is (AFAIR) that Kry could not reproduce this issue, therefore he is unable to solve this inconvenience. If you find an exact way to produce the error, post it here, so he can study it more carefully and get a solution.

Regards.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: danilapus on May 09, 2007, 09:32:20 AM
Well, I don't have another linux machine to try and reproduce it in the perfect sense of the word, but it "reproduces" itself here and with an enviable permanency.  ;)

Recipe

distro: Debian etch [Linux 2.4.27-3-586tsc #1 Tue Dec 5 22:06:26 UTC 2006 i586 GNU/Linux]
amule: aMuled 2.1.3 using wxGTK2 v2.6.3 (Unicoded)
connection: router client with fixed IP

Code: [Select]
$ amuled &
$ amuleweb -P<password> -q &

-> Kad disconnects within 24 hours.

Question: If I try to compile amule from source, may it help to resolve the problem? Or you never know before you actually try?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Radek on May 09, 2007, 10:00:35 AM
Hi!

I don't think it would help, as that's exactly what I am doing for quite a while - with the same results even for the latest daily snapshots!

On my linux box in question is still Debain Sarge at large :) and I don't have a gui there, so only amuled, amuleweb, and amulecmd. And I, too, have a fixed IP on my router with port forwarding and NAT (Bintec X1200II, for the experts, so not the usual NAT, but a port restricted one).

I only gave up reporting this error, for the same reason that <skolnick> mentioned. As long, as there is no amule(d) with some special event logging to help trap this bug, I don't see any solution.

Cheers...
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: danilapus on May 09, 2007, 10:22:07 AM
@Radek
Thanks for saving my time.
P.S. Same here: debian witout GUI, only amuled.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: skolnick on May 10, 2007, 04:06:35 AM
Maybe the problem is some debian library, since I use aMule on Fedora Core 6, and on Solaris 10 and kad happily runs for up to three or four days with no disconnection. Sometimes it says firewalled, but after a couple minutes it changes to OK again.

Regards.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Radek on May 10, 2007, 09:59:59 AM
@skolnick

That would be of course possible, but unlikely, as we already are talking about different versions of Debian (Etch and Sarge).

I tended to believe, that there is some issue with NAT or (specialty of DSL in Germany), the daily disconnection/reconnection with different IP of DSL.
But: I myself have a fixed IP, as well as <danilapus>! I do experience short disconnects at night, though. My ISP states, that that should not happen, but it happens anyway. It's mostly only for a few seconds, but could cause some disconnections, of course.

The problem seems to lie in the fact that Kad is unable to reconnect! Even if there is no such thing as automatic reconnect after loss of connection, it should work manually!

And it should be possible to find out, why "connect kad" in amulecmd does not work anymore after said loss of connection. From user point of view there is no difference to giving same command after (re)starting amuled. This initial "connect kad" works without any problems on my machine and almost always gives "ok" after a few seconds. The same command after disconnection has no effect apart from the state of Kad changing from "not running" to "running" (or similar, don't recall the exact text atm). No "connected" even after waiting for some hours.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Kry on May 10, 2007, 02:11:38 PM
It's probably that the UDP socket is closed at some point. or broken. or something.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: danilapus on May 10, 2007, 03:56:34 PM
@Radek: What's your ISP? (if not a secret)
The nightly disconnections happen here as well. I am hanging on Hansanet.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Radek on May 10, 2007, 04:49:02 PM
@danilapus

No secret: it's "ish" (for non-germans: that's a cable tv provider. I get my internet by tv cable). And it normally has no nightly disconnect but is a fixed connection. There must be sth wrong with either my cable modem or the counterpart at ish's. Worst case has been almost 40 hours without connection. The service personnel couldn't find any problems :(

@Kry

Quite possible. What about the following?
The so called NAT function of my router is somewhat pedantic and remembers (and checks) pairs of IP addresses and ports. Most NAT implementations only remember the port, Example:

MyComp with internal IP address of 192.168.1.1 and external IP address of 4.3.2.1 opens a UDP connection to 1.2.3.4:1111 which makes a "Hole" in Firewall/NAT, let's say 192.168.1.1:2222 --> 4.3.2.1:33333 --> 1.2.3.4:1111, where the port 33333 is automatically assigned by the router

With "normal" NAT anyone could reply or send sth to UDP port 33333 at my external IP and the data would be forwarded to myComp at 192.168.1.1:2222. Sth like 9.8.7.6:4444 --> 4.3.2.1:33333 --> 192.168.1.1:2222

With my "port restricted" version only the original IP address 1.2.3.4 with the original port (at least I believe so with the port) could reply to myComp: 1.2.3.4:1111 --> 4.3.2.1:33333 --> 192.168.1.1:2222
All others would be blocked. For the "official" ports I configured static forwardings, of course.

Also, this automatic port forwardings to my internal IP will be deleted when there was no traffic for some time. I think it's about 120 seconds (configurable).

Sth like that could be an explanation for the disconnects. I'll activate my router's debug log to see if there are some denies logged. But I don't think this could explain the failure of a new manual "connect kad", where everything should start afresh?!

What about some debug output during/after the command "connect kad" until the connection is established? Are there any "heart beats" transmitted or sth of the kind to keep the connection alive?
I admit, I never looked into protocol specifications for Kad and don't have the time atm. But I'd love to help catch that bug/strange behaviour.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: skolnick on May 10, 2007, 05:02:37 PM

Quote
With "normal" NAT anyone could reply or send sth to UDP port 33333 at my external IP and the data would be forwarded to myComp at 192.168.1.1:2222. Sth like 9.8.7.6:4444 --> 4.3.2.1:33333 --> 192.168.1.1:2222
If that happens, then your router/firewall is not stateful, which is rare even in small modern routers (I use an old Netgear, and it's stateful). I think this is not default behavior. It would be a huge security threat to use such a router, since it would allow easy spoofing.

Regards.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: vdb on May 11, 2007, 05:31:58 PM
Just my 2 cents here: I used to (!!) experience Kad disconnects every so many hours, ranging from 4 to 36 hours of uptime. This is on a headless Mandriva 2006 distribution, using obviously amuled only.

However, since a couple of months now this fenomenon has magically disappeared. Now I only restart the amuled when the amuleGUI won't connect to it from my Windows machine, which usually happens after about 7 to 10 days of uptime. I have not installed any new applications, nor recompiled amule, nor updated my Linux distribution.

Concluding: Something outside my realm of influence has changed.
Concluding2: The Kad disconnect probably has nothing to do with your local installation but instead is somehow triggered by ISP events. Perhaps they do some soft of traffic inspection, or they shut down UDP threads every now and then. Who knows?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Kry on May 11, 2007, 05:53:46 PM
The fact it never happens to me speaks for your idea. I know there is a kad bug waiting to be fixed, but I don't think it's related to the disconnects. We'll see after I have time to fix it....
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: danilapus on May 11, 2007, 09:55:16 PM
And still, you have to agree, that it doesn't explain why Kad cannot be reconnected manually, without restarting daemon...
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Kry on May 11, 2007, 10:29:18 PM
Yes it does.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Radek on May 12, 2007, 12:17:17 PM
@skolnick
NAT behaviour and stateful inspection are two different things. A NAT is only stateful insofar, as it may (depending on the kind of NAT) close the punched "hole" again after a while without traffic. The rest is for the firewall/packet filters.

I meant the NA(P)T implementations in quite a lot of routers. I had to do with this kind of problems because I experimented with VoIP and NAT used to be one of the biggest problems for beginners in that field. I gave some help in forums at that time.
So I found out that a lot of methods (STUN) didn't work for me, because I always have used routers of a more 'sophisticated' kind (aka normally not working "out of the box", but a lot of possibilities instead after one invested some hours in RTFM).

For some VoIP-providers for example I always had to manually set the external SIP port to the same port number as the one I wanted to connect to. Strange things happened with the different implementations of the SIP servers.

So I tend to search for protocol problems in that same direction. But it's of course just kinda brain storming atm. Some interesting links: RFC3489 (STUN) (http://www.ietf.org/rfc/rfc3489.txt) and Wikipedia (NAT) (http://en.wikipedia.org/wiki/Network_address_translation)

I believed for some time, that I had found some link between the disconnect intervals and the amount of downloads I had. Normally I have few to none active downloads but have mostly "releases" and other uploads.
It's some time ago I used to watch all that, but I think the time Kad stayed connected, was noticeably longer, when I had some active downloads. This lead me to the conclusion, that there was some connection with the traffic on Kad.

@Kry
My ISP, for example, does not block any ports or regulate traffic (apart from technical failures on their side :) ).

And even if my ISP would do that - what should be the difference for them between restarting amuled and reissueing the command "connect kad" and doing the latter without the first? Both should show the same results, when monitored from outside, I think. The only difference might be the absence (or not) of connection to some ed2k server. When I start amuled I normally enter "connect kad" first and "connect <IP>:<port>" later. Whereas I normally stay connected to some ed2k server when Kad disconnects and only try "connect kad" then.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: skolnick on May 14, 2007, 06:16:55 AM
Hi Radek!

I never talked about stateful packet inspection. I know that is for firewalls and similar devices. I just talked about stateful as in "it keeps states". Just like any protocol, if you do not follow the protocol but send a random message, you cannot expect it to be responded correctly. Only non-stateful protocols do that (like sending a SYN+ACK with no previous SYN...that would mean RST on most modern TCP stacks. That was what I was refering to, the fact that the NAT keeps (or should keep) the state of the packets going in or out. Nothing to do wht SPI.

Regards.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: gmemon on May 14, 2007, 06:23:38 PM
I am running amuled on FC3 and I am having a similar problem. I did some poking around and found that after some time the amuled simply stops reading packets from its UDP buffer. This can be because of a bug in the code (not handling proper interrupts from the OS)  or in the OS itself (not sending proper interrupts). This leads to packet drops and amuled will disconnect itself from the Kad network if it does not receive any packet for 20 minutes. The reason Connect Kad does not work from amulecmd is the same. amuled tries to reconnect by sending out new packets but its buffer is still full so the packet drop continues. However if you restart the process then the buffer is cleared by the OS and everything is as good as new.

As somone mentioned that his/her amuled works fine on FC6 so I am moving to FC6 and will update you guys if I see any progress.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: gmemon on May 15, 2007, 06:48:15 PM
No luck with FC6. I think it has to do something with the code. There is some segfault which stops the process from reading its UDP buffer. In the meanwhile I am back to running GUI version of amule. I hope that works without problems
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: wuischke on May 15, 2007, 06:50:11 PM
Please create a backtrace for this issue. (http://www.amule.org/wiki/index.php/Backtraces)
That's the only way for the developers to know about the reasons of the problem.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Radek on May 18, 2007, 12:42:40 PM
Hi!

I googled a little and found this in the wine bugtracker (http://bugs.winehq.org/show_bug.cgi?id=5774)! It sounds (reads) very familiar!

Basically they have similar problems with UDP ports not working anymore after some amount of time. Though this is about eMule and µTorrent under Wine, it could very well give some hints...

The theory developed in the above bugtracker entry is: when someone does a select() on a (UDP) port to check for input data he might get the result that some data has arrived and, when trying to read the data, get an error that no data is available. Such things seem to happen under Wine, if the arrived packet turns out to have errors (bad checksum), which causes it to be dropped by the underlying libraries.

Maybe this isn't really a problem of Wine, but of the host system?! If this is the case, it might very well be the same problem here. I didn't check the amule sources, yet, to see if this select()/read()-mechanism is used here, but it's very likely as that is  "standard procedure".

Coincidentally, I did some sniffing on my linux box running amule (tcpdump with "udp port xxxx") yesterday and checked the captures with WireShark. I found out that every packet sent by amuled on my linux box was flagged with "[UDP CHECKSUM INCORRECT]", whereas no packet received had this flag. At that time, Kad was connected and running.
So, either WireShark makes some mistake or amuled sends incorrect UDP packets, which could lead to the above errors.

Next piece of the puzzle:
Today I compiled the new snapshot and restarted amuled. Kad was "connected(ok)" after a few seconds. 3 hours later Kad is still ok, but the "Recv-Q" on the box is growing rapidly (netstat -l)! That should never happen, I believe, and fits in the above theory...

Cheers
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: gav616 on May 18, 2007, 12:48:43 PM
theres an unofficial patch out for wine that might fix the disconnecting...OS side mostly
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Radek on May 18, 2007, 12:57:45 PM
@gav616
Yes, I read that in the bugtracker, too, but unfortunately our problem here isn't directly related with Wine. I mentioned Wine because of similarity of symptoms and, seemingly,  chain of events, too.

@all
Addition to my last post:
A few minutes after writing the above post, the status of Kad changed to "Not connected"! The receive queue of my UDP port stays at 110464, which might be some buffer limit, that is reached now.

I think, we may have hit something here...

Cheers
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: gmemon on May 19, 2007, 12:03:21 AM
This is exactly what I said in my post earlier that UDP buffer grows and after some time Kad gets disconnected.

An addition is that on Fc6, if I run only 1 amuled then it runs fine. Only when I run multiple amuled then they start crashing one by one.

Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: xor on June 27, 2007, 11:01:22 AM
Hi.

I have the same problem here. I'm running debian sarge. I've compiled myself wxBase 2.6.3 and aMule 2.1.3, and after some time (usually 5 hours or so) kad stops and would not reconnect. The UDP rec. queue has 109328 unprocessed packets, so no matter you try to restart it, it wont run anymore.

I've changed the code in amule.cpp to instead of just stoping kad, close the UDP port and reopen it again to clean the queue ( just add clientudp->Close(); clientupd->Open(); ), then StartKad() again. It's ugly, but it works. I have no clue about why the UDP cue gets full, but definitively this is the reason Kad stops working eventually. Maybe is  a wxWidgets problem. I've downloaded wxBase 2.6.4 but I've not tried it yet.

Hope this helps.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Menion on June 27, 2007, 02:28:30 PM
Same problema also here, amuled built on a May SVN, running on a Kurobox (NAS with PowerPC), Kad disconnected after a while, reconnect, disconnect, and so on for few times, after it dosconnects without reconnecting any more. I had this problem from the day I start using amuled (last summer). Connecting to internet via WiFi router with Firewall on and stateful packet inspection ON. Bye!
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: realcruncher on July 12, 2007, 12:09:21 AM
Hi there,

this problem is still not fixed. Some time ago i already suggested to close and reopen the UDP port and obviously it is a workaround for this problem.
Now with this new discovery about the RECVQ i think this i a programming error. Somehow amule doesn't read or reset the queue until it is full.
Even if you don't have these errors why don't you just code the workaround and maybe look for a missing read ? This wouldn't harm you, right ?

Thanks,
realcruncer
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: wuischke on July 12, 2007, 05:50:57 AM
I'll try to have a look at it, but don't expect results soon or better don't expect any results as I frankly don't know anything about the network part of aMule codewise, only in an abstract way.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: realcruncher on July 20, 2007, 05:29:28 PM
well for me this patch works:

            if(Kademlia::CKademlia::GetPrefs()->HasLostConnection()) {
                StopKad();
                clientudp->Close();
                clientudp->Open();

                if (thePrefs::Reconnect()) {
                    StartKad();
                }

Somewhere around line 1460 in amule.cpp.

But this is only a workaround because a new recvq is opened. Not the problem that the queue is becoming full is solved this way.

Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: traycold on October 29, 2007, 09:57:41 AM
I'll try to have a look at it, but don't expect results soon or better don't expect any results as I frankly don't know anything about the network part of aMule codewise, only in an abstract way.

hi, i'm experiencing the same problem. I use amuled, CVS version, on Debian (i used the stable 2.1.3 version, but the problem was the same).
The ports are set up correctly, and in fact both the server and the kad networks are ok when amueld start. But after some time (half an hour in this case) kad disconnect (amulecmd reports: "Kad not connected") and the amulecmd command to reconnect is useless in this case.
As indicated before on this forum, i launched the command: "netstat -lu" (after Kad disconnected) and the output is:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
udp        0      0 192.168.0.10:netbios-ns *:*
udp        0      0 *:netbios-ns            *:*
udp        0      0 192.168.0.1:netbios-dgm *:*
udp        0      0 *:netbios-dgm           *:*
udp        0      0 *:17315                 *:*
udp   108324      0 *:17322                 *:*
udp        0      0 *:bootpc                *:*

and these are the relevalt amule log lines:
 > 2007-10-29 12:45:13: Connected to Kad (firewalled)
 > 2007-10-29 12:45:13: Connected to Kad (ok)
 > 2007-10-29 13:16:55: Disconnected from Kad
 > 2007-10-29 13:16:55: Indexed.cpp(249): Kademlia Indexing: CInvalidPacket Exception
in CIndexed::readFile: CInvalidPacket: Integer tag expected, but found ""=Type=10
 > 2007-10-29 13:16:55: RoutingZone.cpp(150): Read 200 Kad contacts

do you have any news about this bug or any idea on how to solve it? thanks
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: lfroen on October 29, 2007, 04:39:45 PM
well for me this patch works:

            if(Kademlia::CKademlia::GetPrefs()->HasLostConnection()) {
                StopKad();
                clientudp->Close();
                clientudp->Open();

                if (thePrefs::Reconnect()) {
                    StartKad();
                }

Somewhere around line 1460 in amule.cpp.

But this is only a workaround because a new recvq is opened. Not the problem that the queue is becoming full is solved this way.


IMHO this is correct thing to do (re-open socket before restarting KAD). In general, I think that problem have origins in buggy UDP implementation on WX side.
The problem is that sometime WX stops delivering events about UDP packet received, which cause packets to be dropped, and network disconnected on timeout. Since socket remains open, WX remains in zombie state, and can as a result KAD can  not be restarted. When socket is closed, WX state is flushed, and KAD is reconnected.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: rapid2k1 on October 31, 2007, 08:57:01 AM

Maybe I can give a little more info about this. I'm using the cvs version of amule in a debian testing machine.  There is no NAT, no filter, no port forwarding. I have a direct cable connection, and my box is directly connected to the internet. iptables rules are per default set to accept.

ii  amule-cmd                           2.1.3+CVS20071029-1                 the amule-commandline-client
ii  amule-daemon                        2.1.3+CVS20071029-1                 the amule daemon
ii  amule-i18n-en-gb                    2.1.3+CVS20071029-1                 English (en_GB) internationalized (i18n) fil

After seeing this in the logfile:

2007-10-30 10:10:51: Disconnected from Kad
2007-10-30 10:10:51: Indexed.cpp(249): Kademlia Indexing: CInvalidPacket Exception in CIndexed::readFile: CInvalidPacket: Integer
tag expected, but found "^B"=Type=10
2007-10-30 10:10:51: RoutingZone.cpp(150): Read 182 Kad contacts

i did a status:

$ status
 > ED2K: Connected to xxx[xxxx:5000]  with HighID
 > Kad: Not connected
 > Download:    43.65 kB/s
 > Upload:      9.74 kB/s
 > Clients in queue:    1737
 > Total sources:       1928

not connected!, then, connect manually

aMulecmd$ connect kad
2007-10-30 11:10:51: Kad started.

couple of tries an minutes after:

aMulecmd$ status
 > ED2K: Connected to xxx[xxxx:5000] with HighID
 > Kad: Not connected
 > Download:    43.75 kB/s
 > Upload:      9.45 kB/s
 > Clients in queue:    1733
 > Total sources:       1936


Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: lfroen on October 31, 2007, 10:06:18 AM
One the one hand
Quote
I'm using the cvs version of amule

but on the other
Quote
amule-daemon                2.1.3+CVS20071029-1
Hmm?

Actually, you did not added to your previous report. We see KAD running and then disconnected. We also see reconnection attempt failed for no particular reason.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: rapid2k1 on October 31, 2007, 03:31:15 PM
One the one hand
Quote
I'm using the cvs version of amule

but on the other
Quote
amule-daemon                2.1.3+CVS20071029-1
Hmm?

Yes, the debian package made by vollstreckernet (http://www.vollstreckernet.de/debian/)

Actually, you did not added to your previous report. We see KAD running and then disconnected. We also see reconnection attempt failed for no particular reason.

yes, thats because i call it "a bug". No particular reason and no warning/message. The first time amule is started, it connectes without problem. Then, after the first disconnection, it is unable to connect again, it doesn't matter if i use the connect option from the cli.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: lfroen on October 31, 2007, 03:50:28 PM
Nobody seems to be arguing that this isnt a bug. No new information was, however, provided on a nature of this bug.
I still blame WX.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: phoenix on November 01, 2007, 11:43:04 AM
lfroen,

If there is a workaround, as suggested by realcruncher, shouldn't we commit it? You seemed to agree with his solution.

Cheers!
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: rapid2k1 on November 01, 2007, 12:58:05 PM
Nobody seems to be arguing that this isnt a bug. No new information was, however, provided on a nature of this bug.
I still blame WX.

Sorry if I sounded a bit harsh.

I'd like to point to this error:

2007-10-30 10:10:51: Indexed.cpp(249): Kademlia Indexing: CInvalidPacket Exception in CIndexed::readFile: CInvalidPacket: Integer
tag expected, but found "^B"=Type=10

Maybe it has something to do with Kadmelia not connecting again. However, the WX bug (wx closing udp ports and forgiving them) looks a good candidate. Shouldn't the proposed fix (closing/reopening) be commited, so we can try if that solves the problem?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: lfroen on November 02, 2007, 06:59:47 AM
Nobody seems to be arguing that this isnt a bug. No new information was, however, provided on a nature of this bug.
I still blame WX.

Sorry if I sounded a bit harsh.

I'd like to point to this error:

2007-10-30 10:10:51: Indexed.cpp(249): Kademlia Indexing: CInvalidPacket Exception in CIndexed::readFile: CInvalidPacket: Integer
tag expected, but found "^B"=Type=10

Maybe it has something to do with Kadmelia not connecting again. However, the WX bug (wx closing udp ports and forgiving them) looks a good candidate. Shouldn't the proposed fix (closing/reopening) be commited, so we can try if that solves the problem?

I didn't actually checked the code to see whether "InvalidPacket etc" can actually disconnect KAD (it should not). In any event, I will commit fix for re-opening UDP socket.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: lfroen on November 04, 2007, 04:50:37 AM
committed udp socket fix.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Aethereal on November 06, 2007, 12:50:25 PM
I am behind a NAT (port forwarded) and I always had the KAD disconnection bug.
I'm actually running  amuled CVS-20071105 and the reconnect now works fine. The log states that nearly every hour the connection is lost but then successfully re-opened, and I can still do KAD-searches after several of these disconnections.
It's still unknown why the disconnection happens, but at least  KAD is now usable (by me anyway, and with most ed2k servers out, it's a really good thing).
Thanks to all for the efforts!
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: realcruncher on November 08, 2007, 12:55:55 AM
Hi there,

i think the indexing error is just a symptom of the udp bug (incomplete data ?) and i also agree with the assumption that the bug is hidden in wxwidgets somewhere.

The workaround works for me since months but it is ugly because it looks like you have to link again with all your peers but i have no knowledge about wxwidgets and so maybe there is a better solution ?

Mabye you can set a flag to enable autoflush or something with wxwidgets or someone could open a bug report for the wxwidgets developers but then i wonder why nobody of them noticed this strange behaviour yet.

Anyways at least now i don't have to add this patch to amule any longer when i compile the cvs version :)
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: rapid2k1 on November 08, 2007, 07:30:21 PM

For me this fix solved the problem. Amule is now always connected to Kad network. However, and since we are talking about bugs in wxwidgets:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp    62489      0 xx.xx.xx.xx:9362   xx.xx.xx.xxx:3404       ESTABLISHED6668/amuled

has this any sense? why is the receive queue always full (or very big) in some tcp transmissions? I'd could be understandable if the send-q is big, but... the recv.q?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: rapid2k1 on November 08, 2007, 07:37:36 PM
i think the indexing error is just a symptom of the udp bug (incomplete data ?) and i also agree with the assumption that the bug is hidden in wxwidgets somewhere.


Isn't there any "verbose" option in the wxwidget kit?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Archmage on November 22, 2007, 10:56:04 AM
I'm using the latest CVS and amuled don't seem to lost the connections anymore.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: RRT4 on November 22, 2007, 05:05:09 PM
see the log ('show log' in amulecmd), it disconnects and reconnects automatically

yesterday cvs version, few hours ago:
 
> 2007-11-22 15:34:03: Disconnected from Kad
> 2007-11-22 15:34:03: MuleUDPSocket.cpp(86): MuleUDPSocket: Shutting down Client UDP-Socket
> 2007-11-22 15:34:03: MuleUDPSocket.cpp(77): MuleUDPSocket: Created Client UDP-Socket at port 1759
> 2007-11-22 15:34:03: RoutingZone.cpp(150): Read 0 Kad contacts
> 2007-11-22 15:34:03: Connected to Kad (firewalled)
> 2007-11-22 15:34:09: Connected to Kad (ok)
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Archmage on November 23, 2007, 09:51:25 AM
I think it is still not working proper. When I restart my PC amuled wasn't connecting at all, when only KAD was enabled. After I did enable ed2k and did hit connect, both networks where running.
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: realcruncher on November 23, 2007, 08:41:51 PM
This has nothing to do with the bug discussed here. Can't you open your own topic ?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Archmage on November 26, 2007, 07:08:34 AM
How should I call the topic? "amuled: Kad disconnects regularly, after it connects automatical it is still buggy, things like searching, publishing files and saving connections are not working, for more information look into the topic called "amuled: Kad disconnects regularly, "connect kad" doesn't help""?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: realcruncher on November 26, 2007, 10:45:14 PM
call the topic:
search only works if connected to kad and ed2k but not if connected to kad only
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: Archmage on November 30, 2007, 08:05:49 AM
call the topic:
search only works if connected to kad and ed2k but not if connected to kad only

And where should I put the point that Kad isn't connecting, after it has been disconnected and did reconnected and than restarted, because it is not saving the Kad connections?
Title: Re: amuled: Kad disconnects regularly, "connect kad" doesn't help
Post by: RRT4 on April 20, 2008, 11:31:38 PM
Can someone confirm that this bug in amuled seems to be fixed in the current svn version?

ps: no disconnections in 12 hours of uptime (amuled - kad only) , i know that it is too little, but in my system i had disconnections from kad usually every 5 / 6 hours