fzaninotto/uptime

curl of api/checks/:id/stats begin end causes uptime to crash

powellquiring opened this issue · 0 comments

dashboard$ curl localhost:8082/api/checks/55ce78dcb7df770600000002/stats/day?begin=1439510400000&end=1439596799999
dashboard$ TypeError: Cannot read property 'toString' of undefined
    at SchemaDate.cast (/opt/uptime/node_modules/mongoose/lib/schema/date.js:101:17)
    at SchemaDate.handleSingle (/opt/uptime/node_modules/mongoose/lib/schema/date.js:117:15)
    at SchemaDate.castForQuery (/opt/uptime/node_modules/mongoose/lib/schema/date.js:160:18)
    at Query.cast (/opt/uptime/node_modules/mongoose/lib/query.js:406:39)
    at QueryStream._init (/opt/uptime/node_modules/mongoose/lib/querystream.js:119:11)
    at /opt/uptime/node_modules/mongoose/lib/querystream.js:71:10
    at process._tickCallback (node.js:415:13)

I got this from the README substituting in a valid check id:

curl localhost:8082/api/checks/55ce78dcb7df770600000002/stats/month?begin=1383260400000&end=1385852399999

which also crashes.