FreshInstall: Exception TypeError: Object has default comparison

Bug #1290996 reported by Tyeth on 2014-03-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool
High
Unassigned

Bug Description

After a fresh install via APT, edited paste.ini to allow remote access. Restarted service, then tried to open interface.
On first open at <ourdomain>:7080/
and equally localhost:7080

Exception

TypeError: Object has default comparison

Traceback

File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 129, in publish
  obj = request.traverse(obj)
File "/usr/lib/python2.7/dist-packages/zope/publisher/browser.py", line 540, in traverse
  ob = super(BrowserRequest, self).traverse(obj)
File "/usr/lib/python2.7/dist-packages/zope/publisher/http.py", line 457, in traverse
  ob = super(HTTPRequest, self).traverse(obj)
File "/usr/lib/python2.7/dist-packages/zope/publisher/base.py", line 249, in traverse
  publication.callTraversalHooks(self, obj)
File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 137, in callTraversalHooks
  self._maybePlacefullyAuthenticate(request, ob)
File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 124, in _maybePlacefullyAuthenticate
  principal = auth.authenticate(request)
File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line 221, in authenticate
  return self.authPlugin.authenticate(request)
File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line 96, in authenticate
  if self._checkPlainTextPassword(login, creds.getPassword()):
File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line 101, in _checkPlainTextPassword
  if username in app['persons']:
File "/usr/lib/python2.7/dist-packages/zope/container/btree.py", line 80, in __contains__
  return key in self._SampleContainer__data

Tom Hoffman (tom-hoffman) wrote :

What version of Ubuntu? SchoolTool doesn't work on Trusty yet.

Tyeth (tyethgundry-b) wrote :

Ubuntu 12.10,
installed from cloud vpn provided by DigitalOcean,
as a presetup install for wordpress and dependencies.

Tyeth (tyethgundry-b) wrote :

I read the erroroneous code used to be acceptable practise and now is reported as an error.
Something about the Sort key used being None?

See:
https://mail.zope.org/pipermail/zope-dev/2012-December/044978.html

Tom Hoffman (tom-hoffman) wrote :

What version of SchoolTool?

Gediminas Paulauskas (menesis) wrote :

Looks to me that the database was not initialized correctly.

There was no data entered? Delete the database and try again.

$ sudo service schooltool stop
$ sudo rm -r /var/lib/schooltool/*
$ sudo service schooltool start

Tried suggested steps. No joy. Same Error.

Your School - server running SchoolTool 2.1.1<http://localhost:7080/about.html>

On 13 March 2014 14:43, Gediminas Paulauskas <email address hidden> wrote:

> Looks to me that the database was not initialized correctly.
>
> There was no data entered? Delete the database and try again.
>
> $ sudo service schooltool stop
> $ sudo rm -r /var/lib/schooltool/*
> $ sudo service schooltool start
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1290996
>
> Title:
> FreshInstall: Exception TypeError: Object has default comparison
>
> Status in SchoolTool:
> New
>
> Bug description:
> After a fresh install via APT, edited paste.ini to allow remote access.
> Restarted service, then tried to open interface.
> On first open at <ourdomain>:7080/
> and equally localhost:7080
>
>
> Exception
>
> TypeError: Object has default comparison
>
> Traceback
>
> File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line
> 129, in publish
> obj = request.traverse(obj)
> File "/usr/lib/python2.7/dist-packages/zope/publisher/browser.py", line
> 540, in traverse
> ob = super(BrowserRequest, self).traverse(obj)
> File "/usr/lib/python2.7/dist-packages/zope/publisher/http.py", line
> 457, in traverse
> ob = super(HTTPRequest, self).traverse(obj)
> File "/usr/lib/python2.7/dist-packages/zope/publisher/base.py", line
> 249, in traverse
> publication.callTraversalHooks(self, obj)
> File
> "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py",
> line 137, in callTraversalHooks
> self._maybePlacefullyAuthenticate(request, ob)
> File
> "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py",
> line 124, in _maybePlacefullyAuthenticate
> principal = auth.authenticate(request)
> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line
> 221, in authenticate
> return self.authPlugin.authenticate(request)
> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line
> 96, in authenticate
> if self._checkPlainTextPassword(login, creds.getPassword()):
> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line
> 101, in _checkPlainTextPassword
> if username in app['persons']:
> File "/usr/lib/python2.7/dist-packages/zope/container/btree.py", line
> 80, in __contains__
> return key in self._SampleContainer__data
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/schooltool/+bug/1290996/+subscriptions
>

Gediminas Paulauskas (menesis) wrote :

This means username is None, and that is very strange.

Moreover, the error happens in Basic authentication code path. Do you get a browser dialog asking for username and password when trying to access schooltool? Is this kind of authentication set up in apache?

Maybe direct access to the login page would avoid this code being invoked, try http://localhost:7080/login.html

tyeth (tyethgundry) wrote :

I have also manually tried to reset the admin user password as suggested if
locked out, but equally failed. Since then I have purged my copy of
schooltool and reinstalled but with no change in results.

Accessing the login page directly produced the same error.
 I have never been presented with the basic http auth request while using
schooltools.

Thanks all for your help...

On 13 March 2014 15:13, Tyeth <email address hidden> wrote:

> Tried suggested steps. No joy. Same Error.
>
> Your School - server running SchoolTool 2.1.1<http://localhost:7080/about.html>
>
>
> On 13 March 2014 14:43, Gediminas Paulauskas <email address hidden> wrote:
>
>> Looks to me that the database was not initialized correctly.
>>
>> There was no data entered? Delete the database and try again.
>>
>> $ sudo service schooltool stop
>> $ sudo rm -r /var/lib/schooltool/*
>> $ sudo service schooltool start
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1290996
>>
>> Title:
>> FreshInstall: Exception TypeError: Object has default comparison
>>
>> Status in SchoolTool:
>> New
>>
>> Bug description:
>> After a fresh install via APT, edited paste.ini to allow remote access.
>> Restarted service, then tried to open interface.
>> On first open at <ourdomain>:7080/
>> and equally localhost:7080
>>
>>
>> Exception
>>
>> TypeError: Object has default comparison
>>
>> Traceback
>>
>> File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line
>> 129, in publish
>> obj = request.traverse(obj)
>> File "/usr/lib/python2.7/dist-packages/zope/publisher/browser.py", line
>> 540, in traverse
>> ob = super(BrowserRequest, self).traverse(obj)
>> File "/usr/lib/python2.7/dist-packages/zope/publisher/http.py", line
>> 457, in traverse
>> ob = super(HTTPRequest, self).traverse(obj)
>> File "/usr/lib/python2.7/dist-packages/zope/publisher/base.py", line
>> 249, in traverse
>> publication.callTraversalHooks(self, obj)
>> File
>> "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py",
>> line 137, in callTraversalHooks
>> self._maybePlacefullyAuthenticate(request, ob)
>> File
>> "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py",
>> line 124, in _maybePlacefullyAuthenticate
>> principal = auth.authenticate(request)
>> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py",
>> line 221, in authenticate
>> return self.authPlugin.authenticate(request)
>> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py",
>> line 96, in authenticate
>> if self._checkPlainTextPassword(login, creds.getPassword()):
>> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py",
>> line 101, in _checkPlainTextPassword
>> if username in app['persons']:
>> File "/usr/lib/python2.7/dist-packages/zope/container/btree.py", line
>> 80, in __contains__
>> return key in self._SampleContainer__data
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/schooltool/+bug/1290996/+subscriptions
>>
>
>

tyeth (tyethgundry) wrote :

Deleted database according to recommended instructions before, but no change.
  Could it be a zope system config setting, as I'm running another zope python application on the server. It's a pyramid (pylons) based application.
-just a thought

On 13 Mar 2014, at 23:14, Tom Hoffman <email address hidden> wrote:

> Did you try deleting the database?
>
> http://book.schooltool.org/database.html?highlight=database#how-can-i
> -erase-the-entire-database
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1290996
>
> Title:
> FreshInstall: Exception TypeError: Object has default comparison
>
> Status in SchoolTool:
> New
>
> Bug description:
> After a fresh install via APT, edited paste.ini to allow remote access. Restarted service, then tried to open interface.
> On first open at <ourdomain>:7080/
> and equally localhost:7080
>
>
> Exception
>
> TypeError: Object has default comparison
>
> Traceback
>
> File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 129, in publish
> obj = request.traverse(obj)
> File "/usr/lib/python2.7/dist-packages/zope/publisher/browser.py", line 540, in traverse
> ob = super(BrowserRequest, self).traverse(obj)
> File "/usr/lib/python2.7/dist-packages/zope/publisher/http.py", line 457, in traverse
> ob = super(HTTPRequest, self).traverse(obj)
> File "/usr/lib/python2.7/dist-packages/zope/publisher/base.py", line 249, in traverse
> publication.callTraversalHooks(self, obj)
> File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 137, in callTraversalHooks
> self._maybePlacefullyAuthenticate(request, ob)
> File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 124, in _maybePlacefullyAuthenticate
> principal = auth.authenticate(request)
> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line 221, in authenticate
> return self.authPlugin.authenticate(request)
> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line 96, in authenticate
> if self._checkPlainTextPassword(login, creds.getPassword()):
> File "/usr/lib/python2.7/dist-packages/schooltool/app/security.py", line 101, in _checkPlainTextPassword
> if username in app['persons']:
> File "/usr/lib/python2.7/dist-packages/zope/container/btree.py", line 80, in __contains__
> return key in self._SampleContainer__data
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/schooltool/+bug/1290996/+subscriptions

Changed in schooltool:
importance: Undecided → High
Joe Steeve (joe.steeve) wrote :

Looks like you hit https://github.com/zopefoundation/ZODB3/issues/1

Pinning ZODB3 to 3.10.5 in buildout.cfg sorted this issue for us (in a different project).

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

Other bug subscribers