Server problem

Asked by raphonic

Hi, I've installed schooltool on 12.10 successfully from the stable ppa, but I can't get the application to start. When I start the service, it says it started properly, but i'm unable to access the site as localhost:7080. I got the following error in the log file

Traceback (most recent call last):
  File "/usr/bin/paster", line 4, in <module>
    command.run()
  File "/usr/local/lib/python2.7/dist-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/local/lib/python2.7/dist-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/local/lib/python2.7/dist-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/local/lib/python2.7/dist-packages/paste/script/serve.py", line 284, in command
    relative_to=base, global_conf=vars)
  File "/usr/local/lib/python2.7/dist-packages/paste/script/serve.py", line 321, in loadapp
    **kw)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 271, in loadobj
    global_conf=global_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 454, in get_context
    section)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use
    object_type, name=use, global_conf=global_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 406, in get_context
    global_conf=global_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 620, in get_context
    object_type, name=name)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 640, in find_egg_entry_point
    pkg_resources.require(self.spec)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 728, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 626, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: zope.untrustedpython

Any ideas as to what the problem might be? I have the default python2.7.3, which came with the ubuntu install.

Question information

Language:
English Edit question
Status:
Solved
For:
SchoolTool Edit question
Assignee:
No assignee Edit question
Solved by:
Gediminas Paulauskas
Solved:
Last query:
Last reply:
Revision history for this message
Gediminas Paulauskas (menesis) said :
#1

Hi,

The error says, that zope.untrustedpython package cannot be found. But none of schooltool or its dependencies require it.

Most likely you have installed something else not from ubuntu or a launchpad ppa. There are only two packages, whose newer versions may need zope.untrustedpython. Please run this command in a terminal to see where do they come from:

$ apt-cache policy python-zope.security python-zope.pagetemplate
python-zope.security:
  Installed: 3.8.3-2ubuntu1
  Candidate: 3.8.3-2ubuntu1
  Version table:
 *** 3.8.3-2ubuntu1 0
        500 http://lt.archive.ubuntu.com/ubuntu/ raring/universe i386 Packages
        100 /var/lib/dpkg/status
python-zope.pagetemplate:
  Installed: 4.0.1-0ubuntu1
  Candidate: 4.0.1-0ubuntu1
  Version table:
 *** 4.0.1-0ubuntu1 0
        500 http://lt.archive.ubuntu.com/ubuntu/ raring/universe i386 Packages
        100 /var/lib/dpkg/status

The output should be similar to this, and there are no higher versions of those two packaged.

Maybe you have installed something manually, using easy_install? Check

$ ls -d /usr/local/lib/python2.7/dist-packages/zope.*egg-info

Revision history for this message
raphonic (raphonic) said :
#2

Thanks for the reply. I ran the command and got the following

python-zope.security:
  Installed: 3.8.3-2ubuntu1
  Candidate: 3.8.3-2ubuntu1
  Version table:
 *** 3.8.3-2ubuntu1 0
        500 http://in.archive.ubuntu.com/ubuntu/ quantal/universe i386 Packages
        100 /var/lib/dpkg/status
python-zope.pagetemplate:
  Installed: 3.6.3-0ubuntu1
  Candidate: 3.6.3-0ubuntu1
  Version table:
 *** 3.6.3-0ubuntu1 0
        500 http://in.archive.ubuntu.com/ubuntu/ quantal/universe i386 Packages
        100 /var/lib/dpkg/status

The python-zope-pagetemplate version seems to be lower(3.6.3 instead of 5.0.1), could that be the problem?

Also I had previously installed ZODB3 and Grok using pip, could that be the cause?

Revision history for this message
raphonic (raphonic) said :
#3

Btw, I ran the second command ls -d /usr/local/lib/python2.7/dist-packages/zope.*egg-info command and it showed a bunch of zope files. I deleted all of those files and reinstalled schootool, but now i'm getting the following error

Reading configuration from /etc/schooltool/standard/schooltool.conf
Traceback (most recent call last):
  File "/usr/bin/paster", line 4, in <module>
    command.run()
  File "/usr/local/lib/python2.7/dist-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/local/lib/python2.7/dist-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/local/lib/python2.7/dist-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/local/lib/python2.7/dist-packages/paste/script/serve.py", line 284, in command
    relative_to=base, global_conf=vars)
  File "/usr/local/lib/python2.7/dist-packages/paste/script/serve.py", line 321, in loadapp
    **kw)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/usr/local/lib/python2.7/dist-packages/paste/deploy/util.py", line 56, in fix_call
    val = callable(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/schooltool/paste/main.py", line 48, in schooltool_app_factory
    os.path.join(global_conf['here'], config_file))
  File "/usr/lib/python2.7/dist-packages/schooltool/paste/main.py", line 37, in __init__
    db = self.setup(options)
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 671, in setup
    self.configure(options)
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 484, in configure
    self.siteConfigFile, context=context)
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/xmlconfig.py", line 498, in file
    include(context, name, package)
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/xmlconfig.py", line 402, in include
    processxmlfile(f, context)
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/xmlconfig.py", line 295, in processxmlfile
    parser.parse(src)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/xmlconfig.py", line 281, in endElementNS
    None, sys.exc_info()[2])
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/xmlconfig.py", line 272, in endElementNS
    self.context.end()
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/config.py", line 345, in end
    self.stack.pop().finish()
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/config.py", line 452, in finish
    args = toargs(context, *self.argdata)
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/config.py", line 794, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/fields.py", line 72, in fromUnicode
    value = self.context.resolve(name)
  File "/usr/local/lib/python2.7/dist-packages/zope/configuration/config.py", line 151, in resolve
    mod = __import__(mname, *_import_chickens)
  File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/__init__.py", line 28, in <module>
    import containers
  File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/containers.py", line 31, in <module>
    from schooltool.skin.flourish.page import Page
  File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 336, in <module>
    class RefineLinksViewlet(Refine, ListNavigationViewlet):
  File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 338, in RefineLinksViewlet
    body_template = InheritTemplate(ListNavigationBase.template)
  File "/usr/lib/python2.7/dist-packages/schooltool/common/inlinept.py", line 146, in InheritTemplate
    return template.im_func
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/etc/schooltool/standard/site.zcml", line 9.2-9.57
    AttributeError: 'BoundPageTemplate' object has no attribute 'im_func'

Revision history for this message
Best Gediminas Paulauskas (menesis) said :
#4

Lower version is not a problem. It is a new dependency since zope.security 4.0.0a1

Installing ZODB3 or Grok in system path is the problem. If you did "pip install grok" or something it installed everything into /usr/local and now the system packages and local packages clash.

Delete zope* directories from /usr/local/lib/python2.7/dist-packages/ and you should be able to start.

Of course your grok and zodb will be broken. This means grok* ZODB ZEO ZConfig z3c.* zc.* or similar packages in the mentioned directory, also scripts in /usr/local/bin depending on them can be deleted.

Revision history for this message
raphonic (raphonic) said :
#5

Deleting all the Zope and Zodb packages and restarting the server worked. Thanks a lot for your help!

Revision history for this message
raphonic (raphonic) said :
#6

Thanks Gediminas Paulauskas, that solved my question.