8-bit characters and mod_perl/Apache-ASP
Im having an odd (and annoying) problem with text data being returned via Oracle::DBD (10.7) to an Apache::ASP (2.09) script. Essentially, perl that returns perfectly valid characters in both cgi and as a .pl file fails to return valid characters in the context of an Apache::ASP file. The issue, I think has to do with the fact that the Oracle database (8.0.6) is returning 8-bit characters. I can confirm this because I can repoint my application to a version of the database set with 7bit characters and everything works. While this shouldnt really be a problem (and isnt in the normal 'perl' setting), Apache::ASP/mod_perl seems to be barfing on these characters. Here's some sample code: use PNAP::Database::Query; ## a simplified database connection module use CGI qw/:standard/; ## for CGI output print header, start_html('A Simple Example'), ## make a database connection my $dbconn= new PNAP::Database::Query(Connection=NSPFinance, Debug=0); ## the sql statementA my $orgSQL = select o.FULLNAME; $orgSQL .= from ORGANIZATION o, PARTY_ROLE pr, PARTY_ROLE_TYPE prt; $orgSQL .= where o.ORGANIZATIONOID = pr.SubjectPartyOID and; $orgSQL .= pr.PartyRoleTypeOID = prt.PartyRoleTypeOID and prt.ShortName = 'NSP' and; $orgSQL .= pr.StartDate = sysdate and (pr.EndDate is null or pr.EndDate sysdate); $orgSQL .= order by FULLNAME; my $rs = $dbconn-query(Sql=$orgSQL, UseCursor=0); if ($rs) { while ($rs-next()) { my $fullname = $rs-FULLNAME; ## get the value from therecordset print Fullname: , $fullname,BR\n; ## output the value } $dbconn-finish($rs); } What is odd is that if I run this as a cgi (or from the command line), I get this output: Fullname: ATT Fullname: Agis Fullname: At Home Fullname: CW Fullname: CW/IDC Fullname: Digex Fullname: EBONE ... However, the exact same code run as an Apache::ASP page results in this output (on netscape for linux 4.76). Fullname: Fullname: Fullname: Fullname: Fullname: Fullname: ... On IE, however, I get this as output (viewed as source): Fullname: A T T Fullname: A g i s Fullname: A t H o m e Fullname: C W Fullname: C W / I D C Fullname: D i g e x Fullname: E B O N E ... This implies that the 8-bit characters are being rendered/dealt with *differently* for the cgi version and the Apache::ASP version (and that the Apache::ASP version honks up the 8-bit characters somehow). IE seems to deal with the odd characters better than netscape. In order to address this problem, Ive tried all the standard approaches to dealing with 8bit characters and Oracle databases (setting NLS_LANG, etc) and have tried using Convert::Translit module to do the conversion.. However, none of those actions seem to make any difference. I still get wonky output with the mod_perl/Apache::ASP version (but not the normal Perl/cgi version). What I am wondering is: (1) is there a known problem with mod_perl and 8-bit character sets? The version of apache I am running is 1.3.19 and mod perl 1.25, and Apache 2.09. (2) Is there any problem with this from the Apache::ASP side in either the way the Response-Write is done or the way in which these character sets are handled? Ive looked at the Response-Write and Response-WriteRef but dont see anything obvious that could cause this. (3) Has anyone seen this kind of behavior before? Any help would be appreciated (it will beat having to export and re-import the production database)... Carl Carl Lipo EMAIL: [EMAIL PROTECTED] IT Systems ArchitectPAGER: 206.570.2086 Internap Network Services OFFICE: 206.504.5442 601 Union Street, Suite 1000FAX: 206.654.5684 Seattle, WA 98101 CELL: 206.579.0163 Unauthorized use, disclosure, or distribution of information within this message is prohibited.
Re: Apache::ASP -- Corruption of statedir files/truncation of methodnames
The statedir is local so it doesnt seem to be an NFS issue. There definitely seems to be a corruption of the StateDir files: here is a error that crops up in our error log. [Thu Apr 5 08:09:07 2001] [notice] child pid 11555 exit signal Segmentation fault (11) Use of uninitialized value at /usr/lib/perl5/MLDBM.pm line 161 (#1) (W) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign an initial value to your variables. Unauthorized use, disclosure, or distribution of information within this message is prohibited. On Wed, 4 Apr 2001, Joshua Chamas wrote: Carl Lipo wrote: I've just started having problems with asp state files for Apache::ASP 2.09 becoming corrupted during use. My application will work just fine but at somepoint the session asp state files get corrupted and only deleting them allows the application to continue working. Oddly, this occurs on two different servers so the problem does not appear to be machine specific. The symptom of the problem is that application errors are returned from the asp code execution that look something like this: Uncaught exception from user code: Can't locate object method 'Quer' via package quot;Apache::ASP::Request'; at (eval 263) a href=#167l ine 167/a. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ ASP.pm line 1504 Generally problems of this nature, where even perl data seems to be corrupted, seem to be from buffer overrun type issues that normally result in segfaults. Looking at your config, I would suspect the culprit to be use of DB_File on your StateDir, where /usr/local/etc/infosource/apps/netcfg/state-dir may be mounted over NFS. NFS typically does not support the flock() style locking that Apache::ASP uses to protect DB_File from corruption. If you are must use NFS, don't use DB_File, use the default SDBM_File, which does not corrupt as easily. If you need to get past the 1000 byte limit, then you might use MLDBM::Sync::SDBM_File which I developed just for this purpose. I need to add config support for this still to Apache::ASP though. If you can switch to a CIFS/or samba mounted file system, do this, as this supports flock() semantics. If StateDir is mounted locally, then possibly there is a bug in Apache::ASP StateDB locking, but this is less likely the case and we might look at other types of buffer overrun issues that might corrupt perl data structures. If your modperl httpd is compiled DSO, compile it static, as I have seen no end of odd errors with the DSO config from time to time. Also, DBD::Oracle and long values with CLOBs/BLOBs can create another type of buffer overrun, which is supposedly on OCI bug, though you didn't mention use of Oracle this is an odd bug that stung me recently. If you give up on trying to find this bug, which seems to be related to StateDB corruption, you may create $Application $Session objects with Apache::Session in the global.asa Script_OnStart, which would at least eliminate the StateDB issue. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Apache::ASP -- Corruption of statedir files/truncation of methodnames
I've just started having problems with asp state files for Apache::ASP 2.09 becoming corrupted during use. My application will work just fine but at somepoint the session asp state files get corrupted and only deleting them allows the application to continue working. Oddly, this occurs on two different servers so the problem does not appear to be machine specific. The symptom of the problem is that application errors are returned from the asp code execution that look something like this: Uncaught exception from user code: Can't locate object method 'Quer' via package quot;Apache::ASP::Request'; at (eval 263) a href=#167l ine 167/a. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ ASP.pm line 1504 or $Response::Appe not defined at /usr/local/lib/site_perl/Apache/ASP.pm a href=#3132line 3132/a Where the object method that cant be located is truncated from the actual ASP method (i.e., Query will be truncated to be Quer or $Response::Append to log will be tructed at Response::Appe). What appears to be happnening is that the namespace is corrupted somehow and the Apache::ASP/mod_perl is not mapping the names of methods correctly. When we delete the state files, the problem goes away (and then returns at some point in the future). Has anyone encountered this problem? Is there a bug in the 2.09 code? This is our environment: Linux, Apache 1.3.19, mod_perl 1.25 Apache::ASP 2.09 Here is the actual error output: table trtd valign=topfont size=-1b Global: /btd valign=topfont size=-1 /usr/local/etc/infosource/apps/netcfg/ trtd valign=topfont size=-1b File: /btd valign=topfont size=-1 /usr/local/applprod/infosource/apps/netcfg/viewNodes.htm trtd valign=topfont size=-1b IP: /btd valign=topfont size=-1 64.94.117.16 trtd valign=topfont size=-1b HTTP_*: /btd valign=topfont size=-1 HTTP_ACCEPT= image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*br HTTP_ACCEPT_CHARSET= iso-8859-1,*,utf-8br HTTP_ACCEPT_ENCODING= gzipbr HTTP_ACCEPT_LANGUAGE= enbr HTTP_CONNECTION= Keep-Alivebr HTTP_COOKIE= session-id=0eef76d5377c6e62def6333423014869br HTTP_HOST= applprod4.sea.internap.combr HTTP_REFERER= https://applprod4.sea.internap.com/apps/netcfg/searchNode.htmbr HTTP_USER_AGENT= Mozilla/4.75 [en] (X11; U; Linux 2.2.16 i686) trtd valign=topfont size=-1b Query: /btd valign=topfont size=-1 trtd valign=topfont size=-1b Form: /btd valign=topfont size=-1 search= Search br searchLocation= br searchNodeName= br searchNodeStatus= br searchNodeType= br searchRack= br searchSiteCode= seabr sessionActive= Active /table tt buErrors Output/u/b ol li Uncaught exception from user code: Can't locate object method quot;Querquot; via package quot;Apache::ASP::Requestquot; at (eval 263) a href=#167line 167/a. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504 eval {...} called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504 Apache::ASP::Execute('Apache::ASP=HASH(0x8d7d930)') called at /usr/local/lib/site_perl/Apache/ASP.pm line 174 Apache::ASP::handler('Apache=SCALAR(0x8d2b978)') called at /dev/null line 0 eval {...} called at /dev/null line 0 , /usr/local/lib/site_perl/Apache/ASP.pm line 1506 /ol buDebug Output/u/b ol li Uncaught exception from user code: Can't locate object method quot;Querquot; via package quot;Apache::ASP::Requestquot; at (eval 263) line 167. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504 eval {...} called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504 Apache::ASP::Execute('Apache::ASP=HASH(0x8d7d930)') called at /usr/local/lib/site_perl/Apache/ASP.pm line 174 Apache::ASP::handler('Apache=SCALAR(0x8d2b978)') called at /dev/null line 0 eval {...} called at /dev/null line 0 , /usr/local/lib/site_perl/Apache/ASP.pm line 1506 /ol /tt pre buASP to Perl Script/u/ba name=1nbsp;/a a name=2 1/a: package INAP::NEIS; ;; sub INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL { ;; @_ = (); ;; no strict;;use vars qw($Application $Session $Response $Server $Request);;use lib qw(/usr/local/etc/infosource/apps/netcfg/);;; a name=3 2/a: a name=4 3/a: $Response-gt;AppendToLog(quot;[NEIS] - init.htm:quot;); a name=5 4/a: a name=6 5/a: a name=7 6/a: ### a name=8 7/a: # a name=9 8/a: #init.htm a name=10 9/a: # a name=11 10/a: # Dexter and Wayland a name=12 11/a: # a name=13 12/a: # October 2000 a name=14 13/a: # a name=15 14/a: # 10/12/00 Wayland Wasserman a name=16 15/a: # Common header file for entire NCM app a name=17 16/a: # Contains database
Re: Apache::ASP -- Corruption of statedir files/truncation of methodnames
In addition: here are the httpd.conf configurations for this application: FilesMatch "\.(htm|asp)$" PerlSetVar Global /usr/local/etc/infosource/apps/netcfg/ # PerlSetVar Global . PerlSetVar GlobalPackage INAP::NEIS PerlSetVar StateDir /usr/local/etc/infosource/apps/netcfg/state-dir PerlSetVar CookiePath /apps/netcfg SetHandler perl-script PerlHandler Apache::ASP Apache::SSI PerlSetVar SessionTimeout 90 #0 production, 2 or 1 for dev PerlSetVar Debug 0 PerlSetVar StatINCMatch PNAP|NCM # PerlSetVar StatINC 1 #0 production, text compression # PerlSetVar DynamicIncludes 0 PerlSetVar Clean 0 PerlSetVar StateDB DB_File PerlSetVar AllowSessionState 1 PerlSetVar DebugBufferLength 500 PerlSetVar StateCache 0 # PerlSetVar UseStrict 1 PerlSetVar TimeHiRes 1 /FilesMatch On Wed, 4 Apr 2001, Carl Lipo wrote: I've just started having problems with asp state files for Apache::ASP 2.09 becoming corrupted during use. My application will work just fine but at somepoint the session asp state files get corrupted and only deleting them allows the application to continue working. Oddly, this occurs on two different servers so the problem does not appear to be machine specific. The symptom of the problem is that application errors are returned from the asp code execution that look something like this: Uncaught exception from user code: Can't locate object method 'Quer' via package quot;Apache::ASP::Request'; at (eval 263) a href=#167l ine 167/a. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ ASP.pm line 1504 or $Response::Appe not defined at /usr/local/lib/site_perl/Apache/ASP.pm a href=#3132line 3132/a Where the object method that cant be located is truncated from the actual ASP method (i.e., Query will be truncated to be Quer or $Response::Append to log will be tructed at Response::Appe). What appears to be happnening is that the namespace is corrupted somehow and the Apache::ASP/mod_perl is not mapping the names of methods correctly. When we delete the state files, the problem goes away (and then returns at some point in the future). Has anyone encountered this problem? Is there a bug in the 2.09 code? This is our environment: Linux, Apache 1.3.19, mod_perl 1.25 Apache::ASP 2.09 Here is the actual error output: table trtd valign=topfont size=-1b Global: /btd valign=topfont size=-1 /usr/local/etc/infosource/apps/netcfg/ trtd valign=topfont size=-1b File: /btd valign=topfont size=-1 /usr/local/applprod/infosource/apps/netcfg/viewNodes.htm trtd valign=topfont size=-1b IP: /btd valign=topfont size=-1 64.94.117.16 trtd valign=topfont size=-1b HTTP_*: /btd valign=topfont size=-1 HTTP_ACCEPT= image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*br HTTP_ACCEPT_CHARSET= iso-8859-1,*,utf-8br HTTP_ACCEPT_ENCODING= gzipbr HTTP_ACCEPT_LANGUAGE= enbr HTTP_CONNECTION= Keep-Alivebr HTTP_COOKIE= session-id=0eef76d5377c6e62def6333423014869br HTTP_HOST= applprod4.sea.internap.combr HTTP_REFERER= https://applprod4.sea.internap.com/apps/netcfg/searchNode.htmbr HTTP_USER_AGENT= Mozilla/4.75 [en] (X11; U; Linux 2.2.16 i686) trtd valign=topfont size=-1b Query: /btd valign=topfont size=-1 trtd valign=topfont size=-1b Form: /btd valign=topfont size=-1 search= Search br searchLocation= br searchNodeName= br searchNodeStatus= br searchNodeType= br searchRack= br searchSiteCode= seabr sessionActive= Active /table tt buErrors Output/u/b ol li Uncaught exception from user code: Can't locate object method quot;Querquot; via package quot;Apache::ASP::Requestquot; at (eval 263) a href=#167line 167/a. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504 eval {...} called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504 Apache::ASP::Execute('Apache::ASP=HASH(0x8d7d930)') called at /usr/local/lib/site_perl/Apache/ASP.pm line 174 Apache::ASP::handler('Apache=SCALAR(0x8d2b978)') called at /dev/null line 0 eval {...} called at /dev/null line 0 , /usr/local/lib/site_perl/Apache/ASP.pm line 1506 /ol buDebug Output/u/b ol li Uncaught exception from user code: Can't locate object method quot;Querquot; via package quot;Apache::ASP::Requestquot; at (eval 263) line 167. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ASP.pm line 1504 eval {...} called at /usr/local/lib
[ANNOUNCE] HTTP::WebTest 0.01 released to CPAN
HTTP::WebTest (by Richard Anderson) was released to CPAN today and is available for download. It is a module for creating automated unit tests for Apache::ASP pages (and other). Here is the announcement posted to comp.lang.perl.announce and comp.lang.perl.modules: NAME HTTP::WebTest - Test remote URLs or local web files DESCRIPTION This module runs tests on remote URLs or local web files containing Perl/HTML/JavaScript/etc. and generates a detailed test report. The test specifications can be read from a parameter file or input as method arguments. If you are testing a local file, Apache is started on a private/dynamic port with a configuration file in a temporary directory. The module displays the test results on the terminal by default or directs them to a file. The module will also optionally e-mails the test results. When the calling program exits, the module stops the local instance of Apache and deletes the temporary directory. Each test consists of literal strings or regular expressions that are either required to exist or forbidden to exist in the fetched ~page. You can also specify tests for the minimum and maximum number of bytes in the returned page. If you are testing a local file, the module checks the error log in the temporary directory before and after the file is fetched from Apache. If messages are written to the error log during the fetch, the module flags this as an error and writes the messages to the output test report. SYNOPSIS This module can accept input parameters from a parameter file or subroutine arguments. TO RUN WEB TESTS DEFINED BY SUBROUTINE ARGUMENTS: use HTTP::WebTest; run_web_test(\@web_tests, \$num_fail, \$num_succeed, \%test_options) or use HTTP::WebTest; run_web_test(\@web_tests, \$num_fail, \$num_succeed) TO RUN WEB TESTS DEFINED BY A PARAMETER FILE: use sigtrap qw(die normal-signals); # Recommended, not necessary use HTTP::WebTest; $webtest = HTTP::WebTest-new(); $webtest-web_test('my_web_tests.wt', \$num_fail, \$num_succeed); The web_test() method has an option to test a local file by starting Apache on a private port, copying the file to a temporary htdocs directory and fetching the page from Apache. If you are testing with multiple parameter files, you can avoid restarting Apache each time by calling new() only once and recycling the object: use sigtrap qw(die normal-signals); # Recommended, not necessary use HTTP::WebTest; $webtest = HTTP::WebTest-new(); foreach $file (@ARGV) { $webtest-web_test($file, \$num_fail, \$num_succeed); } TO ENABLE DEBUGGING MESSAGES (OUTPUT TO STDOUT): If you are calling the web_test method, use the debug parameter. If you are calling the run_web_test method, do this: use HTTP::WebTest; $HTTP::WebTest::Debug = 1; # Diagnostic messages $HTTP::WebTest::Debug = 2; # Messages and preserve temp Apache dir run_web_test(\@web_tests, \$num_fail, \$num_succeed) RESTRICTIONS / BUGS This module only works on Unix (e.g., Solaris, Linux, AIX, etc.). The module's HTTP requests time out after 3 minutes (the default value for LWP::UserAgent). If the file_path parameter is specified, Apache must be installed. If the file_path parameter is specified, the directory /tmp cannot be NFS-mounted, since Apache's lockfile and the SSL mutex file must be stored on a local disk. VERSION This document describes version 0.01, release date 13 January 2001. TODO Add option to validate HTML syntax using HTML::Validator. Add option to check links (see http://world.std.com/~swmcd/steven/perl/pm/lc/linkcheck.html). AUTHOR Richard Anderson [EMAIL PROTECTED] COPYRIGHT Copyright (c) 2000 Richard Anderson. All rights reserved. This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License. [EMAIL PROTECTED] RayCosoft, LLC Perl/Java/Oracle/Unix software engineeringwww.unixscripts.com www.zipcon.net/~starfire/home Seattle, WA, USA
Apache::ASP question: undefined subroutines
Does anyone know what causes these kinds of errors? The 'subroutine' that the output is referring to is the name of the page (in this case search.htm) that is being loaded and that sits in the content directory -- there are no real missing subroutines...Maddeningly, if I hit reload enough times the page will finally load at some point and then error a few reloads later. The page (search.htm) sits on an NFS mount (could that be a problem?). Errors Output 1.Undefined subroutine InterNAP::NFT::_home_staff_carl_htdocs_apps_nft_search_htmxINL called at /usr/local/lib/site_perl/Apache/ASP.pm line 1395. , /usr/local/lib/site_perl/Apache/ASP.pm line 1397 Debug Output 1.Undefined subroutine InterNAP::NFT::_home_staff_carl_htdocs_apps_nft_search_htmxINL called at /usr/local/lib/site_perl/Apache/ASP.pm line 1395. , /usr/local/lib/site_perl/Apache/ASP.pm line 1397 Here is the ASP Cconfiguration information for the app: Directory /office/common/infosource/apps/nft FilesMatch "\.(htm|asp)$" SetHandler perl-script PerlHandler Apache::ASP Apache::SSI PerlSetVar Filter On PerlSetVar IncludesDir . PerlSetVar StateDB DB_File PerlSetVar CookiePath /apps/nft PerlSetVar Global . PerlSetVar StateDir /tmp/.state-asp/nft PerlSetVar GlobalPackage InterNAP::NFT PerlSetVar AllowSessionState 1 PerlSetVar SessionTimeout 60 PerlSetVar Debug 2 PerlSetVar MailHost mailhost-stu.sea.internap.com PerlSetVar MailErrorsTo [EMAIL PROTECTED] PerlSetVar CONFIG_FILE /usr/local/etc/nft/nft.xml /FilesMatch /Directory Any ideas would be greatly appreciated -- its so intermittent, its driving us crazy! ---- Carl Lipo EMAIL: [EMAIL PROTECTED] IT Systems ArchitectPAGER: 888.393.5620 InterNAP Network Services OFFICE: 206.504.5442 601 Union Street, Suite 1000FAX: 206.264.1833 Seattle, WA 98101 CELL: 206.579.0163 Unauthorized use, disclosure or distribution of information within this message is prohibited.
Re: Apache::ASP and clock times
We are not sure why but it appears that the time problem may end up being specific to a DSO enabled, debian distribution of apache. When we recompiled a static version, the time that the ASP processes reported remained the same as the system clock (no changes from PDT to GMT). It looks like this is a bad-compilation problem or an effect of DSO. On Fri, 7 Jul 2000, Vivek Khera wrote: "JC" == Joshua Chamas [EMAIL PROTECTED] writes: JC It may be possible that the time calculation is based JC on some TZ* environment variable that is not consistent, It has been my experience that the first time any of the system date/time routines are called and TZ is set, that becomes the permanent time zone until the process goes away. So it could be something totally other than ASP setting the time zone for the process.
Apache::ASP and clock times
Carl Lipo EMAIL: [EMAIL PROTECTED] IT Systems ArchitectPAGER: 888.393.5620 InterNAP Network Services OFFICE: 206.504.5442 601 Union Street, Suite 1000FAX: 206.264.1833 Seattle, WA 98101 CELL: 206.579.0163 Unauthorized use, disclosure or distribution of information within this message is prohibited.
Re: Apache::ASP and clock times
That the error_log date itself is changing seems to me that Apache also thinks its the wrong time. If this were consistent, I would think that your box just has the wrong timezone set, but that this is inconsistent is bizarre. Yes, this is the problem. If it was just a matter of being one time or the other, we could deal. But since its inconsistent -- its a serious problem. It may be possible that the time calculation is based on some TZ* environment variable that is not consistent, perhaps being set by some scripts something? Still bizarre but seems plausible to me. I would log the data from %ENV in Script_OnStart , and see how it differs between these time changes. Thats what we thought. However, if we print out the TZ variable in the Script_OnStart it consistently comes out PDT regardless of the time that the server reports. Argh. Anyone else have any ideas here ? Looking at your Apache::ASP settings I would recommend that you set StateDir to some /tmp or /var area, instead of the default in Global/.state for better housekeeping. Global is really good for includes, global.asa, and perl modules, and I would keep the state files out of there which are dynamic bits. Good point. We need to clean that up. --Joshua Carl Lipo wrote: We are having a problem with our Apache::ASP scripts and the clock time they are reporting. It seems that when an ASP script is run, the internal clock is sometimes set to GMT. An example from our error log is shown below. The problem is that our scripts expect localtime (PDT). The other odd (and particularly frustrating) thing is that this problem is *not* consistent. Sometimes we get GMT while other times we get localtime (PDT). Its very odd. We have narrowed the problem down to mod_perl and/or Apache::ASP. Has anyone seen this behavior before? Is there a configuration problem? The problem seems to start with the ScriptOnStart (not before that...) -- and lasts until the end of the ASP processing. This is PDT, the correct local time [Wed Jul 5 16:10:56 2000] [error] [asp] [29715] [debug] ASP object created - Application: Apache::ASP::Application=HASH(0x83532a8); GlobalASA: Apache::ASP::GlobalASA=HASH(0x81df93c); Internal: Apache::ASP::State=HASH(0x81eab5c); Request: Apache::ASP::Request=HASH(0x87ed180); Response: Apache::ASP::Response=HASH(0x87ed198); Server: Apache::ASP::Server=HASH(0x848891c); Session: Apache::ASP::Session=HASH(0x81e97a8); app_state: 1; basename: index.htm; buffering_on: 1; cgi_headers: 0; clean: 0; compile_includes: 0; cookie_path: /; dbg: 2; debugs_output: ARRAY(0x81a6990); errs: 0; filehandle: GLOB(0x8353284); filename: /office/common/infosource-wally/index.htm; filter: 1; global: /etc/apache/state-asp; global_package: ; group_refresh: 120; id: _office_common_infosource_wally_index_htmxINL; includes_dir: .; init_packages: ARRAY(0x8488964); mail_alert_to: ; mail_errors_to: [EMAIL PROTECTED]; mtime: 962475992; no_cache: ; no_session: ; no_state: ; package: Apache::ASP::Compiles::_etc_apache_state_asp_global_asa; paranoid_session: 0; pod_comments: 1; r! : Apache=SCALAR(0x81e9610); remote_ip: 216.223.5.149; secure_session: ; session_serialize: ; session_timeout: 1200; stat_inc: ; stat_inc_match: ; state_cache: ; state_db: DB_File; state_dir: /etc/apache/state-asp/.state; state_manager: 10; ua: Mozilla/4.72 [en] (X11; U; Linux 2.2.13 i686); unique_packages: 0; [Wed Jul 5 16:10:56 2000] [error] [asp] [29715] [debug] inlining include home-go.include [Wed Jul 5 16:10:56 2000] [error] [asp] [29715] [debug] inlining include links/internap.links [Wed Jul 5 16:10:56 2000] [error] [asp] [29715] [debug] active undefing sub Apache::ASP::Compiles::_etc_apache_state_asp_global_asa::_office_common_infosource_wally_index_htmxINL code CODE(0x87ef78c) before compiling [Wed Jul 5 16:10:56 2000] [error] [asp] [29715] [debug] compiling into package Apache::ASP::Compiles::_etc_apache_state_asp_global_asa subid Apache::ASP::Compiles::_etc_apache_state_asp_global_asa::_office_common_infosource_wally_index_htmxINL -- note here is the Script_OnStart. Notice how the time changes! [Wed Jul 5 23:10:56 2000] [error] [asp] [29715] [debug] Script_OnStart [Wed Jul 5 23:10:56 2000] [error] [asp] [29715] [debug] executing Script_OnStart [Wed Jul 5 23:10:56 2000] [error] [asp] [29715] Time is now (localtime(time()): [Wed Jul 5 23:10:56 2000] [error] [asp] [29715] 56 10 23 5 6 100 3 186 printing localtime(time()) [above] shows that perl really thinks it is this later [GMT time] [Wed Jul 5 23:10:56 2000] [error] [asp] [29715] [debug] executing _office_common_infosource_wally_index_htmxINL [Wed Jul 5 23:10:58 2000] [error] [asp] [29715] INDEX.HTM* [Wed Jul 5 23:10:58 2000] [error] [asp] [29715] * INDEX USER: carl* [Wed Jul 5 23:10:59 2000] [error] [asp] [29715] [debug] active undefing
ASP.pm and Date::Manip/DBD::Sybase
I am having recurring troubles using the Date::Manip and DBD::Sybase modules in the contest of mod_perl/ASP pages. 75%-90% of the time my ASP pages will work just fine. The reminder 25-10% I get these kinds of errors: [Fri Dec 17 12:27:51 1999] [error] [asp] [7922] [error] ERROR: Date::Manip unable to determine TimeZone. -- Date::Manip::Date_TimeZone called at /usr/lib/perl5/site_perl/Date/Manip.pm line 608 -- Date::Manip::Date_Init() called at /usr/lib/perl5/site_perl/Date/Manip.pm line 1295 -- Date::Manip::ParseDate('today') called at (eval 49) line 103 -- or The context allocation routine failed when it tried to load localization files!! One or more following problems may caused the failure Cannot access the sybase home directory, please check environment variable SYBASE or ~sybase [Fri Dec 17 15:51:57 1999] [error] [asp] [16617] [error] install_driver(Sybase) failed: DBD::Sybase initialize: cs_ctx_alloc() failed at/usr/lib/perl5/i586-linux/5.00404/DynaLoader.pm line 185. -- at /usr/lib/perl5/site_perl/PNAP/Database/Query.pm line 276 -- (in cleanup) Can't call method "disconnect" without a package or object reference at /usr/lib/perl5/site_perl/PNAP/Database/Query.pm line 294. -- , /usr/lib/perl5/site_perl/Apache/ASP.pm line 1102 The odd thing is that at some times the problems are worse than others. I havent been able to correlate this behavior with memory or cpu usage. I tried everything I can think of to stop this problem: I have tried using a PerlRequire entry in the httpd.conf to include the modules when the server starts up. I have added the two ENV variables to the httpd.con as PerlSetVar and PerlPassEnv entries. I explicitely use BEGIN statements in the ASP code and set the ENV variables. However, nothing so far has worked -- at some frequency at least *some* of the children cannot get the TZ or the SYBASE environmental variable. Its driving me nuts! In the archives, I saw that at least one or two people in the past noted this problem but I never saw how it was resolved. Is there something I'm missing in the mod_perl configuration? Something I need to do? Any advice? The server is Intel Linux 2.0.35 Server version: Apache/1.3.9 (Unix) Perl 5.00503 mod_perl Version 1.20 ASP version 0.16 (but also has same behavior with 0.17) ---- Carl Lipo EMAIL: [EMAIL PROTECTED] IT Systems ArchitectPAGER: 888.393.5620 InterNAP Network Services OFFICE: 206.504.5442 601 Union Street, Suite 1000FAX: 206.264.1833 Seattle, WA 98101 CELL: 206.579.0163