Discussion:
Strange Python Errors after Upgrade to latest Beta
Rudolph Bott
2010-07-21 12:25:02 UTC
Permalink
Hi List,

I upgraded my 3.5.4 installation of NAV to the latest Beta (3.6.0b4) and
ran into the error posted below. I configured NAV from scratch, updated
the Database with the pgsql scripts and everything seems to be fine: I
can login using a LDAP backend, see the welcome page and user
information etc - but as soon as I click on 'Toolbox' I receive an error
message.

It thought it might be related to the 'ForgetSQL thing' but according to
this list, ForgetSQL is not a requirement any more (starting with 3.6) -
or am I wrong on this one?

My system is Ubuntu 9.04, running with Python 2.5.4 and 2.6.2 installed.
ForgetSQL is 0.5.1.

== snip ==

MOD_PYTHON ERROR

ProcessId: 22003
Interpreter: '<hostname>'

ServerName: '<hostname>'
DocumentRoot: '/usr/local/nav/apache/webroot'

URI: '/toolbox/'
Location: None
Directory: '/usr/local/nav/apache/webroot/toolbox/'
Filename: '/usr/local/nav/apache/webroot/toolbox/'
PathInfo: ''

Phase: 'PythonHandler'
Handler: 'toolbox'

Traceback (most recent call last):

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

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

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

File "/usr/local/nav/apache/webroot/toolbox/toolbox.py", line 39, in handler
page.tools = toolbox.filterToolList(toolbox.getToolList(), req.session['user'])

File "/usr/local/nav/lib/python/nav/web/toolbox.py", line 71, in filterToolList
if nav.auth.hasPrivilege(user, 'web_access', tool.uri):

File "/usr/local/nav/lib/python/nav/auth.py", line 58, in hasPrivilege
raise "user parameter is of invalid type %s" % type(user)

TypeError: exceptions must be classes or instances, not str


MODULE CACHE DETAILS

Accessed: Wed Jul 21 14:12:30 2010
Generation: 1

_mp_34a3546f4bff52bdef2b9323a235d99b {
FileName: '/usr/local/nav/apache/webroot/toolbox/toolbox.py'
Instance: 1 [IMPORT]
Generation: 2
Modified: Mon Nov 16 11:51:45 2009
Imported: Wed Jul 21 14:12:30 2010
}

== snip ==

Any help would be appreciated!


Regards,

Rudolph Bott
Morten Brekkevold
2010-07-22 18:10:41 UTC
Permalink
Post by Rudolph Bott
information etc - but as soon as I click on 'Toolbox' I receive an error
message.
It thought it might be related to the 'ForgetSQL thing' but according to
this list, ForgetSQL is not a requirement any more (starting with 3.6) -
or am I wrong on this one?
forgetSQL is no longer used by NAV, correct.
Post by Rudolph Bott
File "/usr/local/nav/lib/python/nav/auth.py", line 58, in hasPrivilege
raise "user parameter is of invalid type %s" % type(user)
TypeError: exceptions must be classes or instances, not str
This is Python 2.6 complaining (this was deprecated in 2.5, but removed
entirely from 2.6, hence the error). The referenced code, however, is not
present in NAV 3.6.0b4, which leads me to think:

1. Some old, deprecated modules might be still be around in your file system.
Did you delete all the ones specified in the release notes?

2. Apache/mod_python may in part still be serving old code. Please restart
Apache after upgrading.
Post by Rudolph Bott
Any help would be appreciated!
Hope this helps :)
--
mvh
Morten Brekkevold
UNINETT
Rudolph Bott
2010-07-23 06:06:36 UTC
Permalink
Hey Morten,
Post by Morten Brekkevold
Post by Rudolph Bott
information etc - but as soon as I click on 'Toolbox' I receive an error
message.
It thought it might be related to the 'ForgetSQL thing' but according to
this list, ForgetSQL is not a requirement any more (starting with 3.6) -
or am I wrong on this one?
forgetSQL is no longer used by NAV, correct.
Post by Rudolph Bott
File "/usr/local/nav/lib/python/nav/auth.py", line 58, in hasPrivilege
raise "user parameter is of invalid type %s" % type(user)
TypeError: exceptions must be classes or instances, not str
This is Python 2.6 complaining (this was deprecated in 2.5, but removed
entirely from 2.6, hence the error). The referenced code, however, is not
1. Some old, deprecated modules might be still be around in your file system.
Did you delete all the ones specified in the release notes?
oops, I did a make install and did not move the old /usr/local/nav
folder out of the way. I did that now, replaced the fresh etc-folder
with the backuped-one but now I cannot start nav alltogether:

***@dkvfs033:/usr/local/nav# nav start
/usr/local/nav/lib/python/nav/models/profiles.py:23: DeprecationWarning:
the md5 module is deprecated; use hashlib instead
import md5
Starting: cricket logengine mactrace maintengine networkDiscovery
thresholdMon
Failed: alertengine eventengine getDeviceData ipdevpoll pping servicemon
smsd snmptrapd

Nothing in the var/log folder whatsoever :(
Post by Morten Brekkevold
2. Apache/mod_python may in part still be serving old code. Please restart
Apache after upgrading.
Did that several times already :)
Post by Morten Brekkevold
Post by Rudolph Bott
Any help would be appreciated!
Hope this helps :)
Morten Brekkevold
2010-08-17 09:19:27 UTC
Permalink
Post by Rudolph Bott
oops, I did a make install and did not move the old /usr/local/nav
folder out of the way. I did that now, replaced the fresh etc-folder
the md5 module is deprecated; use hashlib instead
import md5
Starting: cricket logengine mactrace maintengine networkDiscovery
thresholdMon
Failed: alertengine eventengine getDeviceData ipdevpoll pping servicemon
smsd snmptrapd
Nothing in the var/log folder whatsoever :(
By "nothing", do you mean that the log files are empty, or that there are no
log files at all in /usr/local/nav/var/log/ ? Please make sure NAV processes
has the necessary write permissions in /usr/local/nav/var (as it says in the
install guide).
--
Morten Brekkevold
UNINETT
Loading...