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
[Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] RUN ASP (v2.59) for /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] GlobalASA package Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] global.asa was not cached for __ASP__srv_http_www_e_ample_com__xxApache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] compiling global.asa Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x __ASP__srv_http_www_e_ample_com__xxApache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x exists 1 - asp: Apache::ASP=HASH(0x1077ff0); compiled: HASH(0x15e47e0); exists: 1; package: Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x; - --- - exists: 0; mtime: 0; [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] global.asa routines - Script_OnEnd: 1; Script_OnStart: 1; [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] parse file /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] parsing /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] found templates/doctype.tmpl at /srv/http/www.example.com/templates/doctype.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] inlining include /srv/http/www.example.com/templates/doctype.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] include /srv/http/www.example.com/templates/doctype.tmpl found for file /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] found templates/html_header.tmpl at /srv/http/www.example.com/templates/html_header.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] inlining include /srv/http/www.example.com/templates/html_header.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] include /srv/http/www.example.com/templates/html_header.tmpl found for file /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] found templates/masthead.tmpl at /srv/http/www.example.com/templates/masthead.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] inlining include /srv/http/www.example.com/templates/masthead.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] include /srv/http/www.example.com/templates/masthead.tmpl found for file /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] found templates/sidebar.tmpl at /srv/http/www.example.com/templates/sidebar.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] inlining include /srv/http/www.example.com/templates/sidebar.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] include /srv/http/www.example.com/templates/sidebar.tmpl found for file /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] found templates/footer.tmpl at /srv/http/www.example.com/templates/footer.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] inlining include /srv/http/www.example.com/templates/footer.tmpl[Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] include /srv/http/www.example.com/templates/footer.tmpl found for file /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] found templates/aux.tmpl at /srv/http/www.example.com/templates/aux.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] inlining include /srv/http/www.example.com/templates/aux.tmpl [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] include /srv/http/www.example.com/templates/aux.tmpl found for file /srv/http/www.example.com/index [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] undefing sub Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::__ASP__srv_http_www_e_ample_com_inde_xbcdd9467edb6eb088cd27c741dd99ef3xINC code CODE(0x18a2490) [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] compiling into package Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x subid [Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::__ASP__srv_http_www_e_ample_com_inde_xbcdd9467edb6eb088cd27c741dd99ef3xINC] [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] Script_OnStart [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] executing Script_OnStart [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] executing Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::__ASP__srv_http_www_e_ample_com_inde_xbcdd9467edb6eb088cd27c741dd99ef3xINC [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 [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] ASP Done Processing Apache::ASP=HASH(0x1077ff0) - GlobalASA: Apache::ASP::GlobalASA=HASH(0x17ca4f0); Request: Apache::ASP::Request=HASH(0x14f03c0); Response: Apache::ASP::Response=HASH(0x18afd90); Server: Apache::ASP::Server=HASH(0x1079900); basename: index; cleanup: ARRAY(0x14f03d0); compile_checksum: bcdd9467edb6eb088cd27c741dd99ef3; compile_includes: ; compile_perl_count: 1; dbg: 1; debugs_output: ARRAY(0x107a270); destroy: 1; dir_config: APR::Table=HASH(0x11da6f0); dirname: /srv/http/www.example.com/; errors_output: ARRAY(0x18a9dc0); errs: 1; filename: /srv/http/www.example.com/index; global: /srv/http/www.example.com//.; global_package: ; headers_in: APR::Table=HASH(0x107a850); includes_dir: ARRAY(0x154dd90); init_packages: ARRAY(0x17ca2e0); inode_names: ; lang_comment: #; lang_language: PerlScript; lang_module: Apache::ASP::Lang::PerlScript; lang_object: Apache::ASP::Lang::PerlScript=HASH(0x107a4f0); no_cache: ; package: Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x; parse_config: 1; parse_file_count: 1; parse_inline_count: 6; pod_comments: 1; r: Apache2::RequestRec=SCALAR(0x14e1c00); request_binary_read: 1; response_tied: 1; run_perl_script: SCALAR(0x1892e10); search_dirs_cache: HASH(0x18a2760); start_time: 1226364299.49139; stat_inc: ; stat_inc_match: ; stat_scripts: 1; state_dir: /srv/http/www.example.com//./.state; use_strict: 1; win32: 0; xml_subs_match: ; xml_subs_perl_args: 1; xml_subs_strict: ; xslt: ; [Mon Nov 10 19:44:59 2008] [error] [asp] [7796] [debug] destroying ASP object Apache::ASP=HASH(0x1077ff0)
signature.asc
Description: Digital signature