[ckan-dev] WSGI error appeared on working instance

Stéphane Guidoin stephane at opennorth.ca
Fri Jul 11 18:43:45 UTC 2014


Dear all,

We are facing a strange situation on a production instance that stopped
working and now triggers python errors I am not able to traceback and which
seemed to be related to WSGI.

I don't have the full scenario of what happened because I was on vacations
when the first problem (it seems there was some HD corruption issue)
appeared but the current situation is:

- When starting CKAN with the paster server command, everything works well.

- I try to launch the same instance with apache/WSGI, I obtained the apache
error you can see below (surpringly, I obtain 2 different errors when I
send HTTP requests...)

- I installed a brand new and clear CKAN instance next to the existing
production with empty DB, separate Solr core (so removing any corruption
possibility in an existing DB), etc. Same result: works with paster, but
does not work when trying to attach the Apache WSGI.

I am using CKAN 2.2 on Ubuntu 12.04.

If anyone has any idea, I would take it...

Here are the error on the first HTTP request

Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1] mod_wsgi (pid=544):
Target WSGI script '/etc/ckan/prod/apache.wsgi' cannot be loaded as Python
module.
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1] mod_wsgi (pid=544):
Exception occurred processing WSGI script '/etc/ckan/prod/apache.wsgi'.
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/etc/ckan/prod/apache.wsgi", line 9, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     application =
loadapp('config:%s' % config_filepath)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 247, in loadapp
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     return
loadobj(APP, uri, name=name, **kw)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 271, in loadobj
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 296, in loadcontext
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 320, in _loadconfig
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     return
loader.get_context(object_type, name, global_conf)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 454, in get_context
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     section)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 476, in _context_from_use
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     object_type,
name=use, global_conf=global_conf)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 406, in get_context
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 296, in loadcontext
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 328, in _loadegg
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     return
loader.get_context(object_type, name, global_conf)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 620, in get_context
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     object_type,
name=name)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 646, in find_egg_entry_point
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]
possible.append((entry.load(), protocol, entry.name))
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
line 1989, in load
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     entry =
__import__(self.module_name, globals(),globals(), ['__name__'])
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/src/ckan/ckan/config/middleware.py", line 9, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     import sqlalchemy
as sa
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/sqlalchemy/__init__.py",
line 12, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     from
sqlalchemy.sql import (
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/sqlalchemy/sql/__init__.py",
line 7, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     from
sqlalchemy.sql.expression import (
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/sqlalchemy/sql/expression.py",
line 32, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     from sqlalchemy
import util, exc
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/sqlalchemy/util/__init__.py",
line 7, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     from compat
import callable, cmp, reduce, defaultdict, py25_dict, \\
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/sqlalchemy/util/compat.py",
line 236, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     import decimal
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/decimal.py", line 5912, in <module>
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     """, re.VERBOSE |
re.IGNORECASE | re.UNICODE).match
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/re.py", line 190, in compile
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     return
_compile(pattern, flags)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/re.py", line 240, in _compile
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     p =
sre_compile.compile(pattern, flags)
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]   File
"/usr/lib/python2.7/sre_compile.py", line 523, in compile
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1]     groupindex,
indexgroup
[Fri Jul 11 11:22:53 2014] [error] [client 127.0.0.1] OverflowError:
regular expression code size limit exceeded


Here is the error on the second HTTP request

[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1] mod_wsgi (pid=544):
Exception occurred processing WSGI script '/etc/ckan/prod/apache.wsgi'.
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/etc/ckan/prod/apache.wsgi", line 9, in <module>
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     application =
loadapp('config:%s' % config_filepath)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 247, in loadapp
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     return
loadobj(APP, uri, name=name, **kw)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 271, in loadobj
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 296, in loadcontext
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 320, in _loadconfig
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     return
loader.get_context(object_type, name, global_conf)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 454, in get_context
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     section)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 476, in _context_from_use
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     object_type,
name=use, global_conf=global_conf)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 406, in get_context
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 296, in loadcontext
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]
global_conf=global_conf)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 328, in _loadegg
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     return
loader.get_context(object_type, name, global_conf)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 620, in get_context
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     object_type,
name=name)
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/paste/deploy/loadwsgi.py",
line 646, in find_egg_entry_point
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]
possible.append((entry.load(), protocol, entry.name))
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py",
line 1989, in load
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     entry =
__import__(self.module_name, globals(),globals(), ['__name__'])
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/src/ckan/ckan/config/middleware.py", line 9, in <module>
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     import sqlalchemy
as sa
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]   File
"/usr/lib/ckan/prod/lib/python2.7/site-packages/sqlalchemy/__init__.py",
line 10, in <module>
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1]     import
sqlalchemy.exc as exceptions
[Fri Jul 11 11:23:40 2014] [error] [client 127.0.0.1] AttributeError:
'module' object has no attribute 'exc'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140711/7bb46f6b/attachment-0002.html>


More information about the ckan-dev mailing list