Thread: [cx-oracle-users] TemplateSyntaxError: Caught ImproperlyConfigured while rendering: Error loading c
Brought to you by:
atuining
From: juhui <ph...@gm...> - 2010-03-17 13:53:41
|
hi I am using a redhat-4 64 bit box. I have installed apache+python+mod_python+django+cx_Oracle。 I can run import cx_Oracle in python shell model. And my project depends on cx_Oracle runs well with manage.py runserver. when I try run Django project with apache+python_mod with oracle database. I got MOD_PYTHON ERROR . the error info is: TemplateSyntaxError: Caught ImproperlyConfigured while rendering: Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared object file: No such file or directory any Idea? -- LB can FlY |
From: Jani T. <re...@gm...> - 2010-03-17 14:07:10
|
On 03/17/2010 03:53 PM, juhui wrote: > hi > > I am using a redhat-4 64 bit box. I have installed > apache+python+mod_python+django+cx_Oracle。 > > I can run import cx_Oracle in python shell model. And my project > depends on cx_Oracle runs well with manage.py runserver. > > when I try run Django project with apache+python_mod with oracle > database. I got MOD_PYTHON ERROR . > > the error info is: > > TemplateSyntaxError: Caught ImproperlyConfigured while rendering: > Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared > object file: No such file or directory > Your apache doesn't get all necessary environment variables to find Oracle shared libraries, namely libclntsh.so.10.1 this time. You might need to add to your apache config LD_LIBRARY_PATH (or somewhere else where apache will pick it up) to point your oracle installation dir. Also you might need ORACLE_HOME to point in the correct place as well. -- Jani Tiainen |
thanks for you reply. I have added LD_LIBRARY_PATH & ORACLE_HOME to /etc/profile. and the values are: ro...@la...:[/root]echo $LD_LIBRARY_PATH /home/oracle/product/10.2.0/lib:/usr/lib ro...@la...:[/root]echo $ORACLE_HOME /home/oracle/product/10.2.0 ro...@la...:[/root]ls -l /home/oracle/product/10.2.0/lib/libclntsh.so.10.1 -rwxr-x--- 1 oracle dba 21188349 May 13 2009 /home/oracle/product/10.2.0/lib/libclntsh.so.10.1 is it Permission issue? --------------------------------- traceback info below: --------------------------------- Environment: Request Method: GET Request URL: http://172.16.96.251/djangoapps/ Django Version: 1.2 beta 1 SVN-12801 Python Version: 2.6.0 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'djangoapps.out_resume'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') Traceback: File "/usr/local/djtrunk/django/core/handlers/base.py" in get_response 80. response = middleware_method(request) File "/usr/local/djtrunk/django/contrib/sessions/middleware.py" in process_request 10. engine = import_module(settings.SESSION_ENGINE) File "/usr/local/djtrunk/django/utils/importlib.py" in import_module 35. __import__(name) File "/usr/local/djtrunk/django/contrib/sessions/backends/db.py" in <module> 3. from django.contrib.sessions.models import Session File "/usr/local/djtrunk/django/contrib/sessions/models.py" in <module> 4. from django.db import models File "/usr/local/djtrunk/django/db/__init__.py" in <module> 75. connection = connections[DEFAULT_DB_ALIAS] File "/usr/local/djtrunk/django/db/utils.py" in __getitem__ 91. backend = load_backend(db['ENGINE']) File "/usr/local/djtrunk/django/db/utils.py" in load_backend 32. return import_module('.base', backend_name) File "/usr/local/djtrunk/django/utils/importlib.py" in import_module 35. __import__(name) File "/usr/local/djtrunk/django/db/backends/oracle/base.py" in <module> 27. raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e) Exception Type: ImproperlyConfigured at /djangoapps/ Exception Value: Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared object file: Permission denied 在 2010年3月17日 下午10:06,Jani Tiainen <re...@gm...>写道: > On 03/17/2010 03:53 PM, juhui wrote: > > hi > > > > I am using a redhat-4 64 bit box. I have installed > > apache+python+mod_python+django+cx_Oracle。 > > > > I can run import cx_Oracle in python shell model. And my project > > depends on cx_Oracle runs well with manage.py runserver. > > > > when I try run Django project with apache+python_mod with oracle > > database. I got MOD_PYTHON ERROR . > > > > the error info is: > > > > TemplateSyntaxError: Caught ImproperlyConfigured while rendering: > > Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared > > object file: No such file or directory > > > > Your apache doesn't get all necessary environment variables to find > Oracle shared libraries, namely libclntsh.so.10.1 this time. You might > need to add to your apache config LD_LIBRARY_PATH (or somewhere else > where apache will pick it up) to point your oracle installation dir. > > Also you might need ORACLE_HOME to point in the correct place as well. > > -- > > Jani Tiainen > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > -- LB can FlY |
From: Jani T. <re...@gm...> - 2010-03-17 14:27:15
|
On 03/17/2010 04:21 PM, juhui wrote: > thanks for you reply. > I have added > LD_LIBRARY_PATH & ORACLE_HOME to /etc/profile. > and the values are: > > ro...@la...:[/root]echo $LD_LIBRARY_PATH > /home/oracle/product/10.2.0/lib:/usr/lib > ro...@la...:[/root]echo $ORACLE_HOME > /home/oracle/product/10.2.0 > ro...@la...:[/root]ls -l > /home/oracle/product/10.2.0/lib/libclntsh.so.10.1 > -rwxr-x--- 1 oracle dba 21188349 May 13 2009 > /home/oracle/product/10.2.0/lib/libclntsh.so.10.1 > > is it Permission issue? > Exception Value: Error loading cx_Oracle module: libclntsh.so.10.1: > cannot open shared object file: Permission denied ^^^ As exception states... Most probably Apache runs under other user than oracle and that user is not part of dba group. So either expand permissions or add apache user to dba group. > > > 在 2010年3月17日 下午10:06,Jani Tiainen <re...@gm... > <mailto:re...@gm...>>写道: > > On 03/17/2010 03:53 PM, juhui wrote: > > hi > > > > I am using a redhat-4 64 bit box. I have installed > > apache+python+mod_python+django+cx_Oracle。 > > > > I can run import cx_Oracle in python shell model. And my project > > depends on cx_Oracle runs well with manage.py runserver. > > > > when I try run Django project with apache+python_mod with oracle > > database. I got MOD_PYTHON ERROR . > > > > the error info is: > > > > TemplateSyntaxError: Caught ImproperlyConfigured while rendering: > > Error loading cx_Oracle module: libclntsh.so.10.1: cannot open > shared > > object file: No such file or directory > > > > Your apache doesn't get all necessary environment variables to find > Oracle shared libraries, namely libclntsh.so.10.1 this time. You might > need to add to your apache config LD_LIBRARY_PATH (or somewhere else > where apache will pick it up) to point your oracle installation dir. > > Also you might need ORACLE_HOME to point in the correct place as well. > > -- > > Jani Tiainen > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > <mailto:cx-...@li...> > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > > -- > LB can FlY > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Graham H. <g.h...@gm...> - 2010-03-17 14:25:02
|
On a RHEL/CentOS system, add the path to the $ORACLE_HOME/lib directory to /etc/ld.so.conf and run ldconfig as root. That'll ensure the libraries are picked up correctly by 90% of the software that needs them. For apache to work properly (and thus php etc) set the appropriate environment variables (ORACLE_HOME, TNS_ADMIN, NLS_LANG etc) in /etc/sysconfig/httpd Hope that helps, Graham 2010/3/17 Jani Tiainen <re...@gm...> > On 03/17/2010 03:53 PM, juhui wrote: > > hi > > > > I am using a redhat-4 64 bit box. I have installed > > apache+python+mod_python+django+cx_Oracle。 > > > > I can run import cx_Oracle in python shell model. And my project > > depends on cx_Oracle runs well with manage.py runserver. > > > > when I try run Django project with apache+python_mod with oracle > > database. I got MOD_PYTHON ERROR . > > > > the error info is: > > > > TemplateSyntaxError: Caught ImproperlyConfigured while rendering: > > Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared > > object file: No such file or directory > > > > Your apache doesn't get all necessary environment variables to find > Oracle shared libraries, namely libclntsh.so.10.1 this time. You might > need to add to your apache config LD_LIBRARY_PATH (or somewhere else > where apache will pick it up) to point your oracle installation dir. > > Also you might need ORACLE_HOME to point in the correct place as well. > > -- > > Jani Tiainen > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
I have added $ORACLE_HOME/lib to ld.so.conf when I install cx_oracle. and cx_Oracle runs well under python shell module . follow you advice I added these two lines to /etc/sysconfig/httpd LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/oracle/product/10.2.0/lib:/usr/lib ORACLE_HOME=/home/oracle/product/10.2.0 then restart apache. the error still happen. :( 在 2010年3月17日 下午10:24,Graham Hagger <g.h...@gm...>写道: > On a RHEL/CentOS system, add the path to the $ORACLE_HOME/lib directory to > /etc/ld.so.conf and run ldconfig as root. That'll ensure the libraries are > picked up correctly by 90% of the software that needs them. > > For apache to work properly (and thus php etc) set the appropriate > environment variables (ORACLE_HOME, TNS_ADMIN, NLS_LANG etc) in > /etc/sysconfig/httpd > > Hope that helps, > > Graham > > 2010/3/17 Jani Tiainen <re...@gm...> > > On 03/17/2010 03:53 PM, juhui wrote: >> > hi >> > >> > I am using a redhat-4 64 bit box. I have installed >> > apache+python+mod_python+django+cx_Oracle。 >> > >> > I can run import cx_Oracle in python shell model. And my project >> > depends on cx_Oracle runs well with manage.py runserver. >> > >> > when I try run Django project with apache+python_mod with oracle >> > database. I got MOD_PYTHON ERROR . >> > >> > the error info is: >> > >> > TemplateSyntaxError: Caught ImproperlyConfigured while rendering: >> > Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared >> > object file: No such file or directory >> > >> >> Your apache doesn't get all necessary environment variables to find >> Oracle shared libraries, namely libclntsh.so.10.1 this time. You might >> need to add to your apache config LD_LIBRARY_PATH (or somewhere else >> where apache will pick it up) to point your oracle installation dir. >> >> Also you might need ORACLE_HOME to point in the correct place as well. >> >> -- >> >> Jani Tiainen >> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > -- LB can FlY |
From: Graham H. <g.h...@gm...> - 2010-03-17 14:44:37
|
>From the looks of things, Jani's suggestion - to add the apache user to the dba group, should fix this issue. gpasswd -a apache dba then restart apache. 2010/3/17 juhui <ph...@gm...> > I have added $ORACLE_HOME/lib to ld.so.conf when I install cx_oracle. and > cx_Oracle runs well under python shell module . > follow you advice I added these two lines to /etc/sysconfig/httpd > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/oracle/product/10.2.0/lib:/usr/lib > > ORACLE_HOME=/home/oracle/product/10.2.0 > then restart apache. > > the error still happen. > :( > > 在 2010年3月17日 下午10:24,Graham Hagger <g.h...@gm...>写道: > > On a RHEL/CentOS system, add the path to the $ORACLE_HOME/lib directory to >> /etc/ld.so.conf and run ldconfig as root. That'll ensure the libraries are >> picked up correctly by 90% of the software that needs them. >> >> For apache to work properly (and thus php etc) set the appropriate >> environment variables (ORACLE_HOME, TNS_ADMIN, NLS_LANG etc) in >> /etc/sysconfig/httpd >> >> Hope that helps, >> >> Graham >> >> 2010/3/17 Jani Tiainen <re...@gm...> >> >> On 03/17/2010 03:53 PM, juhui wrote: >>> > hi >>> > >>> > I am using a redhat-4 64 bit box. I have installed >>> > apache+python+mod_python+django+cx_Oracle。 >>> > >>> > I can run import cx_Oracle in python shell model. And my project >>> > depends on cx_Oracle runs well with manage.py runserver. >>> > >>> > when I try run Django project with apache+python_mod with oracle >>> > database. I got MOD_PYTHON ERROR . >>> > >>> > the error info is: >>> > >>> > TemplateSyntaxError: Caught ImproperlyConfigured while rendering: >>> > Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared >>> > object file: No such file or directory >>> > >>> >>> Your apache doesn't get all necessary environment variables to find >>> Oracle shared libraries, namely libclntsh.so.10.1 this time. You might >>> need to add to your apache config LD_LIBRARY_PATH (or somewhere else >>> where apache will pick it up) to point your oracle installation dir. >>> >>> Also you might need ORACLE_HOME to point in the correct place as well. >>> >>> -- >>> >>> Jani Tiainen >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > > > -- > LB can FlY > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
thanks you all. I added the apache user to dba group. it doesn't work. I find the stupid xx set the directory permission to drwx------ 。。 after change the related dirs permission。 *The error information changed!* Unable to acquire Oracle environment handle is this issue cause by mismach cx_Oracle version and oracle client version? 在 2010年3月17日 下午10:44,Graham Hagger <g.h...@gm...>写道: > >From the looks of things, Jani's suggestion - to add the apache user to > the dba group, should fix this issue. > > gpasswd -a apache dba > > then restart apache. > > 2010/3/17 juhui <ph...@gm...> > > I have added $ORACLE_HOME/lib to ld.so.conf when I install cx_oracle. and >> cx_Oracle runs well under python shell module . >> follow you advice I added these two lines to /etc/sysconfig/httpd >> LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/oracle/product/10.2.0/lib:/usr/lib >> >> ORACLE_HOME=/home/oracle/product/10.2.0 >> then restart apache. >> >> the error still happen. >> :( >> >> 在 2010年3月17日 下午10:24,Graham Hagger <g.h...@gm...>写道: >> >> On a RHEL/CentOS system, add the path to the $ORACLE_HOME/lib directory to >>> /etc/ld.so.conf and run ldconfig as root. That'll ensure the libraries are >>> picked up correctly by 90% of the software that needs them. >>> >>> For apache to work properly (and thus php etc) set the appropriate >>> environment variables (ORACLE_HOME, TNS_ADMIN, NLS_LANG etc) in >>> /etc/sysconfig/httpd >>> >>> Hope that helps, >>> >>> Graham >>> >>> 2010/3/17 Jani Tiainen <re...@gm...> >>> >>> On 03/17/2010 03:53 PM, juhui wrote: >>>> > hi >>>> > >>>> > I am using a redhat-4 64 bit box. I have installed >>>> > apache+python+mod_python+django+cx_Oracle。 >>>> > >>>> > I can run import cx_Oracle in python shell model. And my project >>>> > depends on cx_Oracle runs well with manage.py runserver. >>>> > >>>> > when I try run Django project with apache+python_mod with oracle >>>> > database. I got MOD_PYTHON ERROR . >>>> > >>>> > the error info is: >>>> > >>>> > TemplateSyntaxError: Caught ImproperlyConfigured while rendering: >>>> > Error loading cx_Oracle module: libclntsh.so.10.1: cannot open shared >>>> > object file: No such file or directory >>>> > >>>> >>>> Your apache doesn't get all necessary environment variables to find >>>> Oracle shared libraries, namely libclntsh.so.10.1 this time. You might >>>> need to add to your apache config LD_LIBRARY_PATH (or somewhere else >>>> where apache will pick it up) to point your oracle installation dir. >>>> >>>> Also you might need ORACLE_HOME to point in the correct place as well. >>>> >>>> -- >>>> >>>> Jani Tiainen >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Download Intel® Parallel Studio Eval >>>> Try the new software tools for yourself. Speed compiling, find bugs >>>> proactively, and fine-tune applications for parallel performance. >>>> See why Intel Parallel Studio got high marks during beta. >>>> http://p.sf.net/sfu/intel-sw-dev >>>> _______________________________________________ >>>> cx-oracle-users mailing list >>>> cx-...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >>> >> >> >> -- >> LB can FlY >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > -- LB can FlY |
From: Anthony T. <ant...@gm...> - 2010-03-17 21:04:33
|
2010/3/17 juhui <ph...@gm...>: > thanks you all. > I added the apache user to dba group. it doesn't work. > I find the stupid xx set the directory permission to drwx------ 。。 > after change the related dirs permission。 > The error information changed! > > Unable to acquire Oracle environment handle > > is this issue cause by mismach cx_Oracle version and oracle client version? Possibly. Or it could be that you haven't set your ORACLE_HOME properly. Check all your environment variables as well as your compatibility. Anthony |
the temporary solution is I added import os os.environ["ORACLE_HOME"] = "/home/oracle/product/10.2.0" to setting.py I will work on why the script can't get the environment var ORACLE_HOME Thanks you all 在 2010年3月18日 上午5:04,Anthony Tuininga <ant...@gm...>写道: > 2010/3/17 juhui <ph...@gm...>: > > thanks you all. > > I added the apache user to dba group. it doesn't work. > > I find the stupid xx set the directory permission to drwx------ 。。 > > after change the related dirs permission。 > > The error information changed! > > > > Unable to acquire Oracle environment handle > > > > is this issue cause by mismach cx_Oracle version and oracle client > version? > > Possibly. Or it could be that you haven't set your ORACLE_HOME > properly. Check all your environment variables as well as your > compatibility. > > Anthony > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > -- LB can FlY |