-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate messages when using stream management #879
Comments
this isn't how sm works. the server won't just resend all stanzas from the last ack but on resume the client tells the server the last sequence number. |
Don't have MAM right now, and the conversation isn't a MUC. The only reason I thought of sm is that it just started happening and I enabled sm yesterday and haven't made any other changes. I do also have carbons, but those have been on for some time. I will try to investigate more when I get time. |
Is there a good way to get an XML log file generated of stanzas in/out from Conversations for later analysis so I can debug this? |
I see this behavior fairly frequently; I haven't had a chance to triage yet though. Mostly (maybe exclusively) with muc for me. |
@SamWhited if yours is with MUC do you think it is sm related? This is definitely with a 1:1 |
If I notice it again I'll turn SM off and let you know. |
@SamWhited I just disabled my SM because it was getting too much. We'll see if the dupes go away again. What is your server set up? Is it prosody? What version? What mod_smacks version? Any other community (non-core) modules? Would be interesting for me to compare to mine, if you're not seeing this issue as much. Same questions for @iNPUTmice |
@singpolyma I'm on ejabberd 14.12, stream management on (the default). |
I experience the same. Sometimes I receive the same messages again and again, so I end up with a dozen or so copies. I have SM and MAM enabled on my Prosody 0.10_pre (6224:2f709bc35575) server. The time shown in the UI seems to be the received-time, as I guess from messages that are duplicated with more distance in time, but Conversation sorts messages by sent-time? Because duplicate messages are often shown like this: 1,1,1,1,1,1,2,2,2,2,2,2 |
@devurandom do you have mod_carbons as well? |
Yes |
I wonder if carbons is interacting with smacks in a stupid way... haven't had time yet to test this idea. |
I too have seen this issue fairly frequently (though, I must admit, I haven't experienced it in around a fortnight or more). I have Prosody 0.9.7, and mod_smacks and mod_carbons and mod_carbons_copies enabled, among others. |
More information:
This time it was like this:
|
Another instance of this issue:
Thus I conclude this case seems to be linked to offline messages. |
I enabled mod_smacks in prosody recently and have been receiving duplicate messages. Both parties are using conversations, and we are sending normal messages (not in a MUC or anything). |
I'm facing the same problem with Prosody and mod_smacks. No MUC or carbons. |
We have exactly the same issue. We have prosody 0.9.7 and 0.9.4 on another server. We never had such an issue with MUC only with "normal" chats. I anyone of the devs need an account to verify this, you can create an account at jabber.ipfire.org. We didn't have this issue with other xmpp clients like ChatSecure. |
Hrm, this is becoming a problem. Can anyone suggest an alternative android client with a nice UI, carbons and smacks support? |
I did some digging... It seems like with recent prosody versions with every resume the stanza count of Conversations falls one behind prosodys stanza count. Meaning the first resume is fine. The second resume will give us one more stanza, the third resume two more, the forth three and so forth. Depending on the situation (whether we received only messages or other stanzas as well) that will result in duplicate messages. those are the facts. now come the wild speculations. at this point I'm fairly certain that my stanza count (I'm counting every iq, presence and message) is correct. I reread my code did some debugging here and there. a wild guess could be that prosody counts the resumed element as stanza? I'm not seeing the behavior with 'older' versions of prosody. (I don't know exactly how old) And I haven't anyone complain about ejabberd. @vext01 the only other client a know of that supports SM is yaxim. Feel free to check this out and report back if you experience similar problems. That could help us narrow don't whether this is a server or a client problem. |
I just very quickly did some tests with yaxim myself. I managed to produce duplicate messages once but couldn't reliably reproduce the results. (Staging this is actually a bit difficult because first of you have to produce a number of resumes to let the count diverge enough and then make sure that $count last stanzas contain at least on real message (real meaning with body and not just some receipt stuff that won't show up in the UI) I'd love to see someone try yaxim for real for a couple of hours / days to see if yaxim really suffers from the same problem. |
@iNPUTmice Could you get us debug logs from when this happens? |
Woke up and tried to analyze the problem with a clear mind. I tried to eliminate as many non-message-with-body stanzas as possible. Left all the conference to get rid of some presence. Turned of message confirmation. I'm now sure that this doesn't happen with siacs.eu (I was previously afraid that I just never noticed the effects because of all the presence packets I receive) it does how ever happen with jabber.ipfire.org (both open for registration in case someone's interested) My test setup: Logged in with one siacs.eu and one jabber.ipfire.org account in Conversations. Send messages from my computer with the siacs.eu account to the ipfire account. With carbons enabled Conversations now receives the same amount of messages to each account. (carbon copies for the siacs.eu account and real messages for the ipfire account.) Unfortunately I'm no longer a 100% sure that the count diverges by one at every resume. Might have been a coincident and there are might be other reasons for the count to diverge. But I'm still about 80% sure. (This is all still very hard to measure because a) I have no access to the ipfire server logs b) there is no way I can know/request the servers count.) |
One more thing. I noticed that ipfire.org - if the latest stanzas are not messages - it will just resend the same iq stanza result multiple times.
There is something very weird going on... Either you haven't updated your prosody-modules in for ever or there is something wrong with the lua libraries? |
Hi iNPUTmice, if you could tell me from which timeframe you need the server logs, i can provide them to you. Thanks in advance for your debugging. Kind regards, morlix |
@Morlix at this point I'm fairly certain that this bug is not caused by Conversations. Please try to replicate the bug yourself under controlled circumstances. Feel free to do tests with yaxim as well. (Or any other client that supports SM.) and then send your log and findings to the prosody guys. |
Hmm after a short test with yaxim i can definitely say, that i get messages only repeated once with yaxim instead of multiple times with Conversations. I hope i find some more time to dig deeper into this. Meanwhile it would be great to know how you have tested this. |
@Morlix have a look at you can log the variable |
fwiw, I just received a duplicate on yaxim.
|
That's a good question. I believe they are. Are you thinking that maybe message receipts got lost and thus Conversatiosn resends them? In any case, I see another issue. Quite often, mesages jsut say "Sending...", even long after they were delivered to the other party. Maybe there really is an issue with message receipts rather than sm? |
Conversations does not use message receipts to resend messages. The message state is being switched from sending to sent after the servers stream managment has acked the message. if you see sending even after the recepient has received your message that means the server doesn't ack your messages which indicates a problem in SM.
@mase76 when/where did they say that? |
@iNPUTmice I already reported this issue via email with the prosody dev. gajim or pidgin cannot have this issue, as they don't support message streaming. How can we help to get rid of this very annoying issue? |
I'm happy to help. and I did so already as this thread shows. however I'm not experiencing the bug myself despite the fact that I am using prosody myself so my options are limited. |
I can create a test account for you on my server.gpg-id: ccdbc2cf |
bcdfdb9 introduces a config option to log Conversations’ stanza counts. This should make it visable if prosody stops incrementing stanza counts as @BrianBlade noticed:
I think it will be important to differentiate between messages being send multiple times and messages being received multiple times. with the debug option enabled Conversations should log something similiar to this after each message: if you are missing the second line or that line gives you a different stanza number something is wrong.
|
btw if you are unwilling to debug this yourself there is also the option of switching to ejabberd which doesn't seem to have those issues. I have no problem with prosody myself but the sm module in prosody is marked as unstable and so is the prosody version 0.10 which a lot of you seem to be using. stream managment in ejabberd on the other hand is available in the stable branch. |
We started having this issue on our Prosody 0.10 installation as well recently. We were trying to troubleshoot lots of failed image deliveries, long wait times, etc by downgrading our Conversations version. We started at 1.2.0 and then went to 1.1.0 and then I think finally to 1.0.0. After not really seeing any change we did a direct upgrade back to 1.2.0. Not sure if that is in any way helpful or not or just muddies the water so to speak. We are also using the smacks module with a default 5 minute timeout setting. I'm specifically using 0.10 in order to gain the MAM functionality.
When I noticed the duplication today it was first from a Pidgin client. I then checked Conversations on my Nexus 4 (Android 4.4.4) and saw them there as well. I checked the prosodyarchive table in the database and found them listed there as well. The sender did not see the duplicate messages in the list on their end. They initially reported send errors and then reported that those notices were gone when they glanced again. |
I reverted mod_smacks to |
I tried a mod_smacks version from January. Somewhat better, but not solved. |
The issue goes away with ejabberd 15.03 with all the modules enabled. |
@iNPUTmice Thanks for the new debug option. If anyone who is experiencing the issue can enable this and provide some insight, it will be really useful. Thanks! |
@mwild1 I assume that if we capture debug output you're only interested if we are running the latest version of |
@iNPUTmice Is the debug option included with bcdfdb9 part of the 1.3.0 version that was just released? I installed from Google Play and didn't see it listed anyway, but I am probably overlooking it. Is it turned on by default? |
@deoren No you will have to compile Conversations yourself. There is no UI setting for this. Just the hard coded Config.java variable. |
I have to report that the issue still appears with ejabberd. It was just quiet for two days, but now we are back to the full storm of old messages. |
@iNPUTmice thanks for clarifying. Any plans to add a toggle within the UI, perhaps under |
Hi Prosody-using folks. We just pushed some updates to mod_smacks in the prosody-modules repository. To update, run: hg pull -u -R /path/to/prosody-modules and restart Prosody. A reminder for future reports (even if you have already commented) please say what version of Conversations, Prosody and mod_smacks you are using (you can find the last one with the command: hg id /path/to/prosody-modules ). I'm interested to know if the update changes the behaviour in any way for people experiencing the issue. @iNPUTmice You don't experience the issue - what version of mod_smacks do you have? (see command above) |
I have updated my docker image: so far no duplicated messages |
@mgansler Maybe you can embed the version information into the Docker image tag or make it otherwise available? |
mgansler/prosody:0.10-132_e4867211cddb or if you want to build yourself: |
I worked on my docker images a bit: |
@mwild1 It may be too soon to tell, but I've not noticed any duplicate messages since upgrading to |
@mwild1 I'm using mod_smacks And I've also noticed that the session is automatically killed after a time without changing network state or restarting the server. Please tell me, how to help with that. |
@kriztan Any chance you could email some debug logs to matthew@prosody.im? |
Using Conversations 1.4.3, Prosody 0.10 1nightly139-1~trusty, mod_smacks 1733:9abd3dce619a I do not seem to get duplicates |
Anyone else still experiencing this issue on the updated versions? |
I did not get any duplicate messages within the last weeks. Prosody and mod_smacks was kept up to date all the time. |
Ok I'm closing here since this probably resolved and didn't seem to be a Conversations problem anyway. |
I enabled mod_smacks on my prosody, and now users with Conversations sometimes get duplicate messages when they reconnect. I expect that these are stanzas that got delivered right before the network cut and so the ack never got sent up to the server. It seems like Conversations should be able to detect this case (won't the stanza ids be the same?) and filter them out.
The text was updated successfully, but these errors were encountered: