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

Decoder Stream 11 not implemented #34

Open
pbihler opened this issue Jul 15, 2015 · 9 comments
Open

Decoder Stream 11 not implemented #34

pbihler opened this issue Jul 15, 2015 · 9 comments

Comments

@pbihler
Copy link

pbihler commented Jul 15, 2015

On our production server, I received this error causing a server restart:

Error uncaughtException: DecoderStream 11 not implemented.

Error: DecoderStream 11 not implemented.
 at Decoder._nudge (/home/code/live/agentXserver/node_modules/apnagent/node_modules/lotus/lib/lotus/decoder.js:138:18)
 at Buffers.g (events.js:199:16)
 at Buffers.emit (events.js:107:17)
 at Buffers.push (/home/code/live/agentXserver/node_modules/apnagent/node_modules/lotus/node_modules/bufs/lib/bufs.js:73:10)
 at Decoder._write (/home/code/live/agentXserver/node_modules/apnagent/node_modules/lotus/lib/lotus/decoder.js:154:15)
 at doWrite (_stream_writable.js:301:12)
 at writeOrBuffer (_stream_writable.js:288:5)
 at Decoder.Writable.write (_stream_writable.js:217:11)
 at TLSSocket.<anonymous> (/home/code/live/agentXserver/node_modules/apnagent/lib/apnagent/agent/live.js:159:18)
 at TLSSocket.emit (events.js:107:17)
 at readableAddChunk (_stream_readable.js:163:16)
 at TLSSocket.Readable.push (_stream_readable.js:126:10)
 at TCP.onread (net.js:538:20)

How can I catch it?

@ExploreMqt
Copy link
Collaborator

I'll take look and see if I can figure something out for you. I probably won't have an answer for you immediately. I'm still getting to know the internals.

@logicalparadox
Copy link
Owner

This is a tough one as it has to do with the parsing of the streaming buffer incoming from Apple. The 11 indicated with sub-stream on the multiplex to route the data to. With APN, there shouldn't be an 11 that I'm aware of. Two possibilites:

  • APN binary protocols added more stuff that I'm not aware of. See Apple's documentation.
  • Packet loss caused the internal counter to reference the wrong position on the incoming stream.

Has this only happened once?

@pbihler
Copy link
Author

pbihler commented Jul 15, 2015

It just occured once, but we're not on heavy traffic, yet.

@ExploreMqt
Copy link
Collaborator

The unit tests for my app, which uses apnAgent, was running in the back ground and I just got this stack trace. I must not have something faked out correctly. But it also looks very familiar...
Error: DecoderStream 11 not implemented.
at Decoder._nudge (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/node_modules/lotus/lib/lotus/decoder.js:138:18)
at Buffers.g (events.js:260:16)
at emitOne (events.js:77:13)
at Buffers.emit (events.js:169:7)
at Buffers.push (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/node_modules/lotus/node_modules/bufs/lib/bufs.js:73:10)
at Decoder._write (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/node_modules/lotus/lib/lotus/decoder.js:154:15)
at doWrite (_stream_writable.js:292:12)
at writeOrBuffer (_stream_writable.js:278:5)
at Decoder.Writable.write (_stream_writable.js:207:11)
at TLSSocket. (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/lib/apnagent/agent/live.js:159:18)
at emitOne (events.js:77:13)
at TLSSocket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at TLSSocket.Readable.push (_stream_readable.js:110:10)
at TLSWrap.onread (net.js:521:20)
npm ERR! Test failed. See above for more details.

@logicalparadox
Copy link
Owner

Interesting indeed....

According to apn binary spec that should only ever be an 8 (as this is the response decoder).

Apple only ever sends a response back if the message had a problem. Since you both get 11 and there is no error code associated with 11, that should be getting parsed out. Furthermore, since you are both getting 11 it seems weird that it is left-overs from the identifier, as that would yield different results every time.

Before fixing this need to figure out where the 11 is coming from. Try sending a message that will trigger each of the error scenarios. Also, did either of you get an actual response error prior to this stack getting triggered?

@ExploreMqt
Copy link
Collaborator

This is everything from the last passing test to the point I restarted tests
71 passing (68ms)

/Users/jim/Projects/TMinus5/CometServer/test/botVotingTests.js:156
: spy
^
SyntaxError: Unexpected token :
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /Users/jim/Projects/TMinus5/CometServer/node_modules/mocha/lib/mocha.js:192:27
at Array.forEach (native)
at Mocha.loadFiles (/Users/jim/Projects/TMinus5/CometServer/node_modules/mocha/lib/mocha.js:189:14)
at Mocha.run (/Users/jim/Projects/TMinus5/CometServer/node_modules/mocha/lib/mocha.js:422:31)
at loadAndRun (/Users/jim/Projects/TMinus5/CometServer/node_modules/mocha/bin/_mocha:353:22)
at rerun (/Users/jim/Projects/TMinus5/CometServer/node_modules/mocha/bin/_mocha:380:5)
at /Users/jim/Projects/TMinus5/CometServer/node_modules/mocha/bin/_mocha:388:7
at StatWatcher. (/Users/jim/Projects/TMinus5/CometServer/node_modules/mocha/lib/utils.js:166:36)
at emitTwo (events.js:87:13)
at StatWatcher.emit (events.js:172:7)
at StatWatcher._handle.onchange (fs.js:1285:10)
events.js:141
throw er; // Unhandled 'error' event
^
Error: DecoderStream 11 not implemented.
at Decoder._nudge (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/node_modules/lotus/lib/lotus/decoder.js:138:18)
at Buffers.g (events.js:260:16)
at emitOne (events.js:77:13)
at Buffers.emit (events.js:169:7)
at Buffers.push (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/node_modules/lotus/node_modules/bufs/lib/bufs.js:73:10)
at Decoder._write (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/node_modules/lotus/lib/lotus/decoder.js:154:15)
at doWrite (_stream_writable.js:292:12)
at writeOrBuffer (_stream_writable.js:278:5)
at Decoder.Writable.write (_stream_writable.js:207:11)
at TLSSocket. (/Users/jim/Projects/TMinus5/CometServer/node_modules/apnagent/lib/apnagent/agent/live.js:159:18)
at emitOne (events.js:77:13)
at TLSSocket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at TLSSocket.Readable.push (_stream_readable.js:110:10)
at TLSWrap.onread (net.js:521:20)
npm ERR! Test failed. See above for more details.
Jims-MBP-2:CometServer jim$ npm test

@ExploreMqt
Copy link
Collaborator

I have autoSave turned on for my editor, so I frequently get "unexpected token" issues in my test records.

@yourei
Copy link

yourei commented Jul 23, 2015

I am getting the same error on my server side as well. Any updates? Thanks!

@alexpersian
Copy link

Just to add more information to this issue, we have been getting the same error on our server using apnagent. Here's a screen grab.
error

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

5 participants