Opened 19 years ago

Closed 19 years ago

Last modified 15 years ago

#571 closed defect (worksforme)

SQLite error with mod_python/Apche2 on Mac OS X 10.4.2

Reported by: anonymous Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

While trying to get tutorial2 to run using Apache2/mod_python with SQlite database, the following errors are logged and the adim page throws the appropriate stack trace:

[Tue Sep 27 23:20:57 2005] [notice] Apache/2.0.54 (Unix) mod_python/3.1.4 Python/2.4.1 configured -- resuming normal operations

[Tue Sep 27 23:21:07 2005] [notice] mod_python: (Re)importing module 'mptest'

[Tue Sep 27 23:21:18 2005] [notice] mod_python: (Re)importing module 'django.core.handlers.modpython'

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: Traceback (most recent call last):

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n result = object(req)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/handlers/modpython.py", line 164, in handler\n return ModPythonHandler()(req)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/handlers/modpython.py", line 145, in call\n response = middleware_method(request, response)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/middleware/common.py", line 64, in process_response\n response = flat_file(request, request.path)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/views/core/flatfiles.py", line 22, in flat_file\n f = get_object_or_404(flatfiles, urlexact=url, sitesidexact=SITE_ID)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/extensions.py", line 17, in get_object_or_404\n return mod.get_object(kwargs)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/utils/functional.py", line 3, in _curried\n return args[0](*(args[1:]+moreargs), dict(kwargs.items() + morekwargs.items()))

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/meta/init.py", line 1094, in function_get_object\n obj_list = function_get_list(opts, klass, kwargs)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/meta/init.py", line 1134, in function_get_list\n return list(function_get_iterator(opts, klass, kwargs))

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/meta/init.py", line 1115, in function_get_iterator\n cursor = db.db.cursor()

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django-1.0.0-py2.4.egg/django/core/db/backends/sqlite3.py", line 35, in cursor\n self.connection = Database.connect(DATABASE_NAME, detect_types=Database.PARSE_DECLTYPES)

[Tue Sep 27 23:21:19 2005] [error] [client ::1] PythonHandler django.core.handlers.modpython: OperationalError: unable to open database file

Please note that mod_python is operating correctly using mptest.py as recommended in the mod_python docuementation.

Django build #712 is being used.

Change History (3)

comment:1 by Jacob, 19 years ago

Resolution: worksforme
Status: newclosed

I can't reproduce this, so in all likelihood it's a problem with your specific setup -- two places to start might be to check that your sqlite is version 3 and that your web user has write access to the database file. Please ask support questions of this nature on the django-users mailing list, and leave the ticketing system for defects with Django itself.

comment:2 by mdt@…, 18 years ago

mention direcory access rights as in http://code.djangoproject.com/wiki/NewbieMistakes#DjangosaysUnabletoOpenDatabaseFilewhenusingSQLite3 here, solved the problem for me :D

comment:3 by wardi, 15 years ago

Another, certainly less common, cause of this error: /tmp is not world-writable

In this case you get a mod_python traceback instead of the pretty formatted django one. Also it works sometimes, but not for the admin login (at least).. perhaps anything with transactions.

The fix of course (not django-related): chmod a+rwt /tmp

Note: See TracTickets for help on using tickets.
Back to Top