After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 524776 - "import gst" give a RuntimeError if ~/.gnome2 does not exists
"import gst" give a RuntimeError if ~/.gnome2 does not exists
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-python
0.10.18
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-28 12:11 UTC by Paul Brossier
Modified: 2009-01-19 11:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20



Description Paul Brossier 2008-03-28 12:11:08 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
Comment 1 Johan (not receiving bugmail) Dahlin 2008-03-28 12:18:27 UTC
The gnome-vfs plugin should probably check if ~/.gnome2 exists and create it if it doesn't.
Comment 2 Michael Smith 2008-03-28 12:22:57 UTC
Cannot reproduce here with a non-writable home directory.

Can you try and get a backtrace from gdb of the crash?
Comment 3 Edward Hervey 2008-05-02 08:57:28 UTC
I'm having my doubts whether this is really a gst-python specific issue, and not a (py)gobject issue.
Comment 4 Tim-Philipp Müller 2008-05-02 09:11:37 UTC
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> ?
Comment 5 Christoph Wurm 2009-01-19 11:28:07 UTC
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!