Após subir a aplicação para o Heroku e testar a comunicação via socket.io, funciona corretamente. Após alguns segundos de ter feito isso, a aplicação da crash e no lugar é mostrada a mensagem no navegador "Application Error" assim que eu atualizo a pagina.
O log é o seguinte:
2016-08-10T14:21:57.174776+00:00 app[web.1]: events.js:141
2016-08-10T14:21:57.174787+00:00 app[web.1]: throw er; // Unhandled 'error' event
2016-08-10T14:21:57.174788+00:00 app[web.1]: ^
2016-08-10T14:21:57.174788+00:00 app[web.1]:
2016-08-10T14:21:57.174789+00:00 app[web.1]: Error: Quit inactivity timeout
2016-08-10T14:21:57.174790+00:00 app[web.1]: at Quit.<anonymous> (/app/node_modules/mysql/lib/protocol/Protocol.js:160:17)
2016-08-10T14:21:57.174791+00:00 app[web.1]: at emitNone (events.js:67:13)
2016-08-10T14:21:57.174791+00:00 app[web.1]: at Quit.emit (events.js:166:7)
2016-08-10T14:21:57.174794+00:00 app[web.1]: at Quit._onTimeout (/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:126:8)
2016-08-10T14:21:57.174795+00:00 app[web.1]: at Timer.listOnTimeout (timers.js:89:15)
2016-08-10T14:21:57.185663+00:00 app[web.1]:
2016-08-10T14:21:57.190588+00:00 app[web.1]: npm ERR! Linux 3.13.0-91-generic
2016-08-10T14:21:57.190963+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-08-10T14:21:57.191178+00:00 app[web.1]: npm ERR! node v4.1.1
2016-08-10T14:21:57.191548+00:00 app[web.1]: npm ERR! npm v2.14.4
2016-08-10T14:21:57.191857+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-08-10T14:21:57.192046+00:00 app[web.1]: npm ERR! casadocodigo@1.0.0 start: `node app`
2016-08-10T14:21:57.192208+00:00 app[web.1]: npm ERR! Exit status 1
2016-08-10T14:21:57.192395+00:00 app[web.1]: npm ERR!
2016-08-10T14:21:57.192561+00:00 app[web.1]: npm ERR! Failed at the casadocodigo@1.0.0 start script 'node app'.
2016-08-10T14:21:57.192779+00:00 app[web.1]: npm ERR! This is most likely a problem with the casadocodigo package,
2016-08-10T14:21:57.192969+00:00 app[web.1]: npm ERR! not with npm itself.
2016-08-10T14:21:57.193140+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-08-10T14:21:57.193308+00:00 app[web.1]: npm ERR! node app
2016-08-10T14:21:57.193472+00:00 app[web.1]: npm ERR! You can get their info via:
2016-08-10T14:21:57.193645+00:00 app[web.1]: npm ERR! npm owner ls casadocodigo
2016-08-10T14:21:57.193810+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-08-10T14:21:57.196399+00:00 app[web.1]:
2016-08-10T14:21:57.196630+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-08-10T14:21:57.196806+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-08-10T14:21:57.305443+00:00 heroku[web.1]: Process exited with status 1
2016-08-10T14:21:57.215660+00:00 heroku[router]: at=info method=GET path="/socket.io/?EIO=3&transport=websocket&sid=pXATLDpyA-XZlIVxAAAA" host=cdc-nodejs-jon.herokuapp.com request_id=ca70e067-3763-4bd0-b5af-e4d299d5ae5e fwd="195.113.224.147" dyno=web.1 connect=2ms service=29112ms status=101 bytes=175
2016-08-10T14:21:57.315357+00:00 heroku[web.1]: State changed from up to crashed
2016-08-10T14:21:58.663629+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/socket.io/?EIO=3&transport=polling&t=LPqrCt8" host=cdc-nodejs-jon.herokuapp.com request_id=65fb266d-6e7b-4397-b7cf-5d33de97b4e1 fwd="195.113.224.147" dyno= connect= service= status=503 bytes=
e essa última linha de App crashed fica repetindo pra sempre até eu reiniciar o dyno. Não consegui corrigir esse erro. Será um problema da lib mysql?