Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

failed: ERROR OCIEnvNlsCreate

sa73
2007-03-20
2013-06-03
  • sa73
    sa73
    2007-03-20

    Hello,
    I installed codestriker with perl5.8 and oracle10g but when I tried to finally start using codestriker, I see this error message at the bottom from the webpage.

    I surfed the web for the answer and basically found no real answers.

    I know it looks very easy to solve, but after placing environment variables in the codestriker.pl file,apache httpd.conf and apache user account profile, I'm stumped.

    I tried executing the codestriker.pl file directly via perl58 and it appears to execute without issue (although I see no references to oracle...so I'm not reely sure).

    The host machine is solaris 2.8. Both apache web and oracle are on the same machine.

    DBI connect('host={IP};sid={SID}','{x}',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc. at /usr/browser/codestriker/bin/../lib/Codestriker/DB/Database.pm line 61

    Thanks much,
    John

     
    • David Sitsky
      David Sitsky
      2007-03-20

      What about executing the install.pl file?  This will try to connect to the Oracle database and create the tables necessary for Codestriker.  If that works, then we are close.  This should show us what environment variables need to be set.

      I would also recommend just setting up CGI first, as there are complication with how environment variables are set under mod-perl.

      Cheers,
      David

       
    • sa73
      sa73
      2007-03-21

      Hello David,

      Thanks very much for responding.

      I did execute the install.pl file as root and received a similar message,but then I realized that on our 10g machine (which is still at this point a test server since we are in the process of planning to upgrade from 8i) oracle wasn't running....because I know I've run it before and never saw the error....and so after restarting oracle, the message disappeared and so I thought I would try the web again. When I tried the web it failed again with the same message....and so it works with install.pl directly but not from the web.

      As I mentioned before in my original post I tried placing env variables in a bunch of locations...oracle(profile)/apache(profile)/httpd.conf.

      You spurd some thought though.....and so I su'd as apache and ran install.pl and success ...then as oracle10g and saw this error:
      Generating cgi-bin/codestriker.pl file...
      Unable to create ../cgi-bin/codestriker.pl file: Permission denied at ./install.pl line 1058

      So I ventured further and removed codestriker.pl and su'd as oracle and changed perms on cgi-bin to 777(temporarily)... and re-executed install.pl...success.

      However, when I went back to the web it still failed with the same old web error as in my original post....so then I executed install.pl as apache and it failed with the perm error as above.....OK so do you think, like I, that this is strictly a perms issue?

      What do you think David? The entire codestriker path is owned by apache, except for the recently above created and oracle owned codestriker.pl file.

      John

       
      • David Sitsky
        David Sitsky
        2007-03-21

        Hi John,

        We need install.pl to be run by the apache user successfully, otherwise the codestriker application will never work.  So I take it the entire codestriker directory is owned by apache, that is, you did a chown -R apache on the codestriker directory?  If you can remove the generated codestriker.pl file in cgi-bin, we shouldn't be getting any more permission denied problems.

        If install.pl then runs successfully - the web application should be fine.

        Cheers,
        David

         
        • sa73
          sa73
          2007-03-23

          Hello David,

          I'm afraid this is a more complicated solution (than I think). I added some scriting at the beginning of the Database.pm file and it displays the variables needed for the ORACLE including NLS_LANG, etc. In DBD::Oracle, I am able to connect to the database as the codetriker user and scott/tiger. The make file has a few failures but nothing that indicates trouble with communicating with oracle or a database... I also changed perms on the entier oracle 10g path so that all directories are writeable by the apache user (executing the web .plS).
          .....this being said I still see the same issue. Argghhh.

          Any other ideas? surely this issue has been seen before. The web is plastered with questions but not very many answers. Where does error come from...is it codestriker?

          If so it would be great if it could identify exactly what's missing instead of a guesstimate.

          Thanks much,
          John

           
          • David Sitsky
            David Sitsky
            2007-03-25

            Hi John,

            Firstly - make sure you have setup Codestriker as a CGI scripts rather than mod-perl.

            Secondly - the difference must be in some other environment variables.  If install.pl works from the command line as user apache, type in the "set" command on the shell to see how your environment variables are set for that user.

            Perhaps the problem is some other environment variable, such as LD_LIBRARY_PATH is not set correctly when codestriker.pl is run from apache.  Add some debugs for that, and perhaps PATH as well, and anything else which looks relevant, and try and make them the same, regardless of the execution environment.

            Cheers,
            David

             
    • sa73
      sa73
      2007-03-23

      scriting=scripting
      it displays the variables needed for = it displays the currently defined variables in use while trying to reach

       
    • sa73
      sa73
      2007-03-23

      ooops and almost forgot...I am able to run install.pl successfully from the command line (unix) as the apache user account.

      Thanks much,
      John