Comments (12)
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.
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.
Also this particular message is sent using aedes#publish to the topic subscribed to by an android client using poho client lib
from aedes.
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.
@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.
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.
@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.
@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.
@mcollina - Thank you very much. Appreciate the help.
from aedes.
Released as 0.12.4.
from aedes.
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.
Please open a different issue, with steps to reproduce.
from aedes.
Related Issues (20)
- [question] Connecting to AEDES with Certificates HOT 1
- Aedes handle, client not connected HOT 1
- Why is CONNACK returned before the end of on.connect HOT 2
- [question] Kotlin Android examples
- Difficult to use in ES6 module package. HOT 10
- [question] How to get client ip address in Websocket mode HOT 1
- [feat!]: change to named exports to enable monkey patching HOT 11
- [question] Parsing a packet that come from old mqtt client version HOT 5
- Can Aedes send webhooks? HOT 2
- [bug] - TypeError during aedes Module Initialization
- mqtt服务启动后无法打印内容 HOT 2
- [bug] Aedes is undefined in Typescript HOT 7
- [bug] duplicated closed clients HOT 1
- [bug]"done" is not a function
- [question] does the test "unsubscribe throws error" valid? HOT 3
- [question] Any way to add data to connect packet and authorize handler? HOT 2
- [question]Frequent service clientError Error: invalid status code: 12592 HOT 1
- [bug] Number of TCP Connections accepted on container is less than the one deployed in EC2 machine HOT 7
- [bug] console.error introduced in v0.51.0 HOT 1
- [bug] Not all messages are consumed when dedupe is enabled HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aedes.