Skip to content
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

xmpp problems #1864

Closed
Hinnack opened this issue Jul 13, 2016 · 2 comments
Closed

xmpp problems #1864

Hinnack opened this issue Jul 13, 2016 · 2 comments

Comments

@Hinnack
Copy link

Hinnack commented Jul 13, 2016

I sometimes get this error on xmpp notifications:

  File "/var/lib/shinken/libexec/notify_by_xmpp.py", line 78, in <module>
    auth = c.auth(user=username, password=password, resource=resource)
  File "/usr/lib/python2.7/dist-packages/xmpp/client.py", line 229, in auth
    if self.Bind.Bind(resource):
  File "/usr/lib/python2.7/dist-packages/xmpp/auth.py", line 250, in Bind
    resp=self._owner.SendAndWaitForResponse(Protocol('iq',typ='set',payload=[Node('session',attrs={'xmlns':NS_SESSION})]))
  File "/usr/lib/python2.7/dist-packages/xmpp/dispatcher.py", line 337, in SendAndWaitForResponse
    return self.WaitForResponse(self.send(stanza),timeout)
  File "/usr/lib/python2.7/dist-packages/xmpp/dispatcher.py", line 321, in WaitForResponse
    if not self.Process(0.04):
  File "/usr/lib/python2.7/dist-packages/xmpp/dispatcher.py", line 303, in dispatch
    handler['func'](session,stanza)
  File "/usr/lib/python2.7/dist-packages/xmpp/dispatcher.py", line 215, in streamErrorHandler
    raise exc((name,text))
xmpp.protocol.Conflict: (u'conflict', '')
@justinpryzby
Copy link

I'm seeing the same thing, and seems to be due to XMPP server disconnecting the first client connection when a 2nd connection begins with same (user,resource) pair:

sendto(0, "<iq type="set" id="2"><session xmlns="urn:ietf:params:xml:ns:xmpp-session" />", 82, 0, NULL, 0) = 82
gettimeofday({1470387064, 277512}, NULL) = 0
select(1, [0], [], [], {0, 40000}) = 1 (in [0], left {0, 39997})
recvfrom(0, "<stream:error xmlns:stream='http://etherx.jabber.org/streams'>/stream:error/stream:stream", 1024, 0, NULL, NULL) = 148

In jabberd2 sm.log:
Fri Aug 5 11:21:03 2016 [notice] session started: jid=nagios@telsasoft/xsend
Fri Aug 5 11:21:04 2016 [notice] session replaced: jid=nagios@telsasoft/xsend
Fri Aug 5 11:21:04 2016 [notice] session replaced: jid=nagios@telsasoft/xsend
Fri Aug 5 11:21:04 2016 [notice] session ended: jid=nagios@telsasoft/xsend
Fri Aug 5 11:21:04 2016 [notice] user unloaded jid=nagios@telsasoft

One can reliably reproduce the problem by running it rapidly in the background:
sudo -Hu shinken sh -c 'for a in seq 1 3; do { /var/lib/shinken/xsend.py justinp@telsasoft sadf >/dev/null || echo failed; } & done'

I was able to work around the problem by removing the "/resource" from ~shinken/.xsend (however that causes my messages to have a 2 char hex suffix to be appended).

@olivierHa
Copy link
Collaborator

It's not really an issue with Shinken. I think a quick workaround is to set your reactionner with only one worker. This should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants