Patchwork Patchwork breaks on Fedora 17

login
register
mail settings
Submitter Ralf Baechle
Date Oct. 5, 2012, 7:33 a.m.
Message ID <20121005073348.GA20450@linux-mips.org>
Download mbox | patch
Permalink /patch/189423/
State Superseded
Headers show

Comments

Ralf Baechle - Oct. 5, 2012, 7:33 a.m.
An patchwork setup dies like this after upgrading the OS to Fedora 17:

mod_python (pid=18233, interpreter='patchwork.dead-in-the-water.org', phase='PythonHandler', handler='django.core.handlers.modpython'): Application error
ServerName: 'patchwork.dead-in-the-water.org'
DocumentRoot: '/var/www/patchwork.dead-in-the-water.org/patchwork/htdocs/'
URI: '/patch/3584/'
Location: '/'
Directory: None
Filename: '/var/www/patchwork.dead-in-the-water.org/patchwork/htdocs/patch'
PathInfo: '/3584/'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n    default=default_handler, arg=req, silent=hlist.silent)
  File "/usr/lib64/python2.7/site-packages/mod_python/importer.py", line 1229, in _process_target\n    result = _execute_target(config, req, object, arg)
  File "/usr/lib64/python2.7/site-packages/mod_python/importer.py", line 1128, in _execute_target\n    result = object(arg)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/modpython.py", line 180, in handler\n    return ModPythonHandler()(req)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/modpython.py", line 158, in __call__\n    response = self.get_response(request)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response\n    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception\n    return callback(request, **param_dict)
  File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view\n    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/defaults.py", line 32, in server_error\n    t = loader.get_template(template_name) # You need to create a 500.html template.
  File "/usr/lib/python2.7/site-packages/django/template/loader.py", line 145, in get_template\n    template, origin = find_template(template_name)
  File "/usr/lib/python2.7/site-packages/django/template/loader.py", line 128, in find_template\n    loader = find_template_loader(loader_name)
  File "/usr/lib/python2.7/site-packages/django/template/loader.py", line 101, in find_template_loader\n    raise ImproperlyConfigured('Error importing template source loader %s: "%s"' % (loader, e))
ImproperlyConfigured: Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"

I was able to figure out that the following seems to be needed:

But that leads to the following errors:

mod_python (pid=20390, interpreter='patchwork.dead-in-the-water.org', phase='PythonHandler', handler='django.core.handlers.modpython'): Application error
ServerName: 'patchwork.dead-in-the-water.org'
DocumentRoot: '/var/www/patchwork.dead-in-the-water.org/patchwork/htdocs/'
URI: '/patch/1016/'
Location: '/'
Directory: None
Filename: '/var/www/patchwork.dead-in-the-water.org/patchwork/htdocs/patch'
PathInfo: '/1016/'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n    default=default_handler, arg=req, silent=hlist.silent)
  File "/usr/lib64/python2.7/site-packages/mod_python/importer.py", line 1229, in _process_target\n    result = _execute_target(config, req, object, arg)
  File "/usr/lib64/python2.7/site-packages/mod_python/importer.py", line 1128, in _execute_target\n    result = object(arg)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/modpython.py", line 180, in handler\n    return ModPythonHandler()(req)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/modpython.py", line 158, in __call__\n    response = self.get_response(request)
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response\n    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception\n    return callback(request, **param_dict)
  File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view\n    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/views/defaults.py", line 32, in server_error\n    t = loader.get_template(template_name) # You need to create a 500.html template.
  File "/usr/lib/python2.7/site-packages/django/template/loader.py", line 145, in get_template\n    template, origin = find_template(template_name)
  File "/usr/lib/python2.7/site-packages/django/template/loader.py", line 138, in find_template\n    raise TemplateDoesNotExist(name)
TemplateDoesNotExist: 500.html

And of course adding a 500.html template only makes the error look "prettier" to the use but doesn't fix anything.

Do I have to dig up an older Django for Patchwork?  Any help you could give would be appreciated,

Thanks,

  Ralf
Jeremy Kerr - Oct. 8, 2012, 1:52 a.m.
Hi Ralf,

> An patchwork setup dies like this after upgrading the OS to Fedora 17:

Which version of django does Fedora 17 ship with?

I've just pushed a few changes to the patchwork git repo that should fix
things for django 1.4. I've been running with these for a while on
patchwork.ozlabs.org, and all seems to be fine.

I'd prefer for you not to have to use an older django; let me know
whether the updated code fixes your problem, and/or if you see any other
errors.

Cheers,


Jeremy
Ralf Baechle - Oct. 18, 2012, 10:45 a.m.
On Mon, Oct 08, 2012 at 09:52:22AM +0800, Jeremy Kerr wrote:

> > An patchwork setup dies like this after upgrading the OS to Fedora 17:
> 
> Which version of django does Fedora 17 ship with?
> 
> I've just pushed a few changes to the patchwork git repo that should fix
> things for django 1.4. I've been running with these for a while on
> patchwork.ozlabs.org, and all seems to be fine.
> 
> I'd prefer for you not to have to use an older django; let me know
> whether the updated code fixes your problem, and/or if you see any other
> errors.

I was using the very latest Fedora 17 + updates with the latest master
branch of the patchwork repository when I encountered these errors.

The issues went away when I switched to the django-1.4 branch.

