Pita/etherpad-lite — Issue #282: MySQL issue when value is missing
Author: goldquest
Created: 2011-12-07 21:07:44+00:00
State: open

When I use the MySQL database driver and want to access a groupID the driver returns NULL to etherpad and the api returns "code 2 internal error" and shuts down.

[2011-12-07 20:59:17.541] [INFO] API - REQUEST, deleteGroup, {"apikey":"secret","groupID":"g.zV6wGrUJUwyYr6fl"}
[2011-12-07 20:59:17.543] [DEBUG] ueberDB - GET - group:g.zV6wGrUJUwyYr6fl - null - from database
[2011-12-07 20:59:17.543] [INFO] API - RESPONSE, deleteGroup, {"code":2,"message":"internal error","data":null}
[2011-12-07 20:59:17.544] [INFO] http - 200, GET /api/1/deleteGroup?apikey=secret&groupID=g.zV6wGrUJUwyYr6fl
[2011-12-07 20:59:17.544] [ERROR] console - Async Stacktrace:
at /var/lib/nodejs/node-apps/etherpad-lite/node/handler/APIHandler.js:126:7

Error: [object Object]
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async-stacktrace/ERR.js:46:13
at /var/lib/nodejs/node-apps/etherpad-lite/node/db/GroupManager.js:108:8
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:199:13
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:120:21
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:196:17
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:499:34
at Object.callback (/var/lib/nodejs/node-apps/etherpad-lite/node/db/GroupManager.js:43:11)
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/ueberDB/CloneAndAtomicLayer.js:95:17
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/ueberDB/CacheAndBufferLayer.js:183:7
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/ueberDB/mysql_db.js:68:5
[2011-12-07 20:59:17.544] [INFO] console - graceful shutdown...
[2011-12-07 20:59:17.643] [INFO] console - db sucessfully closed.

I don't know or tested it enough, if there is a problem everytime when an ID doesn't exists. But if so, then it should return a code 1 failure i think.