Loading ...
Sorry, an error occurred while loading the content.

Intermittent error in Included script

Expand Messages
  • John D. Leonard II
    All: 1) I m getting an intermittent error while executing a script. Here is the code: #================================== Test
    Message 1 of 6 , Jan 3, 2002
    • 0 Attachment
      All:

      1) I'm getting an intermittent error while executing a script. Here is
      the code:

      #==================================
      <h1>Test</h1>
      <%
      print <<EOF;
      The following is a test of ASP and the
      use of a handrolled PM file NOT on the perl/site path.<P>
      EOF

      print "Current week of year: " . WeekOfYear();
      print "Week of year for May 1, 2002: " . WeekOfYear(2002,5,1);
      print "<p>";

      %>
      # =====================================

      2) Intermittently, the script works, or fails with a "Undefined
      subroutine" error associated with "WeekOfYear"


      3) The subroutine "WeekOfYear" is contained in a handrolled PM file. On
      this server I don't have admin access, so I'm PUSHing the location of
      the PM file onto the INC using the following code in my global.asa:

      ==========

      BEGIN{
      push @INC,"/export/admin/jleonard/globals/ISG/CourseTools/blib/lib";
      }

      use HTML::TreeBuilder;
      use ISG::CourseTools;

      ==========

      My Script_OnStart, etc. are empty.

      4) I'm running mostly defaults in the .htaccess file:

      PerlSetVar Global /export/admin/jleonard/globals/200202
      PerlSetVar IncludesDir /export/admin/jleonard/globals/common
      PerlSetVar StateDir /tmp/200202

      PerlSetVar Debug -3
      PerlSetVar TimeHiRes 1
      PerlSetVar UseStrict 1

      5) Here is a log dump when the script works:

      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4429;0.0000] RUN ASP (v2.29) for
      /export/services/apache/sites/classes/200202/coe1361/home.htm
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4450;0.0021] GlobalASA package
      Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asax
      88403fa5e7f51debcc2e57acb88be3c0
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4481;0.0031] parse file home.htm
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4491;0.0010] parsing home.htm
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4528;0.0037] undefing sub
      Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asax
      88403fa5e7f51debcc2e57acb88be3c0::__ASP_NoCache code CODE(0x10be31c)
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4539;0.0011] compiling into package
      Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asax
      88403fa5e7f51debcc2e57acb88be3c0 subid
      [Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asa
      x88403fa5e7f51debcc2e57acb88be3c0::__ASP_NoCache]
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4602;0.0063] Script_OnStart
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4612;0.0010] executing Script_OnStart
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4641;0.0029] executing __ASP_NoCache
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4684;0.0043] Script_OnEnd
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4694;0.0010] Script_OnFlush
      [Thu Jan 3 12:48:42 2002] [error] [asp] [15940] [debug]
      [1010080122.4705;0.0011] page served in 29.15 milliseconds

      6) Here is a log dump when the script fails:

      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1709;0.0000] RUN ASP (v2.29) for
      /export/services/apache/sites/classes/200202/coe1361/home.htm
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1731;0.0022] GlobalASA package
      Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asax
      88403fa5e7f51debcc2e57acb88be3c0
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1765;0.0034] parse file home.htm
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1775;0.0010] parsing home.htm
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1813;0.0038] undefing sub
      Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asax
      88403fa5e7f51debcc2e57acb88be3c0::__ASP_NoCache code CODE(0xa89e48)
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1824;0.0011] compiling into package
      Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asax
      88403fa5e7f51debcc2e57acb88be3c0 subid
      [Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asa
      x88403fa5e7f51debcc2e57acb88be3c0::__ASP_NoCache]
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1886;0.0062] Script_OnStart
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1896;0.0010] executing Script_OnStart
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1923;0.0027] executing __ASP_NoCache
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [error] Undefined
      subroutine
      &Apache::ASP::Compiles::_export_admin_jleonard_globals_200202_global_asa
      x88403fa5e7f51debcc2e57acb88be3c0::WeekOfYear called at home.htm line
      18. <--> , /usr/local/lib/perl5/site_perl/5.6.0/Apache/ASP.pm line 1560
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1951;0.0028] Script_OnEnd
      [Thu Jan 3 12:48:50 2002] [error] [asp] [16009] [debug]
      [1010080130.1962;0.0011] ASP Done Processing - asp:
      Apache::ASP=HASH(0xd9b124);

      Any clues?

      JL


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Joshua Chamas
      ... In what package is WeekOfYear() defined and how it is supposed to be exported into the global.asa package? Is it using Exporter? Make sure that the
      Message 2 of 6 , Jan 3, 2002
      • 0 Attachment
        "John D. Leonard II" wrote:
        >
        > 2) Intermittently, the script works, or fails with a "Undefined
        > subroutine" error associated with "WeekOfYear"
        >
        > 3) The subroutine "WeekOfYear" is contained in a handrolled PM file. On
        > this server I don't have admin access, so I'm PUSHing the location of
        > the PM file onto the INC using the following code in my global.asa:
        >
        > ==========
        >
        > BEGIN{
        > push @INC,"/export/admin/jleonard/globals/ISG/CourseTools/blib/lib";
        > }
        >
        > use HTML::TreeBuilder;
        > use ISG::CourseTools;
        >
        > ==========
        >
        > My Script_OnStart, etc. are empty.
        >

        In what package is WeekOfYear() defined and how it is supposed to be
        exported into the global.asa package? Is it using Exporter?
        Make sure that the package that defines WeekOfYear() and exports
        it is used in global.asa so the import of WeekOfYear() can occur.
        Also make sure that WeekOfYear is being explicitly exported.

        Instead of BEGIN {}, try using "use lib qw(/path/)" for the
        same effect. This is not related to your problem, just cleaner.

        > 4) I'm running mostly defaults in the .htaccess file:
        >
        > PerlSetVar Global /export/admin/jleonard/globals/200202
        > PerlSetVar IncludesDir /export/admin/jleonard/globals/common
        > PerlSetVar StateDir /tmp/200202
        >

        FYI, Global acts an an IncludesDir... IncludesDir is nice when
        you want to share includes accross applications.

        If you get to the end of the line, and you need to make this work
        try something like this in global.asa:

        use Package;
        *WeekOfYear = *Package::WeekOfYear;

        This is by no means ideal, but if this works, and nothing else
        does, this may give us some clues.

        If you are using StatINC or StatINCMatch settings, try turning
        them off & see if that makes a difference.

        -- Josh
        _________________________________________________________________
        Joshua Chamas Chamas Enterprises Inc.
        NodeWorks Founder Huntington Beach, CA USA
        http://www.nodeworks.com 1-714-625-4051

        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • John D. Leonard II
        ... WeekOfYear()is exported in ISG::CourseTools. The ISG::CourseTools module was created using h2xs from the command line. My module test script
        Message 3 of 6 , Jan 3, 2002
        • 0 Attachment
          Joshua:

          > >
          > > use HTML::TreeBuilder;
          > > use ISG::CourseTools;
          > >
          >
          > In what package is WeekOfYear() defined and how it is
          > supposed to be exported into the global.asa package? Is it
          > using Exporter? Make sure that the package that defines
          > WeekOfYear() and exports it is used in global.asa so the
          > import of WeekOfYear() can occur. Also make sure that
          > WeekOfYear is being explicitly exported.

          WeekOfYear()is exported in ISG::CourseTools. The ISG::CourseTools
          module was created using "h2xs" from the command line. My module test
          script "t/weekofyear.t" works properly. Here is the top of my module:

          ===================================
          package ISG::CourseTools;

          require 5.005_62;
          use strict;
          use warnings;

          require Exporter;
          use AutoLoader qw(AUTOLOAD);

          use Time::Local;
          use Time::localtime;

          our @ISA = qw(Exporter);

          # Items to export into callers namespace by default. Note: do not export
          # names by default without a very good reason. Use EXPORT_OK instead.
          # Do not simply export all your public functions/methods/constants.

          # This allows declaration use ISG::CourseTools ':all';
          # If you do not need this, moving things directly into @EXPORT or
          @EXPORT_OK
          # will save memory.
          our %EXPORT_TAGS = ( 'all' => [ qw(
          WeekOfYear
          ) ] );

          our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

          our @EXPORT = qw(
          WeekOfYear
          );

          ================================

          > FYI, Global acts an an IncludesDir... IncludesDir is nice when
          > you want to share includes accross applications.

          Does "IncludeDir" also apply to any and all "use" commands?

          > If you are using StatINC or StatINCMatch settings, try
          > turning them off & see if that makes a difference.

          StatINC is set to the default (0). I explicitly set it and still get
          the same intermittent problem.

          I'll keep plugging.

          JL


          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        • Joshua Chamas
          ... Sorry to take so long to get back to you on this. I am still getting caught up from the holidays! The only thing I can think of is that maybe StatScripts
          Message 4 of 6 , Jan 8, 2002
          • 0 Attachment
            "John D. Leonard II" wrote:
            > ...
            > WeekOfYear()is exported in ISG::CourseTools. The ISG::CourseTools
            > module was created using "h2xs" from the command line. My module test
            > script "t/weekofyear.t" works properly. Here is the top of my module:
            > ...

            Sorry to take so long to get back to you on this. I am still getting
            caught up from the holidays!

            The only thing I can think of is that maybe StatScripts was set to 0, but
            I didn't see the config info in your Debug error_log output to confirm.
            So make sure that PerlSetVar StatScripts 1 is set ( which is the default )...
            If there was a global.asa compiled that did not import WeekOfYear, and
            StatScripts was set to 0 & then you added the WeekOfYear import to global.asa,
            I could see how you might get this error if only intermittently.

            If you continue to have problems with this, try to emails a bit of
            error_log with Debug set to -3 from a fresh server restart to this
            problem occuring, that could help diagnose this better.

            > > FYI, Global acts an an IncludesDir... IncludesDir is nice when
            > > you want to share includes accross applications.
            >
            > Does "IncludeDir" also apply to any and all "use" commands?
            >

            No, just for including ASP includes.

            > > If you are using StatINC or StatINCMatch settings, try
            > > turning them off & see if that makes a difference.
            >
            > StatINC is set to the default (0). I explicitly set it and still get
            > the same intermittent problem.
            >
            > I'll keep plugging.
            >

            Let me know if I can help any more.

            --Josh

            _________________________________________________________________
            Joshua Chamas Chamas Enterprises Inc.
            NodeWorks Founder Huntington Beach, CA USA
            http://www.nodeworks.com 1-714-625-4051

            ---------------------------------------------------------------------
            To unsubscribe, e-mail: asp-unsubscribe@...
            For additional commands, e-mail: asp-help@...
          Your message has been successfully submitted and would be delivered to recipients shortly.