<div dir="ltr">Hello everyone.<br><br>I had been problem to use the mediaproxy 2.0.3 over opensuse 11.0. I had got error both media-relay and media-dispatcher. <br><br><b>The media-dispatcher error had been following: </b><br>
<br><span style="font-family: courier new,monospace;"># ./media-dispatcher --no-fork</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Starting MediaProxy Dispatcher 2.0.3</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Twisted is using epollreactor</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">failed to create MediaProxy Dispatcher: ASN1 parser: Element was not found.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">--- <exception caught here> ---</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "./media-dispatcher", line 52, in <module></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> dispatcher = Dispatcher()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "/usr/local/src/mediaproxy-2.0.3/mediaproxy/dispatcher.py", line 413, in __init__</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> self.cred = X509Credentials(cert_name='dispatcher')</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "/usr/local/src/mediaproxy-2.0.3/mediaproxy/tls.py", line 132, in __init__</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> twisted.X509Credentials.__init__(self, self.X509cert, self.X509key, [self.X509ca], [self.X509crl])</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "/usr/local/src/mediaproxy-2.0.3/mediaproxy/tls.py", line 99, in __get__</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return descriptor.get()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "/usr/local/src/mediaproxy-2.0.3/mediaproxy/tls.py", line 82, in get</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> self.object = self.klass(f.read())</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "<string>", line 1, in __init__</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "/usr/lib/python2.5/site-packages/gnutls/validators.py", line 273, in check_args</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return func(*func_args)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "/usr/lib/python2.5/site-packages/gnutls/crypto.py", line 70, in __init__</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> gnutls_x509_crt_init(byref(self._c_object))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> File "/usr/lib/python2.5/site-packages/gnutls/library/errors.py", line 61, in _check_status</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> raise GNUTLSError(ErrorMessage(retcode))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">gnutls.errors.GNUTLSError: ASN1 parser: Element was not found.</span><br><br><br>After spend some time tracing the execution and making gnutls samples I perceived that the media-dispatcher does not call the function gnutls_global_init. Thus, the gnutls_x509_crt_init can't find the "PKIX1.Certificate" because the _gnutls_get_pkix () returns nil. In order to solve this problem I added the follows lines on mediaproxy/dispatcher.py:<br>
<br><span style="font-family: courier new,monospace;">23,24c24</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">> from gnutls.library.functions import gnutls_global_init</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">412d411</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">> gnutls_global_init()</span><br><br><br><b>The media-relay error had been following:</b><br>
<br><span style="font-family: courier new,monospace;"># ./media-relay --no-fork</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Starting MediaProxy Relay 2.0.3</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Set resource limit for maximum open file descriptors to 11000</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">failed to create MediaProxy Relay: Could not determine Linux kernel version</span><br>
<br>This problem was easier to solve, and it is happen because the format of the file /proc/sys/kernel/osrelease may be different across the linux distributions. eg. 2.6.25.XX and not 2.6.25-XX<br>To solve it, I apply the following patch on mediaproxy/relay.py<br>
<br clear="all"><span style="font-family: courier new,monospace;">286c286,289</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">< major, minor, revision = [int(num) for num in open(KERNEL_VERSION_FILE).read().split("-", 1)[0].split(".")]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">---</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">> kernel_version = open(KERNEL_VERSION_FILE).read().split("-", 1)[0].split(".")</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">> major = kernel_version[0]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">> minor = kernel_version[1]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">> revision = kernel_version[2]</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><br><br>-- <br>==============================================<br>
Ivan Medeiros Monteiro - <a href="mailto:fehler@gmail.com">fehler@gmail.com</a><br> Bacharel em Ciência da Computação - UFBA<br> Mestrando em Ciência da Computação - UFRGS<br>==============================================<br>
Indecisão é quando você sabe muito bem o que quer,<br>mas acha que devia querer outra coisa.<br>--------------------------------------------------------------------------------------------<br>
</div>