Receiving an occasional error email from patchwork got me to revisit
the topic a few minutes ago.  Again the test setup was today's
Fedora 17 + updates with the latest master branch of the patchwork
repository and everything appears to be working okay for now.

Running it for a few minutes is hardly any kind of proper testing.  So
I'll drop you an email if something odd should happen.

So thanks for fixing things!

  Ralf
Jeremy Kerr - Oct. 22, 2012, 6:40 a.m.
Hi Ralf,

> Receiving an occasional error email from patchwork got me to revisit
> the topic a few minutes ago.

Could you forward me one of these emails?

I've recently fixed a bug where duplicate bundle creation with an
Internal Server Error (+ bug mail) instead of returning a nice message
to the user. If there's another source of error mails, it's probably
something I should fix.

> Running it for a few minutes is hardly any kind of proper testing.  So
> I'll drop you an email if something odd should happen.

It may be useful to run the included testsuite:

  cd apps
  ./manage.py test patchwork

This should give you fairly decent coverage.

Cheers,


Jeremy
Ralf Baechle - Oct. 22, 2012, 7:29 a.m.
On Mon, Oct 22, 2012 at 02:40:06PM +0800, Jeremy Kerr wrote:

> Hi Ralf,
> 
> > Receiving an occasional error email from patchwork got me to revisit
> > the topic a few minutes ago.
> 
> Could you forward me one of these emails?

Here's one:

Date: Fri, 05 Oct 2012 07:35:06 -0000
From: root@localhost
To: ralf@linux-mips.org
Subject: [Django] ERROR (EXTERNAL IP): Internal Server Error: /patch/1552/
Content-Type: text/plain; charset="utf-8"

Traceback (most recent call last):

  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/var/www/patchwork.linux-mips.org/patchwork/apps/patchwork/views/patch.py", line 29, in patch
    context = PatchworkRequestContext(request)

  File "/var/www/patchwork.linux-mips.org/patchwork/apps/patchwork/requestcontext.py", line 50, in __init__
    __init__(request, dict, processors);

  File "/usr/lib/python2.7/site-packages/django/template/context.py", line 175, in __init__
    for processor in get_standard_processors() + processors:

  File "/usr/lib/python2.7/site-packages/django/template/context.py", line 155, in get_standard_processors
    raise ImproperlyConfigured('Module "%s" does not define a "%s" callable request processor' % (module, attr))

ImproperlyConfigured: Module "django.core.context_processors" does not define a "auth" callable request processor


<ModPythonRequest
path:/patch/1552/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{'AUTH_TYPE': None,
 'CONTENT_LENGTH': 0,
 'CONTENT_TYPE': None,
 'CSRF_COOKIE': 'xuHqlQyxqbU4Y38NLeoqV8o3RHqJHWDe',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
 'HTTP_ACCEPT_LANGUAGE': 'ru, uk;q=0.8, be;q=0.8, en;q=0.7, *;q=0.01',
 'HTTP_CONNECTION': 'Keep-Alive',
 'HTTP_FROM': 'support@search.yandex.ru',
 'HTTP_HOST': 'patchwork.linux-mips.org',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
 'PATH_INFO': u'/patch/1552/',
 'PATH_TRANSLATED': None,
 'QUERY_STRING': None,
 'REMOTE_ADDR': '178.154.243.96',
 'REMOTE_HOST': None,
 'REMOTE_IDENT': None,
 'REMOTE_USER': None,
 'REQUEST_METHOD': 'GET',
 'SCRIPT_NAME': '',
 'SERVER_NAME': 'patchwork.linux-mips.org',
 'SERVER_PORT': 80,
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'mod_python'}>

This one was triggered when I was still running the django-1.4 branch.

> I've recently fixed a bug where duplicate bundle creation with an
> Internal Server Error (+ bug mail) instead of returning a nice message
> to the user. If there's another source of error mails, it's probably
> something I should fix.
> 
> > Running it for a few minutes is hardly any kind of proper testing.  So
> > I'll drop you an email if something odd should happen.
> 
> It may be useful to run the included testsuite:
> 
>   cd apps
>   ./manage.py test patchwork
> 
> This should give you fairly decent coverage.

Just tried that and got:

Got an error creating the test database: (1044, "Access denied for user 'www-data'@'localhost' to database 'test_patchwork'")

I'm going to look into that later - right now I need to hit the road.

  Ralf
Jeremy Kerr - Oct. 22, 2012, 9:10 a.m.
Hi Ralf,

> ImproperlyConfigured: Module "django.core.context_processors" does
> not define a "auth" callable request processor
[...]
> This one was triggered when I was still running the django-1.4
> branch.

Yep, that's fixed in the 1.4 changes.

> Just tried that and got:
>
> Got an error creating the test database: (1044, "Access denied for
> user 'www-data'@'localhost' to database 'test_patchwork'")

You'll need to sort out appropriate permissions for access to the test 
database, or alter the config for the test invocation. Either way, 
should be fairly simple to sort out.

Cheers,


Jeremy

Patch

diff --git a/apps/settings.py b/apps/settings.py
index 7523099..06fa64f 100644
--- a/apps/settings.py
+++ b/apps/settings.py
@@ -49,8 +49,8 @@  SECRET_KEY = '000000000000000000000000000000000000000000000000
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
+     'django.template.loaders.filesystem.Loader',
+     'django.template.loaders.app_directories.Loader',
 #     'django.template.loaders.eggs.load_template_source',
 )