Status subsystem crashes when there are custom status page preferences

Bug #263931 reported by Morten Brekkevold
4
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Medium
Morten Brekkevold
3.4
Fix Released
Medium
Morten Brekkevold
3.5
Fix Released
Medium
Morten Brekkevold

Bug Description

Erlend B. Midttun reports that the Status page crashes in NAV 3.4. He provides the following traceback:

MOD_PYTHON ERROR

ProcessId: 24665
Interpreter: 'nav.example.com'

ServerName: 'nav.example.com'
DocumentRoot: '/var/www/nav'

URI: '/status/'
Location: None
Directory: '/var/www/nav/status/'
Filename: '/var/www/nav/status/'
PathInfo: ''

Phase: 'PythonHandler'
Handler: 'status'

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/var/www/nav/status/status.py", line 71, in handler
    output = indexInternal(req)

  File "/var/www/nav/status/status.py", line 107, in indexInternal
    prefs = HandleStatusPrefs.loadPrefs(req)

  File "/var/www/nav/status/StatusPrefs.py", line 325, in loadPrefs
    prefs = cPickle.loads(data)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 991, in load_module
    return _global_modules_cache.import_module(self.__file)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 488, in import_module
    assert(file != parent_info.file), "Import cycle in %s." % file

AssertionError: Import cycle in /var/www/nav/status/StatusPrefs.py.

MODULE CACHE DETAILS

Accessed: Mon Sep 1 15:37:38 2008
Generation: 4

_mp_2c0249d9bac570f5e9fe8584733f49ed {
  FileName: '/var/www/nav/status/StatusPrefs.py'
  Instance: 1
  Generation: 2
  Modified: Wed Aug 27 15:49:22 2008
  Imported: Mon Sep 1 14:40:07 2008
  Children: '/var/www/nav/status/StatusSections.py'
}

_mp_7969d392bfd3a7dbe1dc8e711b304cdd {
  FileName: '/var/www/nav/status/StatusSections.py'
  Instance: 1
  Generation: 1
  Modified: Wed Aug 27 15:49:22 2008
  Imported: Mon Sep 1 14:40:07 2008
}

_mp_3f1e7ad3a807a9d3cb97d6663939a57d {
  FileName: '/var/www/nav/status/status.py'
  Instance: 1
  Generation: 3
  Modified: Wed Aug 27 15:49:22 2008
  Imported: Mon Sep 1 14:40:07 2008
  Children: '/var/www/nav/status/StatusPrefs.py',
                '/var/www/nav/status/StatusSections.py'
}

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

This is related to https://bugs.launchpad.net/nav/+bug/258260 , and is a result of the issue described at http://www.dscpl.com.au/wiki/ModPython/Articles/IssuesWithSessionObjects .

NAV still saves individual users' status preferences as pickled objects in the database. The bug in LP#258260 affected all users because of unpickling the set of default preferences, while this bug affects those who have saved custom status page preferences.

Changed in nav:
assignee: nobody → mvold
status: New → Confirmed
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Fix committed in rev 39445ac3f904 on the series/3.4.x branch: http://metanav.uninett.no/hg/series/3.4.x/rev/39445ac3f904

The fix pickles pure Python data types instead of NAV StatusPref objects. Users' old status preferences will be ignored by the fix, these have to be manually reconfigured by the affected users.

Changed in nav:
importance: Undecided → Medium
milestone: none → v3.4.3
status: Confirmed → Fix Committed
Changed in nav:
status: Fix Committed → Fix Released
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

The bugfix was released in 3.4.3, but it seems it reverses the incidence of the bug.

Those who were affected by the bug are now not, while those who were unaffected are now affected by it (or actually a similar issue) in 3.4.3. The bug should be reopened.

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

I've written a regression fix for this, but I cannot reliably test it at this time.

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Still not able to test this on an affected installation, but it doesn't break for working installs.

Fixed in rev aee7f3df4b19 and pushed to series/3.4.x: http://metanav.uninett.no/hg/series/3.4.x/rev/aee7f3df4b19

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

To purge all status preference settings (for all users) from the database, connect to the navprofiles database using psql ("psql navprofiles nav"), and execute the following SQL:

DELETE FROM accountproperty WHERE property='statusprefs';

This should fix the status page crashes seen by some in NAV 3.4.3.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.