Code Monkey home page Code Monkey logo

Comments (12)

mcollina avatar mcollina commented on July 20, 2024

Regarding the 'no such packet' error: it happens when a client has a subscription (even offline, with clean: false), and it sends a PUBACK (or QoS 2 equivalents) with an unknown messageId. This can be either a bug on this broker or on your client lib.

In your case, I think you are using clean: false, and the client is disconnected by the broker when it cannot match. The subscription cycle happens because the client is disconnected when such event happens. When the client reconnects, the broker tries sending the same packet, and the client acks with an unknown messageId. This is happening over and over again in your code.

Are you using QoS 1 or 2? Have you got some steps to reproduce? I thought I fixed all of those, but I've probably missed some cases. Also, a stacktrace can help debugging this.

from aedes.

guptaashishiitr avatar guptaashishiitr commented on July 20, 2024

Do you have a blog that explains mqtt basics clearly with different options we should be using?
I know clean:false is mainly used for persistence sessions and we were using clean:false which when we changed to clean:true one extra step is getting completed. Also we are using QOS2.

Error Stack Trace

2016-01-10T22:34:01.804Z - error: Error: no such packet
at MemoryPersistence.outgoingUpdate (/app/nodeApp/hopponnodejs/HopponSimulator/node_modules/aedes/node_modules/aedes-persistence/persistence.js:187:6)
at handlePubrec (/app/nodeApp/hopponnodejs/HopponSimulator/node_modules/aedes/lib/handlers/pubrec.js:13:29)
at handle (/app/nodeApp/hopponnodejs/HopponSimulator/node_modules/aedes/lib/handlers/index.js:43:7)
at Parser.enqueue (/app/nodeApp/hopponnodejs/HopponSimulator/node_modules/aedes/lib/client.js:208:3)
at Parser.emit (events.js:95:17)
at Parser.newPacket (/app/nodeApp/hopponnodejs/HopponSimulator/node_modules/aedes/node_modules/mqtt-packet/parser.js:30:10)
at Parser.parse (/app/nodeApp/hopponnodejs/HopponSimulator/node_modules/aedes/node_modules/mqtt-packet/parser.js:42:48)
at Socket.nextBatch (/app/nodeApp/hopponnodejs/HopponSimulator/node_modules/aedes/lib/client.js:55:23)
at Socket.emit (events.js:92:17)
at emitReadable
(_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at Socket.Readable.push (_stream_readable.js:128:10)
at TCP.onread (net.js:529:21)
2016-01-10T22:34:01.813Z - error: client error andr_3e619e2221571966 no such packet
2016-01-10T22:34:01.814Z - info: Client disconnected - andr_3e619e2221571966

from aedes.

guptaashishiitr avatar guptaashishiitr commented on July 20, 2024

Also this particular message is sent using aedes#publish to the topic subscribed to by an android client using poho client lib

from aedes.

mcollina avatar mcollina commented on July 20, 2024

That is helpful @guptaashishiitr.

I will work on this and get it fixed. I know what is happening, but I do not know why and how to fix this. I will investigate.

from aedes.

guptaashishiitr avatar guptaashishiitr commented on July 20, 2024

@mcollina - Appreciate the help. We are planning to launch our startup end of Jan. Not trying to push anything but we want to check if this is something that can be addressed soon. Let me know if I can help in any way. Thanks again.

from aedes.

mcollina avatar mcollina commented on July 20, 2024

Are you able to replicate the problem using MQTT.js or just mqtt-packet? I'm having trouble in replicating it in my unit tests.

Which version of Aedes are you running? Also, check what version of aedes-persistence is installed.

As a "quick fix", you can run on QoS 1.

from aedes.

guptaashishiitr avatar guptaashishiitr commented on July 20, 2024

@mcollina I wanted to check this with you that you asked for mqtt-packet in publish method but I am sending normal packet json with topic, qos etc should I create it using mqtt-packet? (converting it to buffer?) I am using 0.12.3 and I dont have aedes-persistence installed

from aedes.

mcollina avatar mcollina commented on July 20, 2024

@guptaashishiitr no need, I've just find a way to reproduce. The fix is along the way, but I'm currently busy, so it might take a couple of days (but I hope for tomorrow).

from aedes.

guptaashishiitr avatar guptaashishiitr commented on July 20, 2024

@mcollina - Thank you very much. Appreciate the help.

from aedes.

mcollina avatar mcollina commented on July 20, 2024

Released as 0.12.4.

from aedes.

guptaashishiitr avatar guptaashishiitr commented on July 20, 2024

hi
Thanks I tested it but starting to get client disconnects now

1452602353596 INFO new client andr_3e619e2221571966
1452602353597 INFO message published from broker to $SYS/EkYCGyCDl/new/clients 0
1452602353841 INFO Subscription Package:
{"topic":"user/10204470020541040/trip/5694f3e7c6fbf8144fd4c654/riderequests","qos":2}
1452602353841 INFO Client: andr_3e619e2221571966, Topic: user/10204470020541040/trip/5694f3e7c6fbf8144fd4c654/riderequests, Method: authorizeSubscribe; Entering function
1452602354419 INFO Client: andr_3e619e2221571966, Topic: user/10204470020541040/trip/5694f3e7c6fbf8144fd4c654/riderequests, Method: authorizeSubscribe; Subscription successful
1452602356190 INFO message published from broker to $SYS/EkYCGyCDl/heartbeat 0
1452602378812 INFO Client disconnected - andr_3e619e2221571966

from aedes.

mcollina avatar mcollina commented on July 20, 2024

Please open a different issue, with steps to reproduce.

from aedes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.