GNOME Bugzilla – Bug 524776
"import gst" give a RuntimeError if ~/.gnome2 does not exists
Last modified: 2009-01-19 11:28:07 UTC
i'm trying to load gst python module inside apache. i get the following traceback: -- (mod_python:21171): libgnomevfs-WARNING **: Unable to create ~/.gnome2 directory: Permission denied [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] mod_python (pid=21076, interpreter='localhost', phase='PythonHandler', handler='gst_test'): Application error [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] ServerName: 'localhost' [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] DocumentRoot: '/var/www/' [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] URI: '/test-gst' [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] Location: '/test-gst' [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] Directory: None [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] Filename: '/var/www/test-gst' [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] PathInfo: '' [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] Traceback (most recent call last): [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] File "/usr/lib/python2.4/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n default=default_handler, arg=req, silent=hlist.silent) [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] File "/usr/lib/python2.4/site-packages/mod_python/importer.py", line 1202, in _process_target\n module = import_module(module_name, path=path) [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] File "/usr/lib/python2.4/site-packages/mod_python/importer.py", line 304, in import_module\n return __import__(module_name, {}, {}, ['*']) [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] File "/tmp/test-gst/gst_test.py", line 1, in ?\n import gst [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 144, in ?\n from _gst import * [Fri Mar 28 13:10:34 2008] [error] [client 127.0.1.1] RuntimeError: can't initialize module gst: Error re-scanning registry , child terminated by signal -- creating /var/www/.gnome2 does fix it i couldn't find a way to reproduce this outside of the server, but here is a simple set up to load in apache: apache conf -- <Location "/test-gst"> SetHandler python-program PythonPath "['/tmp/test-gst'] + sys.path" PythonHandler gst_test </Location> -- the file /tmp/test-gst/gst_test.py reads: -- import gst print "coucou" -- cheers, piem
The gnome-vfs plugin should probably check if ~/.gnome2 exists and create it if it doesn't.
Cannot reproduce here with a non-writable home directory. Can you try and get a backtrace from gdb of the crash?
I'm having my doubts whether this is really a gst-python specific issue, and not a (py)gobject issue.
I think GStreamer's gnome-vfs plugin does check if ~/.gnome2 exists (in plugin_init, indirectly via gnome_vfs_init or so) and fails to init the plugin if it doesn't, so all that should happen is that the gnomevfs plugin isn't available. I don't believe there's much potential within GStreamer for a crash here, but without a stack trace it's hard to say where the problem is exactly. Maybe you could add a sleep 60 before the import and attach gdb to the apache process in those 60 seconds via gdb -p <PID> ?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!