• Issue with Apache-Rivet and Oratcl

    From Manfred Schwarz@21:1/5 to All on Mon Nov 14 02:15:21 2022
    Hi All,

    I am running a cient/server application that I need to migrate to a new server. The server is running Apache Server 2.4.54 with rivet.
    Oratcl should be used for the connection to a Oracle database, and should be loaded in a rivet-script when Apache starts.
    For this purpose, the following command is in the Apache Conf file:

    RivetServerConf ChildInitScript "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    Inside globalscript.tcl are following lines:

    set ::env(ORACLE_LIBRARY) "/mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1"
    set ::env(ORACLE_HOME) "/mein_user/bin/oracle/instantclient_21_8"
    set ::env(LD_LIBRARY_PATH) "/mein_user/bin/oracle/instantclient_21_8"

    lappend auto_path "/mein_user/lib/tcl/"
    lappend auto_path "/mein_user/bin/oracle/instantclient_21_8/"

    package require Oratcl 4.5


    When "package require Oratcl" is called, I get following error message:

    (20014)Internal error (specific information not available): mod_rivet: Error in Child init script: source /apps/apache2.4.54/lib/conf/globalscript.tcl
    (20014)Internal error (specific information not available): errorCode: NONE
    (20014)Internal error (specific information not available): errorInfo:
    while executing
    "load /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so"
    ("package ifneeded Oratcl 4.5" script)
    invoked from within
    "package require Oratcl 4.5"
    (file "/apps/apache2.4.54/lib/conf/globalscript.tcl" line 11)
    invoked from within
    "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    When the Apache server is subsequently terminated, the following error message is output:

    Oratcl_Init(): Failed to load /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 with error libnnz21.so: cannot open shared object file: No such file or directory
    Oratcl_Init(): ORACLE_LIBRARY = /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 : file not found.

    The libraries libclntsh.so.21.1 and libnnz21.so exists, and are in the same directory.

    If I run globalscript.tcl in a Tcl shell, everything works fine.

    Do you have any idea why the error occurs?

    Manfred

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Schwarz@21:1/5 to Manfred Schwarz on Mon Nov 14 03:46:28 2022
    Manfred Schwarz schrieb am Montag, 14. November 2022 um 11:15:24 UTC+1:
    Hi All,

    I am running a cient/server application that I need to migrate to a new server.
    The server is running Apache Server 2.4.54 with rivet.
    Oratcl should be used for the connection to a Oracle database, and should be loaded in a rivet-script when Apache starts.
    For this purpose, the following command is in the Apache Conf file:

    RivetServerConf ChildInitScript "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    Inside globalscript.tcl are following lines:

    set ::env(ORACLE_LIBRARY) "/mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1"
    set ::env(ORACLE_HOME) "/mein_user/bin/oracle/instantclient_21_8"
    set ::env(LD_LIBRARY_PATH) "/mein_user/bin/oracle/instantclient_21_8"

    lappend auto_path "/mein_user/lib/tcl/"
    lappend auto_path "/mein_user/bin/oracle/instantclient_21_8/"

    package require Oratcl 4.5


    When "package require Oratcl" is called, I get following error message:

    (20014)Internal error (specific information not available): mod_rivet: Error in Child init script: source /apps/apache2.4.54/lib/conf/globalscript.tcl
    (20014)Internal error (specific information not available): errorCode: NONE (20014)Internal error (specific information not available): errorInfo:
    while executing
    "load /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so"
    ("package ifneeded Oratcl 4.5" script)
    invoked from within
    "package require Oratcl 4.5"
    (file "/apps/apache2.4.54/lib/conf/globalscript.tcl" line 11)
    invoked from within
    "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    When the Apache server is subsequently terminated, the following error message is output:

    Oratcl_Init(): Failed to load /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 with error libnnz21.so: cannot open shared object file: No such file or directory
    Oratcl_Init(): ORACLE_LIBRARY = /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 : file not found.

    The libraries libclntsh.so.21.1 and libnnz21.so exists, and are in the same directory.

    If I run globalscript.tcl in a Tcl shell, everything works fine.

    Do you have any idea why the error occurs?

    Manfred

    Additional information:

    When I first start Apache and then call globalscript.tcl from the browser, I get the following error message:

    while executing
    "load /home/flow_adm/lib/tcl/Oratcl4.5/libOratcl4.5.so"
    ("package ifneeded Oratcl 4.5" script)
    invoked from within
    "package require Oratcl 4.5"
    (in namespace eval "::request" script line 10)
    invoked from within
    "namespace eval ::request $script"
    ("::try" body line 12)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Schwarz@21:1/5 to Manfred Schwarz on Mon Nov 14 04:24:16 2022
    Manfred Schwarz schrieb am Montag, 14. November 2022 um 11:15:24 UTC+1:
    Hi All,

    I am running a cient/server application that I need to migrate to a new server.
    The server is running Apache Server 2.4.54 with rivet.
    Oratcl should be used for the connection to a Oracle database, and should be loaded in a rivet-script when Apache starts.
    For this purpose, the following command is in the Apache Conf file:

    RivetServerConf ChildInitScript "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    Inside globalscript.tcl are following lines:

    set ::env(ORACLE_LIBRARY) "/mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1"
    set ::env(ORACLE_HOME) "/mein_user/bin/oracle/instantclient_21_8"
    set ::env(LD_LIBRARY_PATH) "/mein_user/bin/oracle/instantclient_21_8"

    lappend auto_path "/mein_user/lib/tcl/"
    lappend auto_path "/mein_user/bin/oracle/instantclient_21_8/"

    package require Oratcl 4.5


    When "package require Oratcl" is called, I get following error message:

    (20014)Internal error (specific information not available): mod_rivet: Error in Child init script: source /apps/apache2.4.54/lib/conf/globalscript.tcl
    (20014)Internal error (specific information not available): errorCode: NONE (20014)Internal error (specific information not available): errorInfo:
    while executing
    "load /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so"
    ("package ifneeded Oratcl 4.5" script)
    invoked from within
    "package require Oratcl 4.5"
    (file "/apps/apache2.4.54/lib/conf/globalscript.tcl" line 11)
    invoked from within
    "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    When the Apache server is subsequently terminated, the following error message is output:

    Oratcl_Init(): Failed to load /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 with error libnnz21.so: cannot open shared object file: No such file or directory
    Oratcl_Init(): ORACLE_LIBRARY = /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 : file not found.

    The libraries libclntsh.so.21.1 and libnnz21.so exists, and are in the same directory.

    If I run globalscript.tcl in a Tcl shell, everything works fine.

    Do you have any idea why the error occurs?

    Manfred


    Additional information:

    When I first start Apache and then call globalscript.tcl from the browser, I get the following error message:

    while executing
    "load /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so"
    ("package ifneeded Oratcl 4.5" script)
    invoked from within
    "package require Oratcl 4.5"
    (in namespace eval "::request" script line 10)
    invoked from within
    "namespace eval ::request $script"
    ("::try" body line 12)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Mon Nov 14 13:45:15 2022
    Am 14.11.2022 um 11:15 schrieb Manfred Schwarz:
    Hi All,

    I am running a cient/server application that I need to migrate to a new server.
    The server is running Apache Server 2.4.54 with rivet.
    Oratcl should be used for the connection to a Oracle database, and should be loaded in a rivet-script when Apache starts.
    For this purpose, the following command is in the Apache Conf file:

    RivetServerConf ChildInitScript "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    Inside globalscript.tcl are following lines:

    set ::env(ORACLE_LIBRARY) "/mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1"
    set ::env(ORACLE_HOME) "/mein_user/bin/oracle/instantclient_21_8"
    set ::env(LD_LIBRARY_PATH) "/mein_user/bin/oracle/instantclient_21_8"

    lappend auto_path "/mein_user/lib/tcl/"
    lappend auto_path "/mein_user/bin/oracle/instantclient_21_8/"

    package require Oratcl 4.5


    When "package require Oratcl" is called, I get following error message:

    (20014)Internal error (specific information not available): mod_rivet: Error in Child init script: source /apps/apache2.4.54/lib/conf/globalscript.tcl
    (20014)Internal error (specific information not available): errorCode: NONE
    (20014)Internal error (specific information not available): errorInfo:
    while executing
    "load /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so"
    ("package ifneeded Oratcl 4.5" script)
    invoked from within
    "package require Oratcl 4.5"
    (file "/apps/apache2.4.54/lib/conf/globalscript.tcl" line 11)
    invoked from within
    "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    When the Apache server is subsequently terminated, the following error message is output:

    Oratcl_Init(): Failed to load /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 with error libnnz21.so: cannot open shared object file: No such file or directory
    Oratcl_Init(): ORACLE_LIBRARY = /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 : file not found.

    The libraries libclntsh.so.21.1 and libnnz21.so exists, and are in the same directory.

    If I run globalscript.tcl in a Tcl shell, everything works fine.

    Do you have any idea why the error occurs?

    Manfred

    Dear Manfred,
    thank you for the report. The main difference between apache and a plain
    tclsh is the involved user. I suppose, the apache user may require some
    rights. In addition, I can imagine, that security packages like selinux
    may block here.
    In the time, I still used great rivet, I had no issues like that.
    Can you try to load another .so file and check if this works?

    The unload error of not loading "libclntsh.so" is also interesting.
    Apparently, Oratcl is half loaded.

    Sorry, no more info from my side. Did you consider to ask on the rivet
    mailing list ? [email protected] ? Some of the folks there may
    know the reason.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Schwarz@21:1/5 to Harald Oehlmann on Mon Nov 14 05:31:58 2022
    Harald Oehlmann schrieb am Montag, 14. November 2022 um 13:45:29 UTC+1:
    Am 14.11.2022 um 11:15 schrieb Manfred Schwarz:
    Hi All,

    I am running a cient/server application that I need to migrate to a new server.
    The server is running Apache Server 2.4.54 with rivet.
    Oratcl should be used for the connection to a Oracle database, and should be loaded in a rivet-script when Apache starts.
    For this purpose, the following command is in the Apache Conf file:

    RivetServerConf ChildInitScript "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    Inside globalscript.tcl are following lines:

    set ::env(ORACLE_LIBRARY) "/mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1"
    set ::env(ORACLE_HOME) "/mein_user/bin/oracle/instantclient_21_8"
    set ::env(LD_LIBRARY_PATH) "/mein_user/bin/oracle/instantclient_21_8"

    lappend auto_path "/mein_user/lib/tcl/"
    lappend auto_path "/mein_user/bin/oracle/instantclient_21_8/"

    package require Oratcl 4.5


    When "package require Oratcl" is called, I get following error message:

    (20014)Internal error (specific information not available): mod_rivet: Error in Child init script: source /apps/apache2.4.54/lib/conf/globalscript.tcl
    (20014)Internal error (specific information not available): errorCode: NONE (20014)Internal error (specific information not available): errorInfo: while executing
    "load /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so"
    ("package ifneeded Oratcl 4.5" script)
    invoked from within
    "package require Oratcl 4.5"
    (file "/apps/apache2.4.54/lib/conf/globalscript.tcl" line 11)
    invoked from within
    "source /apps/apache2.4.54/lib/conf/globalscript.tcl"

    When the Apache server is subsequently terminated, the following error message is output:

    Oratcl_Init(): Failed to load /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 with error libnnz21.so: cannot open shared object file: No such file or directory
    Oratcl_Init(): ORACLE_LIBRARY = /mein_user/bin/oracle/instantclient_21_8/libclntsh.so.21.1 : file not found.

    The libraries libclntsh.so.21.1 and libnnz21.so exists, and are in the same directory.

    If I run globalscript.tcl in a Tcl shell, everything works fine.

    Do you have any idea why the error occurs?

    Manfred
    Dear Manfred,
    thank you for the report. The main difference between apache and a plain tclsh is the involved user. I suppose, the apache user may require some rights. In addition, I can imagine, that security packages like selinux
    may block here.
    In the time, I still used great rivet, I had no issues like that.
    Can you try to load another .so file and check if this works?

    The unload error of not loading "libclntsh.so" is also interesting. Apparently, Oratcl is half loaded.

    Sorry, no more info from my side. Did you consider to ask on the rivet mailing list ? [email protected] ? Some of the folks there may
    know the reason.

    Take care,
    Harald

    Dear Harald,
    thank you for your quick reply.
    The thing with the different users, could be the reason.
    On my current server, Apache, rivet and Oratcl are running under the same user and all works fine.
    On my new server Apache and Oratcl are stored in different users, and I have no direct access to the Apache/Rivet user.
    I will try to get the access and try it with that.

    Thanks also for the tip with the Rivet mailing list!

    Manfred

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Manfred Schwarz on Mon Nov 14 15:07:45 2022
    Manfred Schwarz <[email protected]> wrote:
    thank you for your quick reply.
    The thing with the different users, could be the reason.
    On my current server, Apache, rivet and Oratcl are running under the
    same user and all works fine.
    On my new server Apache and Oratcl are stored in different users, and
    I have no direct access to the Apache/Rivet user.
    I will try to get the access and try it with that.

    Thanks also for the tip with the Rivet mailing list!

    If the Apache and Oratcl users differ, then the permissions on every
    path element here:

    /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so

    need to be set such that the Apache user can access the file. If
    Apache and Oracle users are not in the same group (likely) then this
    means all the directories (/mein_user/lib/tcl/Oratcl4.5) need to be
    world readable and world executable) and the libOratcl4.5.so file needs
    to be world readable (and might need to also be world executable).

    You might not need "access to the apache user" if you set the
    permissions on the library paths and files properly.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Schwarz@21:1/5 to Rich on Mon Nov 14 09:03:46 2022
    Rich schrieb am Montag, 14. November 2022 um 16:07:49 UTC+1:
    Manfred Schwarz <[email protected]> wrote:
    thank you for your quick reply.
    The thing with the different users, could be the reason.
    On my current server, Apache, rivet and Oratcl are running under the
    same user and all works fine.
    On my new server Apache and Oratcl are stored in different users, and
    I have no direct access to the Apache/Rivet user.
    I will try to get the access and try it with that.

    Thanks also for the tip with the Rivet mailing list!
    If the Apache and Oratcl users differ, then the permissions on every
    path element here:

    /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so

    need to be set such that the Apache user can access the file. If
    Apache and Oracle users are not in the same group (likely) then this
    means all the directories (/mein_user/lib/tcl/Oratcl4.5) need to be
    world readable and world executable) and the libOratcl4.5.so file needs
    to be world readable (and might need to also be world executable).

    You might not need "access to the apache user" if you set the
    permissions on the library paths and files properly.

    Hi Rich,
    thank you for your suggestion!
    I have set the appropiate permissions but it still does not work. :-(

    Manfred

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Schwarz@21:1/5 to Manfred Schwarz on Tue Nov 22 02:32:09 2022
    Manfred Schwarz schrieb am Montag, 14. November 2022 um 18:03:49 UTC+1:
    Rich schrieb am Montag, 14. November 2022 um 16:07:49 UTC+1:
    Manfred Schwarz <[email protected]> wrote:
    thank you for your quick reply.
    The thing with the different users, could be the reason.
    On my current server, Apache, rivet and Oratcl are running under the
    same user and all works fine.
    On my new server Apache and Oratcl are stored in different users, and
    I have no direct access to the Apache/Rivet user.
    I will try to get the access and try it with that.

    Thanks also for the tip with the Rivet mailing list!
    If the Apache and Oratcl users differ, then the permissions on every
    path element here:

    /mein_user/lib/tcl/Oratcl4.5/libOratcl4.5.so

    need to be set such that the Apache user can access the file. If
    Apache and Oracle users are not in the same group (likely) then this
    means all the directories (/mein_user/lib/tcl/Oratcl4.5) need to be
    world readable and world executable) and the libOratcl4.5.so file needs
    to be world readable (and might need to also be world executable).

    You might not need "access to the apache user" if you set the
    permissions on the library paths and files properly.
    Hi Rich,
    thank you for your suggestion!
    I have set the appropiate permissions but it still does not work. :-(

    Manfred

    Hi All,

    for those who are interested:
    After some experimentation I have found the, ultimately simple solution.

    sudo sh -c "echo /<path_to_oracle_client_dir>/instantclient_21_8 > /etc/ld.so.conf.d/oracle-instantclient.conf"
    sudo ldconfig

    After that, the Oracle client finds its libraries and loads them without errors.

    Manfred

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)