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

Bad iq format error #4489

Open
oybek opened this issue Feb 19, 2025 · 2 comments
Open

Bad iq format error #4489

oybek opened this issue Feb 19, 2025 · 2 comments

Comments

@oybek
Copy link

oybek commented Feb 19, 2025

Getting:

parse_iq_id_failed, getting bad iq, without _ symbol, what could be source of such iqs?

<iq xmlns='jabber:client' id='c6f59123b9721df6' to='my.domain.com' type='result'/>

Source file where error happening: ejabberd_local.erl:447

@arcusfelis
Copy link
Contributor

Hi, we use ejabberd_local:route_iq when server wants to ask client something. I.e. it wants to send IQ get or set to the client.
It is used in mod_caps, for example. Or could be used in mod_ping or similar modules (but I think mod_ping uses optimized version, because mod_ping requests are send by the same server node as a client on - so no need to route response from between nodes).

So, idea is simple - we route IQ to some client in cluster, it could be on another node. But once we receive iq type=result, what should we do with it? we use IQ ids which contain the node number, where to send the reply for the actual processing by the server.

Your case - client sends an IQ result for IQ we never asked for (unless you have some module which sends IQ get/setto the client and puts from="my.domain.com" in it)

We should fix parsing though, and just ignore such unexpected/unwanted IQs.

@arcusfelis
Copy link
Contributor

I think we should reply with something like that:

    <iq type="error" id="UNEXPECTED_ID" from="server.example.com" to="[email protected]/resource">
      <error type="cancel">
        <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
      </error>
    </iq>

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

2 participants