views:

148

answers:

1

I'm trying to set up a Django application using WSGI. That works fine. However, I am having some issues with part of my Django app that uses BDB XML. My Apache config is as follows:

Listen 8000
WSGISocketPrefix /tmp/wsgi
<VirtualHost *:8000>
    ServerName <server name>
    DocumentRoot <path to doc root>

    LogLevel info

    WSGIScriptAlias / <path to wsgi>
    WSGIApplicationGroup %{GLOBAL}
    WSGIDaemonProcess debug threads=1
    WSGIProcessGroup debug
</VirtualHost>

However, I'm still getting the following error:

DB_ENV->repmgr_stat interface requires an environment configured for the replication subsystem
[error] child died with signal 11

My environment is opened as:

environment = DBEnv()

environment.open(
    <absolute db env path>,
    DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL,
    0
)

I am using:

  • python 2.6.2
  • apache 2.2
  • ubuntu 9.04
  • dbxml 2.5.13 compiled from source (so libdb-4.8, bsddb3, all that jazz)

I see Apache seems to link to libdb-4.6. Is this a problem?

ldd /usr/sbin/apache2 | grep libdb
libdb-4.6.so => /usr/lib/libdb-4.6.so (0xb7c01000)

Updated

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5a48b90 (LWP 12700)]
0x00000000 in ?? ()
(gdb) thread apply all bt

Thread 4 (Thread 0xb6a67b90 (LWP 12698)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0
#3  0xb6d7afee in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#5  0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread 0xb6249b90 (LWP 12699)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0
#3  0xb6d7ab39 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#5  0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb5a48b90 (LWP 12700)):
#0  0x00000000 in ?? ()
#1  0xb4f03b5e in DbXml::XmlManager::XmlManager () from /home/jason/dbxml-2.5.13/install/lib/libdbxml-2.5.so
#2  0xb501b29b in _wrap_new_XmlManager (self=0x0, args=0xac66fcc) at dbxml_python_wrap.cpp:5183
#3  0xb6b77aed in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#4  0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#5  0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#6  0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#7  0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#8  0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#9  0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#10 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#11 0xb6b9ae03 in ?? () from /usr/lib/libpython2.6.so.1.0
#12 0xb6b90f55 in ?? () from /usr/lib/libpython2.6.so.1.0
#13 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#14 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#15 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#16 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#17 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#18 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#19 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#20 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#21 0xb6b44a7d in PyInstance_New () from /usr/lib/libpython2.6.so.1.0
#22 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#23 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#24 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#25 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0
#26 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#27 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#28 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#29 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0
#30 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#31 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#32 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#33 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0
#34 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#35 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#36 0xb6bdab4f in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#37 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#38 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#39 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#40 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#41 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#42 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0
#43 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#44 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#45 0xb6d7172d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#46 0xb6d7539f in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#47 0xb6d7e1d8 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#48 0xb6d7a42c in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#49 0xb6d7a8bd in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#50 0xb6d7a9c5 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#51 0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#52 0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#53 0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb7460b00 (LWP 12697)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7e75300 in sigwait () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb7ea3f3b in apr_signal_thread () from /usr/lib/libapr-1.so.0
#3  0xb6d7b48d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb6d7bc98 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#5  0xb6d79632 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#6  0xb7e9a2c9 in apr_proc_other_child_alert () from /usr/lib/libapr-1.so.0
#7  0x08092202 in ap_mpm_run ()
#8  0x080673c8 in main ()
#0  0x00000000 in ?? ()
A: 

A first step would to set:

LogLevel info

and look at error logging to verify it is actually being run in main interpreter. For that the application group logged should be empty string in message where WSGI script is loaded.

Only other thing to do is to run in daemon mode and attach gdb and try and capture stack trace to assist in debugging. See:

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Debugging_Crashes_With_GDB

Graham Dumpleton
thanks for your response. I verified that the application group is empty string. I've added the backtrace from gdb if it helps.
Jason
Are you running in a single threaded or multi threaded configuration? Ie., are you running in embedded mode with preform or worker MPM, or daemon mode and if so what parameters to WSGIDaemonProcess.
Graham Dumpleton
i added the full apache config. does that help?
Jason