Pita/etherpad-lite — Issue #312: MySQL issue when value is missing in the Database Part 2
Author: goldquest
Created: 2012-01-04 16:00:17+00:00
State: open

When I delete a group and make a new group afterwards, there can occur a problem when I have stored a cookie for the old group.
I try to delete the Session (with the sessionID from the cookie [to prevent too much stored sessions]) and Etherpad Lite finds the author for this session, but no group. So this returns an error and Etherpad lite shuts down.

Basically it shuts down, when there is a session, but no related group.

Maybe a good solution would be to delete all session for the groups, when a group is deleted, or just to return another error, like: "group for this session does not exists", but doesn't shutdown.

PS: When I use getSessionInfo to lookup the Session, it gives me an ok, but the group doesn't exists, so maybe the first solution would be better...

Here are the entries from our log:

[2012-01-04 16:33:18.051] [INFO] API - REQUEST, deleteSession, {"apikey":"[censored]","sessionID":"s.2XL8DoqZlY3O6b2S"}
[2012-01-04 16:33:18.052] [DEBUG] ueberDB - GET - session:s.2XL8DoqZlY3O6b2S - {"groupID":"g.MwJmsedoNOsg0aoD","authorID":"a.iqaSr5QxgGF50EM4","validUntil":1325701472} - from cache
[2012-01-04 16:33:18.052] [DEBUG] ueberDB - GET - group2sessions:g.MwJmsedoNOsg0aoD - null - from cache
[2012-01-04 16:33:18.052] [DEBUG] ueberDB - GET - author2sessions:a.iqaSr5QxgGF50EM4 - {"sessionIDs":{"s.LdEFmDhp3BMzZ62r":1,"s.rNjN6lfjG4goLgKW":1,"s.F7UccNBkRg8nsT2r":1,"s.cGm3kLqjnmOV0KnA":1,"s.c2yHHrfTppBfgiWe":1,"s.01ZguufBxCnQKXqR":1,"s.gEN2Bi2Ox4Pp6hOQ":1,"s.OiM5NV2SmsMnZN3p":1,"s.AzVDUcvjOIVWxbO4":1,"s.zG2zLVb5EoTLsAVv":1,"s.55rGiySUgq98ipvc":1,"s.0WScE3xcbk8hJpCM":1,"s.bS2VxRlEr6wBsyxg":1,"s.jcmzk6ZThc1RvdGr":1,"s.EpGcEkR4gKTPpdLa":1,"s.5u9sOlEdTBa2hEdJ":1,"s.O3OATEfNTHMIlf1k":1,"s.fpreYdWLigv1jMjk":1,"s.Y6yWSNFypeiDYRj4":1,"s.Gk85qlm3MrnBkfNj":1,"s.siYMAlk3RmooZPKX":1,"s.yGwArY3MKwxDEtMs":1,"s.XkeC1sCH91kVch27":1,"s.AxgjkJPQFPMo822l":1,"s.LNudTkRMTNPz9KBN":1,"s.DHboFlZWDnPRNqhU":1,"s.65cFIEsmz6zmwhMF":1,"s.QHyRwCoRjHeKBUd3":1,"s.qX76CHnuDlfsf0Vz":1,"s.xGfsukfXrHGl8rNZ":1,"s.3DdPKn5Jb211T42Y":1,"s.TZi1Sy6k7OktAJGu":1,"s.awKZanyAU9WnnGJt":1,"s.YkJSgploikOKhruv":1,"s.dtHxLlFm5hnDw9T2":1,"s.aSKvv0UDHZNrqqas":1,"s.OwTET4xgmPOa5H24":1,"s.yQHyOh4RiSI7LpN4":1,"s.VsPKNw3r8MgepO1L":1,"s.qQeiTyzABxf8WL04":1,"s.J1Lv9j7MeUIBD34B":1,"s.ZpzU3HNiygul6zef":1,"s.lo4IcVPzZ8xhRKJy":1,"s.ZdY8Wx3luthJyMak":1,"s.OPWBkjDQF0MQIfE4":1,"s.NStUqjQrw1AuCHnm":1,"s.MJr6XFrL5DwN0Bo6":1,"s.LC0eAiS8RxLwgfYX":1,"s.nPOgijlsSAHpI4DI":1,"s.w4swdPzdaRTU6lzN":1,"s.m0vpuniHzsv5XIb7":1,"s.6peWPf6YrjROxic6":1,"s.QVVbNsZj6VTQKn0N":1,"s.jOwjHtvjSu9Jqa6n":1,"s.BinnFpVOA4H0M1gK":1,"s.2XL8DoqZlY3O6b2S":1}} - from cache
[2012-01-04 16:33:18.053] [INFO] API - RESPONSE, deleteSession, 500
[2012-01-04 16:33:18.053] [INFO] http - 200, GET /api/1/deleteSession?apikey=[censored]&sessionID=s.2XL8DoqZlY3O6b2S
[2012-01-04 16:33:18.053] [ERROR] console - TypeError: Cannot read property 'sessionIDs' of null
at /var/lib/nodejs/node-apps/etherpad-lite/node/db/SessionManager.js:264:28
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:494:21
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:194:13
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:118:13
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/async/lib/async.js:129:25
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/SessionManager.js:254:9)
at /var/lib/nodejs/node-apps/etherpad-lite/node_modules/ueberDB/CloneAndAtomicLayer.js:95:17
at [object Object].get (/var/lib/nodejs/node-apps/etherpad-lite/node_modules/ueberDB/CacheAndBufferLayer.js:142:5)
[2012-01-04 16:33:18.053] [INFO] console - graceful shutdown...
[2012-01-04 16:33:18.123] [INFO] console - db sucessfully closed.