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

Undefined subroutine error

Expand Messages
  • Roberto C. Sánchez
    MP gurus, I recently deployed a site using Apache::ASP. I am running up against a problem that has left me scratching my head. The site works fine on the
    Message 1 of 6 , Nov 10, 2008
    • 0 Attachment
      MP gurus,

      I recently deployed a site using Apache::ASP. I am running up against
      a problem that has left me scratching my head. The site works fine on
      the development server. However, on the production server, my error_log
      fills with these messages:

      [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine &Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data called at /srv/http/www.example.com/templates/masthead.tmpl line 2. <--> , /usr/share/perl5/Apache/ASP.pm line 1521

      (I have attached the complete error log output, with debugging enabled,
      for a failed request to this email.)

      The odd thing is that it is apparently intermittent. Sometimes, the
      error happens and a 500 error page is returned. Other times, the page
      loads as expected.

      Both servers (development and production) are running Debian Etch with
      Apache 2.2.3, mod_perl 2.0.2, and Apache::ASP 2.59 (all stock versions
      shipped with Debian Etch).

      The code that is generating the error is this:

      <%
      my %img_data = get_image_data('masthead.png');
      %>

      My DocumentRoot is /srv/http/www.example.com and I have a directory
      called /srv/http/www.example.com/Example which has my Perl modules in
      it. One of the modules is called Image.pm and it has a function called
      get_image_data(). In my global.asa I have "use Example::Image;".

      Something that also does not make sense to me is that if I change the
      document root to something like /srv/http/example or /srv/http/site,
      then the error appears to never happen. I have tested this by using
      both alternate document roots for about two weeks each and it appears to
      not have a problem in either case.

      There are two very strange things about this whole situation. On the
      (nearly) identically configured development server, I never get the
      above error. I have another site (one that is actually in production,
      as opposed to the example site) that uses a similar scheme on the same
      production server and it does not have this problem.

      Regards,

      -Roberto

      --
      Roberto C. Sánchez
      http://people.connexer.com/~roberto
      http://www.connexer.com
    • Warren Young
      ... Don t know if this will help, but try rm -rf /tmp/asp . (Assuming you re using the default State DB setup.) Then restart Apache. If the state DB gets
      Message 2 of 6 , Nov 10, 2008
      • 0 Attachment
        Roberto C. Sánchez wrote:
        >
        > [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine &Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data called at /srv/http/www.example.com/templates/masthead.tmpl line 2. <--> , /usr/share/perl5/Apache/ASP.pm line 1521

        Don't know if this will help, but try "rm -rf /tmp/asp". (Assuming
        you're using the default State DB setup.) Then restart Apache. If the
        state DB gets junk in it or application development causes old,
        incompatible versions of data structures to try to load, it can cause
        weirdness like this.

        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Roberto C. Sánchez
        ... I am using this setting: PerlSetVar NoState 1 So, I don t think your suggestion will help. Regards, -Roberto -- Roberto C. Sánchez
        Message 3 of 6 , Nov 12, 2008
        • 0 Attachment
          Warren Young wrote:

          > Roberto C. Sánchez wrote:
          > >
          > > [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine
          > &Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data
          > called at /srv/http/www.example.com/templates/masthead.tmpl line 2. <--> ,
          > /usr/share/perl5/Apache/ASP.pm line 1521
          >
          > Don't know if this will help, but try "rm -rf /tmp/asp". (Assuming
          > you're using the default State DB setup.) Then restart Apache. If the
          > state DB gets junk in it or application development causes old,
          > incompatible versions of data structures to try to load, it can cause
          > weirdness like this.

          I am using this setting:

          PerlSetVar NoState 1

          So, I don't think your suggestion will help.

          Regards,

          -Roberto

          --
          Roberto C. Sánchez
          http://people.connexer.com/~roberto
          http://www.connexer.com
        • Skylos
          Apache::Asp caches subroutine compiles within processes. Kill all running apache processes to delete their cache. (you don t strictly have to restart to do
          Message 4 of 6 , Nov 12, 2008
          • 0 Attachment
            Apache::Asp caches subroutine compiles within processes.

            Kill all running apache processes to delete their cache.  (you don't strictly have to restart to do this (killing workers and letting apache restart them works too) but its easier)

            It works when it hits one that loaded the module version that has the method.

            It doesn't work when it hits one that loaded the module version that doesn't have the method.

            I restart apache obsessively when modifying and testing modules for exactly this reason.

            You can also ameliorate this problem by lowering the number of requests a process handles before restarting, at the expense of cache hits.

            Skylos


            On Mon, Nov 10, 2008 at 5:01 PM, Roberto C. Sánchez <roberto@...> wrote:
            MP gurus,

            I recently deployed a site using Apache::ASP.  I am running up against
            a problem that has left me scratching my head.  The site works fine on
            the development server.  However, on the production server, my error_log
            fills with these messages:

            [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine &Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data called at /srv/http/www.example.com/templates/masthead.tmpl line 2. <--> , /usr/share/perl5/Apache/ASP.pm line 1521

            (I have attached the complete error log output, with debugging enabled,
            for a failed request to this email.)

            The odd thing is that it is apparently intermittent.  Sometimes, the
            error happens and a 500 error page is returned.  Other times, the page
            loads as expected.

            Both servers (development and production) are running Debian Etch with
            Apache 2.2.3, mod_perl 2.0.2, and Apache::ASP 2.59 (all stock versions
            shipped with Debian Etch).

            The code that is generating the error is this:

            <%
            my %img_data = get_image_data('masthead.png');
            %>

            My DocumentRoot is /srv/http/www.example.com and I have a directory
            called /srv/http/www.example.com/Example which has my Perl modules in
            it.  One of the modules is called Image.pm and it has a function called
            get_image_data().  In my global.asa I have "use Example::Image;".

            Something that also does not make sense to me is that if I change the
            document root to something like /srv/http/example or /srv/http/site,
            then the error appears to never happen.  I have tested this by using
            both alternate document roots for about two weeks each and it appears to
            not have a problem in either case.

            There are two very strange things about this whole situation.  On the
            (nearly) identically configured development server, I never get the
            above error.  I have another site (one that is actually in production,
            as opposed to the example site) that uses a similar scheme on the same
            production server and it does not have this problem.

            Regards,

            -Roberto

            --
            Roberto C. Sánchez
            http://people.connexer.com/~roberto
            http://www.connexer.com

            -----BEGIN PGP SIGNATURE-----
            Version: GnuPG v1.4.6 (GNU/Linux)

            iD8DBQFJGNlw5SXWIKfIlGQRAp2tAJ4hc3UfDt0LszN/6UTrRSErMtmnhACgv2j8
            s4zfI5IlVrRykSFjU2X3gi0=
            =O++Q
            -----END PGP SIGNATURE-----


          • Roberto C. Sánchez
            ... Thing is that this is happening to me on a production setup. I am not changing anything. Even completely stopping Apache and starting it fresh does not
            Message 5 of 6 , Nov 12, 2008
            • 0 Attachment
              On Wed, Nov 12, 2008 at 09:18:21AM -0800, Skylos wrote:
              > Apache::Asp caches subroutine compiles within processes.
              >
              > Kill all running apache processes to delete their cache. (you don't
              > strictly have to restart to do this (killing workers and letting apache
              > restart them works too) but its easier)
              >
              > It works when it hits one that loaded the module version that has the
              > method.
              >
              > It doesn't work when it hits one that loaded the module version that doesn't
              > have the method.
              >
              > I restart apache obsessively when modifying and testing modules for exactly
              > this reason.
              >
              > You can also ameliorate this problem by lowering the number of requests a
              > process handles before restarting, at the expense of cache hits.
              >
              Thing is that this is happening to me on a production setup. I am not
              changing anything. Even completely stopping Apache and starting it
              fresh does not alleviate the problem. Something really strange is that
              when I serve the content from a DocumentRoot of /srv/http/example, I
              *never* get the error. However, when I use a DocumentRoot of
              /srv/http/www.example.com, I do get the error from intermittently to
              constantly.

              Regards,

              -Roberto

              --
              Roberto C. Sánchez
              http://people.connexer.com/~roberto
              http://www.connexer.com
            • Tsirkin Evgeny
              Well you probably already thought of this but: It appears that the global.asa (and thus Example::Image.pm) get compiled into different packages then
              Message 6 of 6 , Nov 16, 2008
              • 0 Attachment
                Well you probably already thought of this but:
                It appears that the global.asa (and thus Example::Image.pm) get
                compiled into different
                packages then templates/masthead.tmpl.
                Do you have UniquePackages 0 or 1 ?
                Maybe this is caused by a template package you are using ,is this an
                asp script or another one?
                If the problem actually _ is _ the different packages then you can of
                cause solve it with
                PerlRequire / startup script or something like that.
                Thanks
                Evgeny

                On Tue, Nov 11, 2008 at 3:01 AM, Roberto C. Sánchez
                <roberto@...> wrote:
                > MP gurus,
                >
                > I recently deployed a site using Apache::ASP. I am running up against
                > a problem that has left me scratching my head. The site works fine on
                > the development server. However, on the production server, my error_log
                > fills with these messages:
                >
                > [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [error] Undefined subroutine &Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data called at /srv/http/www.example.com/templates/masthead.tmpl line 2. <--> , /usr/share/perl5/Apache/ASP.pm line 1521
                >
                > (I have attached the complete error log output, with debugging enabled,
                > for a failed request to this email.)
                >
                > The odd thing is that it is apparently intermittent. Sometimes, the
                > error happens and a 500 error page is returned. Other times, the page
                > loads as expected.
                >
                > Both servers (development and production) are running Debian Etch with
                > Apache 2.2.3, mod_perl 2.0.2, and Apache::ASP 2.59 (all stock versions
                > shipped with Debian Etch).
                >
                > The code that is generating the error is this:
                >
                > <%
                > my %img_data = get_image_data('masthead.png');
                > %>
                >
                > My DocumentRoot is /srv/http/www.example.com and I have a directory
                > called /srv/http/www.example.com/Example which has my Perl modules in
                > it. One of the modules is called Image.pm and it has a function called
                > get_image_data(). In my global.asa I have "use Example::Image;".
                >
                > Something that also does not make sense to me is that if I change the
                > document root to something like /srv/http/example or /srv/http/site,
                > then the error appears to never happen. I have tested this by using
                > both alternate document roots for about two weeks each and it appears to
                > not have a problem in either case.
                >
                > There are two very strange things about this whole situation. On the
                > (nearly) identically configured development server, I never get the
                > above error. I have another site (one that is actually in production,
                > as opposed to the example site) that uses a similar scheme on the same
                > production server and it does not have this problem.
                >
                > Regards,
                >
                > -Roberto
                >
                > --
                > Roberto C. Sánchez
                > http://people.connexer.com/~roberto
                > http://www.connexer.com
                >
                > -----BEGIN PGP SIGNATURE-----
                > Version: GnuPG v1.4.6 (GNU/Linux)
                >
                > iD8DBQFJGNlw5SXWIKfIlGQRAp2tAJ4hc3UfDt0LszN/6UTrRSErMtmnhACgv2j8
                > s4zfI5IlVrRykSFjU2X3gi0=
                > =O++Q
                > -----END PGP SIGNATURE-----
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.