I found the problem and fixed it and now is working fine... It was more product specific ... Oracle HTTP Server which i am using has a opmn.xml file in there there is an environment tag... You have to pass in there the path of the lib
like so: <variable id="LD_LIBRARY_PATH" value="/opt/webtier/ssl/lib:$LD_LIBRARY_PATH"/> restart and Voila! the module can import hashlib without errors!!! Thank Graham, I am on my way chasing the next issue my app has ... I cant connect to DB.. ;) On Thursday, February 19, 2015 at 11:24:45 PM UTC+2, Graham Dumpleton wrote: > > It is listed as a dependency of _hashlib. > > #ldd /opt/webtier/python_64/lib/python2.6/lib-dynload/_hashlib.so > libssl.so.1.0.0 => /opt/webtier/ssl/lib/libssl.so.1.0.0 > libcrypto.so.1.0.0 => /opt/webtier/ssl/lib/libcrypto.so.1.0.0 > > That it shows the path means that it should exist. > > Perhaps check access permissions on that file. Your code under Apache will > not run as you. > > Also try running: > > ldd /opt/webtier/ssl/lib/libssl.so.1.0.0 > > and see whether its dependencies are resolved. > > Try sudo'ing to the user that Apache ends up running your application as > and see if it works then. > > Also ensure you unset the LD_LIBRARY_PATH environment variable when doing > the test. > > Maybe finding the libraries is dependent on that being set and if not set > in Apache environment, will not find it. > > Graham > > On 19/02/2015, at 11:26 PM, [email protected] <javascript:> wrote: > > ok the error i got was: > > ImportError: ld.so.1: httpd.worker: fatal: libssl.so.1.0.0: open failed: > No such file or directory > > But it is strange because i can not see any reference to libssl > > #ldd httpd.worker > libaprutil-1.so.0 => > /opt/webtier/Middleware/Oracle_WT1/lib/libaprutil-1.so.0 > libexpat.so.0 => > /opt/webtier/Middleware/Oracle_WT1/ohs/lib/libexpat.so.0 > libcrypt_i.so.1 => /usr/lib/64/libcrypt_i.so.1 > libapr-1.so.0 => > /opt/webtier/Middleware/Oracle_WT1/lib/libapr-1.so.0 > libuuid.so.1 => /lib/64/libuuid.so.1 > libsendfile.so.1 => /lib/64/libsendfile.so.1 > librt.so.1 => /lib/64/librt.so.1 > libm.so.1 => /lib/64/libm.so.1 > libsocket.so.1 => /lib/64/libsocket.so.1 > libnsl.so.1 => /lib/64/libnsl.so.1 > libresolv.so.2 => /lib/64/libresolv.so.2 > libpthread.so.1 => /lib/64/libpthread.so.1 > libdl.so.1 => /lib/64/libdl.so.1 > libdms2.so => /opt/webtier/Middleware/Oracle_WT1/lib/libdms2.so > libiau.so => /opt/webtier/Middleware/Oracle_WT1/lib/libiau.so > libclntsh.so.11.1 => > /opt/webtier/Middleware/Oracle_WT1/lib/libclntsh.so.11.1 > libthread.so.1 => /lib/64/libthread.so.1 > libc.so.1 => /lib/64/libc.so.1 > libgen.so.1 => /lib/64/libgen.so.1 > libaio.so.1 => /lib/64/libaio.so.1 > libmd.so.1 => /lib/64/libmd.so.1 > libmp.so.2 => /lib/64/libmp.so.2 > libscf.so.1 => /lib/64/libscf.so.1 > libnnz11.so => /opt/webtier/Middleware/Oracle_WT1/lib/libnnz11.so > libkstat.so.1 => /lib/64/libkstat.so.1 > libsched.so.1 => /usr/lib/64/libsched.so.1 > libm.so.2 => /lib/64/libm.so.2 > libdoor.so.1 => /lib/64/libdoor.so.1 > libuutil.so.1 => /lib/64/libuutil.so.1 > /platform/SUNW,T5440/lib/sparcv9/libc_psr.so.1 > /platform/SUNW,T5440/lib/sparcv9/libmd_psr.so.1 > > > > On Thursday, February 19, 2015 at 2:13:44 PM UTC+2, Graham Dumpleton wrote: >> >> What might be the problems is that _hashlib.so is using libcrypto.so and >> httpd is using libcrypt_i.so. >> >> My understanding from searching about these libraries is that they >> probably provide the same functionality. >> >> Older versions of Solaris didn't have a similar crypto, but newer Solaris >> versions do. >> >> My guess is that your Python installation was built for an older Solaris >> version, or on the expectation that libcrypto_i.so didn't exist, or maybe >> it didn't check, used its own copy of the crypto library. >> >> The httpd though is using the proper Solaris version of the library. >> >> As I guess the APIs are likely similar, what is probably happening is >> that one is loaded by httpd first, but then when that from _hashlib.so >> is loaded there is a clash of symbols and it fails to load. This causes >> it to fallback to _md5.so which does exist. >> >> I therefore thing the only solution would be to get a version of Python >> which uses the proper Solaris library so that there is no clash with what >> httpd has already loaded into the process. >> >> You might get a better idea of the reason _hashlib.so is failing to load >> by writing a WSGI hello world script and get it working, and then modify it >> to do: >> >> import _hashlib >> >> in the body of the WSGI application so that it tries to load that as part >> of the request. Any error should then be logged in the Apache error log. >> >> Graham >> >> On 19/02/2015, at 10:45 PM, [email protected] wrote: >> >> Also >> >> #ldd /opt/webtier/python_64/lib/python2.6/lib-dynload/_hashlib.so >> libssl.so.1.0.0 => /opt/webtier/ssl/lib/libssl.so.1.0.0 >> libcrypto.so.1.0.0 => /opt/webtier/ssl/lib/libcrypto.so.1.0.0 >> libpython2.6.so.1.0 => >> /opt/webtier/python_64/lib/libpython2.6.so.1.0 >> libgcc_s.so.1 => /usr/sfw/lib/sparcv9/libgcc_s.so.1 >> libsocket.so.1 => /lib/64/libsocket.so.1 >> libnsl.so.1 => /lib/64/libnsl.so.1 >> libdl.so.1 => /lib/64/libdl.so.1 >> libc.so.1 => /lib/64/libc.so.1 >> librt.so.1 => /lib/64/librt.so.1 >> libm.so.2 => /lib/64/libm.so.2 >> libmp.so.2 => /lib/64/libmp.so.2 >> libmd.so.1 => /lib/64/libmd.so.1 >> libscf.so.1 => /lib/64/libscf.so.1 >> libaio.so.1 => /lib/64/libaio.so.1 >> libdoor.so.1 => /lib/64/libdoor.so.1 >> libuutil.so.1 => /lib/64/libuutil.so.1 >> libgen.so.1 => /lib/64/libgen.so.1 >> /platform/SUNW,T5440/lib/sparcv9/libc_psr.so.1 >> /platform/SUNW,T5440/lib/sparcv9/libmd_psr.so.1 >> >> ---------------------------------------------------------------------------------------------- >> #ldd httpd >> libaprutil-1.so.0 => >> /opt/webtier/Middleware/Oracle_WT1/lib/libaprutil-1.so.0 >> libexpat.so.0 => >> /opt/webtier/Middleware/Oracle_WT1/ohs/lib/libexpat.so.0 >> libcrypt_i.so.1 => /usr/lib/64/libcrypt_i.so.1 >> libapr-1.so.0 => >> /opt/webtier/Middleware/Oracle_WT1/lib/libapr-1.so.0 >> libuuid.so.1 => /lib/64/libuuid.so.1 >> libsendfile.so.1 => /lib/64/libsendfile.so.1 >> librt.so.1 => /lib/64/librt.so.1 >> libm.so.1 => /lib/64/libm.so.1 >> libsocket.so.1 => /lib/64/libsocket.so.1 >> libnsl.so.1 => /lib/64/libnsl.so.1 >> libresolv.so.2 => /lib/64/libresolv.so.2 >> libpthread.so.1 => /lib/64/libpthread.so.1 >> libdl.so.1 => /lib/64/libdl.so.1 >> libdms2.so => /opt/webtier/Middleware/Oracle_WT1/lib/libdms2.so >> libiau.so => /opt/webtier/Middleware/Oracle_WT1/lib/libiau.so >> libclntsh.so.11.1 => >> /opt/webtier/Middleware/Oracle_WT1/lib/libclntsh.so.11.1 >> libthread.so.1 => /lib/64/libthread.so.1 >> libc.so.1 => /lib/64/libc.so.1 >> libgen.so.1 => /lib/64/libgen.so.1 >> libaio.so.1 => /lib/64/libaio.so.1 >> libmd.so.1 => /lib/64/libmd.so.1 >> libmp.so.2 => /lib/64/libmp.so.2 >> libscf.so.1 => /lib/64/libscf.so.1 >> libnnz11.so => >> /opt/webtier/Middleware/Oracle_WT1/lib/libnnz11.so >> libkstat.so.1 => /lib/64/libkstat.so.1 >> libsched.so.1 => /usr/lib/64/libsched.so.1 >> libm.so.2 => /lib/64/libm.so.2 >> libdoor.so.1 => /lib/64/libdoor.so.1 >> libuutil.so.1 => /lib/64/libuutil.so.1 >> /platform/SUNW,T5440/lib/sparcv9/libc_psr.so.1 >> /platform/SUNW,T5440/lib/sparcv9/libmd_psr.so.1 >> >> >> On Wednesday, February 18, 2015 at 2:31:48 PM UTC+2, alexandros...@ >> gmail.com wrote: >>> >>> I recent migrated to a new apache server and when i am trying to run my >>> wsgi project i am getting the below error. >>> >>> I manage to track down the problem, but i can not find how to fix it... >>> >>> The problem is in the >>> /opt/webtier/python_64/lib/python2.6/site-packages/django/utils/hashcompat.py, >>> >>> it tries to import hashlib and it fails. Since there is a try catch block >>> in the hashcompat.py it then tries to import md5 which is deprecated .... >>> >>> >>> >>> [Wed Feb 18 13:12:21 2015] [error] <mod_wsgi.Log object at 0x1007f6870> >>> [Wed Feb 18 13:12:22 2015] [error] | wgtproxy | __init__ | >>> [Wed Feb 18 13:12:22 2015] [error] | wgtproxy settings | >>> [Wed Feb 18 13:12:22 2015] [error] >>> /opt/webtier/python_64/lib/python2.6/site-packages/django/utils/hashcompat.py:15: >>> >>> DeprecationWarning: the md5 module is deprecated; use hashlib instead >>> [Wed Feb 18 13:12:22 2015] [error] import md5 >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.xx.xx.xx] mod_wsgi >>> (pid=15944): Exception occurred processing WSGI script >>> '/opt/wgt_proxy/wgtproxyProj/wgtproxy/apache/django.wsgi'. >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.xx.xx.xx] Traceback (most >>> recent call last): >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.xx.xx.xx] File >>> "/opt/webtier/python_64/lib/python2.6/site-packages/django/core/handlers/wsgi.py", >>> >>> line 230, in __call__ >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.xx.xx.xx] >>> self.load_middleware() >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.xx.xx.xx] File >>> "/opt/webtier/python_64/lib/python2.6/site-packages/django/core/handlers/base.py", >>> >>> line 42, in load_middleware >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.xx.xx.xx] raise >>> exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % >>> (mw_module, e)) >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.xx.xx.xx] >>> ImproperlyConfigured: Error importing middleware django.middleware.common: >>> "No module named _md5" >>> [Wed Feb 18 13:12:22 2015] [error] [client xx.x.x.xx] Request Failed for >>> : /wgtproxy, Resp Code : [500] >>> >>> >>> >>> I did a test wsgi script that the only thing is to print "Hello word" >>> but at the beginning i am also importing hashlib in order to verify that >>> the hashlib is the problem : >>> >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] mod_wsgi >>> (pid=15943): Exception occurred processing WSGI script >>> '/opt/wgt_proxy/wgtproxyProj/wgtproxy/apache/test.wsgi'. >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] Traceback (most >>> recent call last): >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] File >>> "/opt/wgt_proxy/wgtproxyProj/wgtproxy/apache/test.wsgi", line 6, in <module> >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] import >>> hashlib >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] File >>> "/opt/webtier/python_64/lib/python2.6/hashlib.py", line 136, in <module> >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] md5 = >>> __get_builtin_constructor('md5') >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] File >>> "/opt/webtier/python_64/lib/python2.6/hashlib.py", line 63, in >>> __get_builtin_constructor >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] import _md5 >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] ImportError: No >>> module named _md5 >>> [Wed Feb 18 14:16:32 2015] [error] [client xx.xx.xx.xx] Request Failed >>> for : /test, Resp Code : [500] >>> >>> >>> Αccording to >>> https://code.google.com/p/modwsgi/wiki/ApplicationIssues#SSL_Shared_Library_Conflicts >>> >>> it seems that when it tries to import hashlin it can not, the exception is >>> masked and tries to import _md5 which of course it does not exist ... >>> >>> The strange thing is that i can import hashlib without errors or >>> exceptions from python ... the issue is when apache+mod_wsgi tries to do it >>> it fails! >>> >>> I did also did the " ldd /bin/httpd " command but my apache is not >>> referencing any libssl.so library!!! >>> >>> Has anybody come across this issue ??? Can someone help??? >>> >>> >>> >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/modwsgi. >> For more options, visit https://groups.google.com/d/optout. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To post to this group, send email to [email protected] <javascript:> > . > Visit this group at http://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
