yowsup icon indicating copy to clipboard operation
yowsup copied to clipboard

xml-not-well-formed [$15]

Open Dl0tt opened this issue 11 years ago • 18 comments

I'm getting this randomly:

Traceback (most recent call last): File "run.py", line 44, in stack.loop( timeout = 0.5, discrete = 0.5 ) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/stacks/yowstack.py", line 167, in loop asyncore.loop(_args, *_kwargs) File "/usr/lib/python2.7/asyncore.py", line 216, in loop poll_fun(timeout, map) File "/usr/lib/python2.7/asyncore.py", line 156, in poll read(obj) File "/usr/lib/python2.7/asyncore.py", line 87, in read obj.handle_error() File "/usr/lib/python2.7/asyncore.py", line 83, in read obj.handle_read_event() File "/usr/lib/python2.7/asyncore.py", line 449, in handle_read_event self.handle_read() File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/network/layer.py", line 72, in handle_read self.receive(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/network/layer.py", line 79, in receive self.toUpper(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/init.py", line 55, in toUpper self.upper.receive(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/stanzaregulator/layer.py", line 28, in receive self.processReceived() File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/stanzaregulator/layer.py", line 48, in processReceived self.toUpper(oneMessageData) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/__init.py", line 55, in toUpper self.upper.receive(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/auth/layer_crypt.py", line 63, in receive self.toUpper(payload) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/__init.py", line 55, in toUpper self.upper.receive(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/coder/layer.py", line 35, in receive self.toUpper(node) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/__init.py", line 55, in toUpper self.upper.receive(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/logger/layer.py", line 14, in receive self.toUpper(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/__init.py", line 55, in toUpper self.upper.receive(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/__init.py", line 160, in receive s.receive(data) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/init.py", line 101, in receive recv(node) File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.3.84-py2.7.egg/yowsup/layers/auth/layer_authentication.py", line 79, in handleStreamError raise AuthError("Unhandled stream:error node:\n%s" % node) yowsup.layers.auth.autherror.AuthError: Unhandled stream:error node: stream:error </stream:error>

I couldn't find what exacly what causes this to happen...

There is a $15 open bounty on this issue. Add to the bounty at Bountysource.

Dl0tt avatar Jun 08 '15 00:06 Dl0tt

post debug log before this message

CODeRUS avatar Jun 08 '15 00:06 CODeRUS

DEBUG:yowsup.layers.protocol_iq.layer:ping queue size: 1 DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.logger.layer:rx:

DEBUG:yowsup.layers.protocol_iq.layer:ping queue size: 1 DEBUG:yowsup.layers.logger.layer:tx:

DEBUG:yowsup.layers.logger.layer:rx:

DEBUG:yowsup.layers.logger.layer:rx: stream:error </stream:error>

Dl0tt avatar Jun 13 '15 00:06 Dl0tt

I have the same problem regardless of last transferred data being tx or rx. Even though sometimes after one rx from WA server, it sends me

<stream:error>
<xml-not-well-formed>
</xml-not-well-formed>
</stream:error>

and sometimes after tx e.g. to broadcast some messages it sends this again. Any solution? Have anyone seen any problem like me? Is it possible that asyncore sometimes does not send packets correctly and make them untidy?!

emamirazavi avatar Jun 20 '15 05:06 emamirazavi

Same Here

pedroccm avatar Jul 01 '15 21:07 pedroccm

Me too!

debianitram avatar Jul 03 '15 14:07 debianitram

me too.

On Fri, Jul 3, 2015 at 7:16 PM, Martín Miranda [email protected] wrote:

Me too!

— Reply to this email directly or view it on GitHub https://github.com/tgalal/yowsup/issues/856#issuecomment-118366604.

emamirazavi avatar Jul 03 '15 15:07 emamirazavi

I have the same problem happens after a few hours of being connected

ghost avatar Jul 07 '15 08:07 ghost

I found this: #904

Before:

@ProtocolEntityCallback("receipt")
def onReceipt(self, entity):
    ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", 'delivery', entity.getFrom())
    self.toLower(ack)

After:

@ProtocolEntityCallback("receipt")
def onReceipt(self, entity):
    ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", entity.getType(), entity.getFrom())
    self.toLower(ack)

Its run since 2 days ago .. :)

debianitram avatar Jul 07 '15 14:07 debianitram

Even with this settings i have had the problem.

On Tue, Jul 7, 2015 at 6:35 PM, Martín Miranda [email protected] wrote:

I found this: #904 https://github.com/tgalal/yowsup/issues/904

Before:

@ProtocolEntityCallback("receipt")def onReceipt(self, entity): ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", 'delivery', entity.getFrom()) self.toLower(ack)

After:

@ProtocolEntityCallback("receipt")def onReceipt(self, entity): ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", entity.getType(), entity.getFrom()) self.toLower(ack)

Its run since 2 days ago .. :)

— Reply to this email directly or view it on GitHub https://github.com/tgalal/yowsup/issues/856#issuecomment-119212877.

emamirazavi avatar Jul 07 '15 14:07 emamirazavi

I have the same configuration and after a few hours does the same

ghost avatar Jul 07 '15 15:07 ghost

Hey guys, nobody has found anything?

Unhandled exception in thread started by <bound method YowStack.loop of <yowsup.stacks.yowstack.YowStack object at 0x1105572d0>> Traceback (most recent call last):

......

" File "/Users/robertourita/.virtualenvs/whatsapp/lib/python2.7/site-packages/yowsup/layers/auth/layer_authentication.py", line 79, in handleStreamError raise AuthError("Unhandled stream:error node:\n%s" % node) yowsup.layers.auth.autherror.AuthError: Unhandled stream:error node: stream:error < xml-not-well-formed ></ xml-not-well-formed ></ stream:error >"

RobertUJ avatar Aug 28 '15 22:08 RobertUJ

same here... any news about this one? is it dangerous?

yniv avatar Dec 29 '15 10:12 yniv

I´m having the same Problem: Auth Error, reason Unhandled stream:error node: stream:error /stream:error

allready had the @ProtocolEntityCallback("receipt") as written by debianitram

Marcovus avatar Jan 11 '16 15:01 Marcovus

after watching the log I think this happens when a whatsapp sends receipts twice.

in my log I have:

2016-03-02 19:05:45 INFO fenster Sending Message Das Küchenfenster ist seit 34 Minuten auf. to XXXXXXXXXXXX 2016-03-02 19:05:45 INFO whatsapp Received ACK: ID 1456941945-1093 Class message 2016-03-02 19:05:46 INFO whatsapp Received Receipt: ID 1456941945-1093 2016-03-02 19:05:46 INFO whatsapp Sending ACK

about five minutes later:

`2016-03-02 19:10:41 INFO whatsapp Received Receipt: ID 1456941945-1093

2016-03-02 19:10:41 INFO whatsapp Sending ACK`

another five minutes later:

2016-03-02 19:14:27 INFO whatsapp Auth Error, reason Unhandled stream:error node: stream:error /stream:error

so as it seams the receipt with ID 1456941945-1093 is send twice and with the 2nd ACK the "xml not well formed error" happens.

How I can further investigate and check what is send with the ACK?

Marcovus avatar Mar 02 '16 19:03 Marcovus

Try to add the timestamp of the message you received to the receipt.

moyamo avatar Apr 09 '16 20:04 moyamo

thanks for your help, I´m sending receipt like this:

    @ProtocolEntityCallback("receipt")
    def onReceipt(self, entity):
        logger.info("Received Receipt: ID {}".format(entity._id))
        logger.info("Sending ACK")
        ack = OutgoingAckProtocolEntity(entity.getId(), "receipt", entity.getType(), entity.getFrom())
        self.toLower(entity.ack())

where do I have to add the timestamp?

Marcovus avatar Apr 10 '16 22:04 Marcovus

See my master where acks and receipts are updated.

jlguardi avatar Apr 11 '16 03:04 jlguardi

hello jlguardi, tried your master today but still get:

<stream:error>
<xml-not-well-formed>
</xml-not-well-formed>
</stream:error>

today after about 4 hours (no incoming or outgoing message in this period)

Marcovus avatar Apr 12 '16 17:04 Marcovus