buddycloud/buddycloud-server — Issue #35: occasional crashes with 0.1.9
Author: highfellow
Created: 2012-01-17 07:48:51+00:00
State: open

Hi,

I'm getting occasional server crashes with v0.1.9. I've finally managed to log the error properly - I started it with:

`nohup $PROG_PATH < /dev/null >$HOME/var/log/buddycloud.err 2>&1 &`

`buddycloud.err` looks like this:

```
/home/highfellow/lib/node_modules/buddycloud-server/lib/router.js:325
return cb2(err, results != null ? (_ref = results.rsm) != null ? _
^
TypeError: undefined is not a function
at /home/highfellow/lib/node_modules/buddycloud-server/lib/router.js:325:20
at /home/highfellow/lib/node_modules/buddycloud-server/node_modules/async/lib/async.js:105:25
at /home/highfellow/lib/node_modules/buddycloud-server/lib/router.js:319:26
at /home/highfellow/lib/node_modules/buddycloud-server/lib/router.js:292:16
at /home/highfellow/lib/node_modules/buddycloud-server/lib/sync.js:233:14
at Object.callback (/home/highfellow/lib/node_modules/buddycloud-server/node_modules/async/lib/async.js:126:25)
at /home/highfellow/lib/node_modules/buddycloud-server/node_modules/async/lib/async.js:609:43
at /home/highfellow/lib/node_modules/buddycloud-server/lib/sync.js:211:20
at [object Object].callback (/home/highfellow/lib/node_modules/buddycloud-server/lib/local/model_postgres.js:193:16)
at [object Object].handleReadyForQuery (/home/highfellow/lib/node_modules/buddycloud-server/node_modules/pg/lib/query.js:78:10)
```

The end of `buddycloud-server.log` (DEBUG level) looks like this:
```

[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [sync] PaginatedSynchronization walk kwailo@buddycloud.org
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [xmpp/backend_pubsub] [object Object]
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [xmpp/backend_pubsub] found service for mrflix@buddycloud.org: channels.buddycloud.org
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [sync] ranRequest 18
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [sync] PaginatedSynchronization walk kwailo@buddycloud.org
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [xmpp/backend_pubsub] [object Object]
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [xmpp/backend_pubsub] found service for mrflix@buddycloud.org: channels.buddycloud.org
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [sync] ranRequest 0
[Tue, 17 Jan 2012 07:42:14 GMT] INFO [sync] synced /user/mrflix@buddycloud.org/subscriptions
[Tue, 17 Jan 2012 07:42:14 GMT] DEBUG [sync] ranRequest 0
[Tue, 17 Jan 2012 07:42:14 GMT] INFO [sync] synced /user/mrflix@buddycloud.org/geo/next
[Tue, 17 Jan 2012 07:42:35 GMT] DEBUG [xmpp/pubsub_server] found subrequest
[Tue, 17 Jan 2012 07:42:35 GMT] INFO [router] Router.run andy@highfellow.org(user)/andy@highfellow.org: browse-node-info /user/simon@buddycloud.com/posts
[Tue, 17 Jan 2012 07:42:35 GMT] DEBUG [xmpp/backend_pubsub] [object Object]
[Tue, 17 Jan 2012 07:42:35 GMT] DEBUG [xmpp/backend_pubsub] discover items of buddycloud.com
[Tue, 17 Jan 2012 07:42:36 GMT] DEBUG [xmpp/pubsub_client] [object Object]
```

The crashes are quite intermittent - they can happen after a few minutes, a few hours, or a day. They don't happen at a fixed time of day as far as I've noticed.