Closed Bug 553397 Opened 15 years ago Closed 15 years ago

cake_sessions can contain bad data. don't crash

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jbalogh, Assigned: clouserw)

References

Details

(Whiteboard: [z][stabby][need:livepages][patch][qa-])

Attachments

(1 file)

We're trying to load the user data from the serialized php array. We should probably remove the bad row from the sessions table. That'll force the user to be logged out, but hopefully they'll be able to log in successfully later. Traceback (most recent call last): File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/core/handlers/base.py", line 80, in get_response response = middleware_method(request) File "/data/amo_python/www/preview/zamboni/apps/cake/middleware.py", line 32, in process_request user = auth.authenticate(session=session) File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/contrib/auth/__init__.py", line 50, in authenticate user = backend.authenticate(**credentials) File "/data/amo_python/www/preview/zamboni/apps/cake/backends.py", line 24, in authenticate php_user = phpserialize.loads(serialized_data) File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/phpserialize.py", line 457, in loads object_hook, array_hook) File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/phpserialize.py", line 448, in load return _unserialize() File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/phpserialize.py", line 435, in _unserialize return array_hook(_load_array()) File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/phpserialize.py", line 401, in _load_array item = _unserialize() File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/phpserialize.py", line 428, in _unserialize _expect('"') File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/phpserialize.py", line 382, in _expect raise ValueError('failed expectation, expected %r got %r' % (e, v)) ValueError: failed expectation, expected '"' got u';'
(Quoth clouserw in bug 557518 comment 0) > This is a lower priority than the other 5.9 bugs I think this should be a high priority since we're crashing here. But since this is the first time we're seeing the crash from the API, I guess not too many people are affected. We could force people with AMOv3 cookies to remora through Zeus if we need a quick fix.
Target Milestone: --- → 5.10
Attached patch fixSplinter Review
We've seen this twice total and I don't know it would happen, but it's not something worth spending a lot of time on. Here's a patch that catches it.
Assignee: nobody → clouserw
Attachment #438155 - Flags: review?(dd)
Comment on attachment 438155 [details] [diff] [review] fix r+, Looks great. I'd prefer it to be log.warn. Nothing really breaks, it's not a zamboni generated issue, it's just bad data that we're having to deal with.
Attachment #438155 - Flags: review?(dd) → review+
Whiteboard: [z][stabby][need:livepages] → [z][stabby][need:livepages][patch]
thanks, 35b240dee052c3ec26ea2e20eecd37abf785ef73
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Was there a specific URL that reproduced this, against which I can verify, or was this a one-off thing that you happened to have a stack on?
I don't know of a URL. I wouldn't worry about it.
Whiteboard: [z][stabby][need:livepages][patch] → [z][stabby][need:livepages][patch][qa-]
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: