SchoolTool not starting with LDAP

Bug #1251181 reported by Tom Hoffman on 2013-11-14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SchoolTool LDAP
Gediminas Paulauskas

Bug Description

I am seeing this problem with SchoolTool. Without python-schooltool.ldap installed, SchoolTool starts correctly, but as soon as it is installed it refuses to start. The following was found in /var/log/schooltool/paste.log:

Reading configuration from /etc/schooltool/standard/schooltool.conf
Traceback (most recent call last):
  File "/usr/bin/start-schooltool-instance", line 9, in <module>
    load_entry_point('schooltool==', 'console_scripts', 'start-schooltool-instance')()
  File "/usr/lib/python2.7/dist-packages/schooltool/paste/", line 132, in main['serve', conf_file] + extra_options)
  File "/usr/lib/python2.7/dist-packages/paste/script/", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/python2.7/dist-packages/paste/script/", line 143, in invoke
    exit_code =
  File "/usr/lib/python2.7/dist-packages/paste/script/", line 238, in run
    result = self.command()
  File "/usr/lib/python2.7/dist-packages/paste/script/", line 284, in command
    relative_to=base, global_conf=vars)
  File "/usr/lib/python2.7/dist-packages/paste/script/", line 321, in loadapp
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 272, in loadobj
    return context.create()
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 710, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 144, in invoke
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 56, in fix_call
    val = callable(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/paste/", line 25, in urlmap_factory
    app = loader.get_app(app_name, global_conf=global_conf)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 350, in get_app
    name=name, global_conf=global_conf).create()
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 710, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/", line 56, in fix_call
    val = callable(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/schooltool/paste/", line 45, in schooltool_app_factory
    os.path.join(global_conf['here'], config_file))
  File "/usr/lib/python2.7/dist-packages/schooltool/paste/", line 34, in __init__
    db = self.setup(options)
  File "/usr/lib/python2.7/dist-packages/schooltool/app/", line 666, in setup
  File "/usr/lib/python2.7/dist-packages/schooltool/app/", line 501, in configure
  File "/usr/lib/python2.7/dist-packages/schooltool/app/", line 446, in configureComponents
    handler(options, context)
  File "/usr/lib/python2.7/dist-packages/schooltool/ldap/", line 288, in handle_configuration
  File "/usr/lib/python2.7/dist-packages/schooltool/ldap/", line 163, in parse
    self.after_parse(config_file, cache)
  File "/usr/lib/python2.7/dist-packages/schooltool/ldap/", line 169, in after_parse
  File "/usr/lib/python2.7/dist-packages/schooltool/ldap/", line 200, in set_fallback_query
KeyError: 'fallback_filter'

I am running Ubuntu 12.04 LTS with the SchoolTool PPA, as the official guide says.

Robin McCorkell (xenopathic) wrote :

(I am the poster in the related question who triggered this bug report)

I have discovered the source of the problem. The default /etc/ldap.conf that exists in Ubuntu is an example file, containing incorrect configuration settings. With this file in place SchoolTool would die with the error quoted above. However, removing the file allowed SchoolTool to start normally.

If an invalid /etc/ldap.conf does exist, surely the desired behaviour would be to ignore it and require manual setting by the administrator? A full crash with poor error reporting is not very intuitive.

Changed in schooltool:
assignee: nobody → Gediminas Paulauskas (menesis)
importance: Undecided → High
status: New → Triaged
Gediminas Paulauskas (menesis) wrote :

The error is in schooltool.ldap parsing code. The example file is ok. Might not work, but it was not the cause for error.

Changed in schooltool:
status: Triaged → Fix Released
affects: schooltool → schooltool.ldap
Changed in schooltool.ldap:
milestone: none → 1.0.1
importance: High → Critical
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers