Mailing List Archive

ZcxOracleDA configuration assistance
Greetings. I'm trying to set up cx_Oracle and ZcxOracleDA on a Plone/Zope server to allow access from our Plone site to our Oracle database. I'm working with one of our developers who was able to successfully get this working on the test environment on his Windows workstation, but getting it set up on our Linux (SLES10, 64-bit) server is proving a little more interesting. Here's what we've done so far:

1. Installed Oracle Instant Client 10.2.0.4 (which matches our server) Basic and SDK packages as noted in cx_Oracle documentation. Copied over a tnsnames.ora file from another server.

2. Installed cx_Oracle 5.0.2 (built from source using Plone's Python). We successfully ran a simple Python script at this point to verify connectivity with the Oracle database.

3. Untarred ZcxOracleDA 0.6 into the Zope server's products directory and restarted the Zope cluster. (Note: There are a few other things I'm leaving out at this point unless they become relevant... we had a couple of other issues that we managed to work through ourselves.)

At this point, we check the Zope client log:

------
2009-08-13T14:17:30 ERROR Application Couldn't install ZcxOracleDA
Traceback (most recent call last):
File "/opt/Plone-3.1/zeocluster/parts/zope2/lib/python/OFS/Application.py", line 758, in install_product
global_dict, global_dict, silly)
File "/opt/Plone-3.1/zeocluster/products/ZcxOracleDA/__init__.py", line 20, in ?
import DA
File "/opt/Plone-3.1/zeocluster/products/ZcxOracleDA/DA.py", line 15, in ?
from db import DB
File "/opt/Plone-3.1/zeocluster/products/ZcxOracleDA/db.py", line 14, in ?
import cx_Oracle, datetime
File "build/bdist.linux-x86_64/egg/cx_Oracle.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/cx_Oracle.py", line 6, in __bootstrap__
ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory
------

$ORACLE_HOME and $LD_LIBRARY_PATH are being exported from ~/.profile as recommended in the cx_Oracle build document. They are:

------
kmiweb01:~ # echo $ORACLE_HOME
/usr/lib/oracle/10.2.0.4/client64/lib
kmiweb01:~ # echo $LD_LIBRARY_PATH
:/usr/lib/oracle/10.2.0.4/client64/lib
kmiweb01:~ # ls -la $ORACLE_HOME
total 98648
drwxr-xr-x 4 root root 4096 Aug 13 09:24 .
drwxr-xr-x 4 root root 4096 Jul 31 11:17 ..
lrwxrwxrwx 1 root root 17 Jul 31 14:11 libclntsh.so -> libclntsh.so.10.1
-rw-r--r-- 1 root root 21038613 Mar 12 2008 libclntsh.so.10.1
-rw-r--r-- 1 root root 3796601 Mar 12 2008 libnnz10.so
lrwxrwxrwx 1 root root 15 Jul 31 14:11 libocci.so -> libocci.so.10.1
-rw-r--r-- 1 root root 1664116 Mar 12 2008 libocci.so.10.1
-rw-r--r-- 1 root root 72674185 Mar 12 2008 libociei.so
-rw-r--r-- 1 root root 138033 Mar 12 2008 libocijdbc10.so
drwxr-xr-x 3 root root 4096 Aug 13 09:24 network
-rw-r--r-- 1 root root 1555682 Mar 12 2008 ojdbc14.jar
drwxrwxr-x 4 root root 4096 Mar 12 2008 sdk
kmiweb01:~ #
------

At this point, we're fairly mystified. The file that ZcxOracleDA's install ultimately complains about is indeed in $ORACLE_HOME, where I would expect it to be looking. We're still able to manually start Plone's Python and import cx_Oracle just fine. Does anyone have any suggestions?

Thank you,
David Murphy
Re: ZcxOracleDA configuration assistance [ In reply to ]
Am 17.08.2009, 15:05 Uhr, schrieb <DMurphy@kalsec.com>:

> ImportError: libclntsh.so.10.1: cannot open shared object file: No such
> file or directory
> ------
>
> $ORACLE_HOME and $LD_LIBRARY_PATH are being exported from ~/.profile as
> recommended in the cx_Oracle build document. They are:
>
> ------
> kmiweb01:~ # echo $ORACLE_HOME
> /usr/lib/oracle/10.2.0.4/client64/lib
> kmiweb01:~ # echo $LD_LIBRARY_PATH
> :/usr/lib/oracle/10.2.0.4/client64/lib
> kmiweb01:~ # ls -la $ORACLE_HOME
> total 98648
> drwxr-xr-x 4 root root 4096 Aug 13 09:24 .
> drwxr-xr-x 4 root root 4096 Jul 31 11:17 ..
> lrwxrwxrwx 1 root root 17 Jul 31 14:11 libclntsh.so ->
> libclntsh.so.10.1
> -rw-r--r-- 1 root root 21038613 Mar 12 2008 libclntsh.so.10.1
> -rw-r--r-- 1 root root 3796601 Mar 12 2008 libnnz10.so
> lrwxrwxrwx 1 root root 15 Jul 31 14:11 libocci.so ->
> libocci.so.10.1
> -rw-r--r-- 1 root root 1664116 Mar 12 2008 libocci.so.10.1
> -rw-r--r-- 1 root root 72674185 Mar 12 2008 libociei.so
> -rw-r--r-- 1 root root 138033 Mar 12 2008 libocijdbc10.so
> drwxr-xr-x 3 root root 4096 Aug 13 09:24 network
> -rw-r--r-- 1 root root 1555682 Mar 12 2008 ojdbc14.jar
> drwxrwxr-x 4 root root 4096 Mar 12 2008 sdk
> kmiweb01:~ #
> ------
>
> At this point, we're fairly mystified. The file that ZcxOracleDA's
> install ultimately complains about is indeed in $ORACLE_HOME, where I
> would expect it to be looking. We're still able to manually start
> Plone's Python and import cx_Oracle just fine. Does anyone have any
> suggestions?

Given that it works when you run Python manually but not when you start
the cluster the problem is likely to be that your Zope user doesn't have
the right permissions to access the library.

Charlie Clark
--
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: ZcxOracleDA configuration assistance [ In reply to ]
zope-db-bounces@zope.org wrote on 08/17/2009 02:06:59 PM:

> From:

>
> "Charlie Clark" <charlie@egenix.com>

>
> To:

>
> zope-db@zope.org

>
> Date:

>
> 08/17/2009 02:04 PM

>
> Subject:

>
> Re: [Zope-DB] ZcxOracleDA configuration assistance

>
> Sent by:

>
> zope-db-bounces@zope.org

>
> Am 17.08.2009, 15:05 Uhr, schrieb <DMurphy@kalsec.com>:
>
> > ImportError: libclntsh.so.10.1: cannot open shared object file: No such
> > file or directory
> > ------
> >
> > $ORACLE_HOME and $LD_LIBRARY_PATH are being exported from ~/.profile as
> > recommended in the cx_Oracle build document. They are:
> >
> > ------
> > kmiweb01:~ # echo $ORACLE_HOME
> > /usr/lib/oracle/10.2.0.4/client64/lib
> > kmiweb01:~ # echo $LD_LIBRARY_PATH
> > :/usr/lib/oracle/10.2.0.4/client64/lib
> > kmiweb01:~ # ls -la $ORACLE_HOME
> > total 98648
> > drwxr-xr-x 4 root root 4096 Aug 13 09:24 .
> > drwxr-xr-x 4 root root 4096 Jul 31 11:17 ..
> > lrwxrwxrwx 1 root root 17 Jul 31 14:11 libclntsh.so ->
> > libclntsh.so.10.1
> > -rw-r--r-- 1 root root 21038613 Mar 12 2008 libclntsh.so.10.1
> > -rw-r--r-- 1 root root 3796601 Mar 12 2008 libnnz10.so
> > lrwxrwxrwx 1 root root 15 Jul 31 14:11 libocci.so ->
> > libocci.so.10.1
> > -rw-r--r-- 1 root root 1664116 Mar 12 2008 libocci.so.10.1
> > -rw-r--r-- 1 root root 72674185 Mar 12 2008 libociei.so
> > -rw-r--r-- 1 root root 138033 Mar 12 2008 libocijdbc10.so
> > drwxr-xr-x 3 root root 4096 Aug 13 09:24 network
> > -rw-r--r-- 1 root root 1555682 Mar 12 2008 ojdbc14.jar
> > drwxrwxr-x 4 root root 4096 Mar 12 2008 sdk
> > kmiweb01:~ #
> > ------
> >
> > At this point, we're fairly mystified. The file that ZcxOracleDA's
> > install ultimately complains about is indeed in $ORACLE_HOME, where I
> > would expect it to be looking. We're still able to manually start
> > Plone's Python and import cx_Oracle just fine. Does anyone have any
> > suggestions?
>
> Given that it works when you run Python manually but not when you start
> the cluster the problem is likely to be that your Zope user doesn't have
> the right permissions to access the library.

Thanks for the response. Plone's documentation says that for the type of install we did, Zope should run as the user "plone" (I verified this with ps). Unfortunately, even if I chown everything in $ORACLE_HOME to user plone and restart the cluster again, the error remains the same.

-David Murphy
Re: ZcxOracleDA configuration assistance [ In reply to ]
> > > At this point, we're fairly mystified. The file that ZcxOracleDA's
> > > install ultimately complains about is indeed in $ORACLE_HOME,
> where I
> > > would expect it to be looking. We're still able to manually start
> > > Plone's Python and import cx_Oracle just fine. Does anyone have
> any
> > > suggestions?
> >
> > Given that it works when you run Python manually but not when you
> start
> > the cluster the problem is likely to be that your Zope user
> doesn't have
> > the right permissions to access the library.
>
> Thanks for the response. Plone's documentation says that for the
> type of install we did, Zope should run as the user "plone" (I
> verified this with ps). Unfortunately, even if I chown everything in
> $ORACLE_HOME to user plone and restart the cluster again, the error
> remains the same.
>


Are the $ORACLE_HOME and $LD_LIBRARY_PATH variables exported for the
user that Zope is running as? You didn't say whether your test script
was run as that user or some other user (and hence for whom those
variables were exported).

Cheers,
Dan

--
Dan Fairs <dan@fezconsulting.com> | http://www.fezconsulting.com/

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: ZcxOracleDA configuration assistance [ In reply to ]
Dan Fairs <dan@fezconsulting.com> wrote on 08/17/2009 02:31:51 PM:

> Re: [Zope-DB] ZcxOracleDA configuration assistance

>
> > > > At this point, we're fairly mystified. The file that ZcxOracleDA's
> > > > install ultimately complains about is indeed in $ORACLE_HOME,
> > where I
> > > > would expect it to be looking. We're still able to manually start
> > > > Plone's Python and import cx_Oracle just fine. Does anyone have
> > any
> > > > suggestions?
> > >
> > > Given that it works when you run Python manually but not when you
> > start
> > > the cluster the problem is likely to be that your Zope user
> > doesn't have
> > > the right permissions to access the library.
> >
> > Thanks for the response. Plone's documentation says that for the
> > type of install we did, Zope should run as the user "plone" (I
> > verified this with ps). Unfortunately, even if I chown everything in
> > $ORACLE_HOME to user plone and restart the cluster again, the error
> > remains the same.
> >
>
>
> Are the $ORACLE_HOME and $LD_LIBRARY_PATH variables exported for the
> user that Zope is running as? You didn't say whether your test script
> was run as that user or some other user (and hence for whom those
> variables were exported).

Ok, I think that was the prod I needed. I have the variables exported from the profiles of both root and plone (under which Zope should be running), but I apparently haven't set it in the right spot yet. If I log in as plone, a manual import of cx_Oracle works fine. However, if as root I "sudo -u plone /.../python" and try to import, I get the same error returned by ZcxOracleDA. Haven't figured out how to get around it yet, but it looks like this takes it out of the realm of Zope and into basic system administration.

Thanks,
David Murphy
Re: ZcxOracleDA configuration assistance [ In reply to ]
> Ok, I think that was the prod I needed. I have the variables
> exported from the profiles of both root and plone (under which Zope
> should be running), but I apparently haven't set it in the right
> spot yet. If I log in as plone, a manual import of cx_Oracle works
> fine. However, if as root I "sudo -u plone /.../python" and try to
> import, I get the same error returned by ZcxOracleDA. Haven't
> figured out how to get around it yet, but it looks like this takes
> it out of the realm of Zope and into basic system administration.


You'll probably need to provide additional arguments to sudo to tell
it to run a login shell to pick up stuff in .profile and friends - I'm
afraid I can't remember what they are off the top of my head. Check
the man page for sudo.

Cheers,
Dan

--
Dan Fairs <dan@fezconsulting.com> | http://www.fezconsulting.com/

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db