Re: Document Contains no data

2000-12-31 Thread Stephen A. Cochran

--- Stas Bekman wrote:
On 17 Nov 2000, Stephen A. Cochran wrote:
 
 I have a program which runs fine 90% of the time under mod_perl. About 10% of
 the time Netscape reports "Document contains no data". Looking at the socket
 traffic, the client receives an orderly release indication (T_ORDEL_IND = 132)
 on the socket and reponds with a orderly release request, which closes the
 socket. 


run it in single mode and attach to the process with strace(1) or truss(1)
(depending on what you have). See the debug chapter in the mod_perl guide.
--- end of quote ---

Thanks for the suggestions from the list for this problem. The strace/truss
probably would have helped solve the problem, too bad Digital Unix doesn't have
either : (

After two months I finally tracked it down. Turns out that in an infrequently
called sub to handle minor error conditions, there was a line "close STDERR".
The comment from the author said it was to "kill any ugly errors that havne't
made it out yet ...". Not really sure what he really wanted to do originally,
but that was the problem.

Anytime a process which had executed this code under mod_perl received another
mod_perl request, the browser displayed the "Document contains no data" error
due to the sequence of requests as described above in my original post. I just
confirmed this with a short script which only does "close STDERR".

Thought I'd post this in case someone else ever runs into this, or it's a bug.
Not sure of closing STDERR is a common practice in CGIs, but maybe a gotcha for
the porting guide. 

Steve Cochran



Re: RFC: mod_perl advocacy project resurrection

2000-12-06 Thread Stephen A. Cochran


I've been following along with this thread with interest, expecially since I'm
new to the mod_perl list and community (thanks for all the help so far!). I
thought you might be interesed in a 'mod_perl newbie' opinion.

Recently I was handed an online event calendar running under CGI and asked to
get it to run under mod_perl to speed it up. I'm comfortable with perl, but by
no means a guru. And this was the first time using mod_perl. In the past I've
used several products which might be considered competitors to mod_perl: Web
Objects and Cold Fusion. CF was horrible, I'm glad I didn't have to work with it
for long. WO was very nice to work with, and it had all the ecommerce and
transation logic needed to build a enterprise web application quickly. (None of
my work has been in ecommerce, instead in the medical industry (patient data,
lab results, etc) which has many of the same requirements). 


Installing: 
I've installed mod_perl twice in the last month. The first time was on Solaris
and was quite painless. The second time was on RH 7.0, and was fairly painful.
Took most of a day of futzing around to finally get it installed and working. I
ran into two problems, first the unrecognized version of apache 1.3.14, and
second when I had downgraded to 1.3.12 the new auto-configure part of apache was
bypassing the standard Configuration file which mod_perl had inserted itself
into, so Apache was building itself without mod_perl.

As several others have said here, there is work which could be done in this
area. My suggestions would be:
- easier install in general (big red button approach is always nice)
- make it easier (clear instructions too) on how to configure apache with
mod_perl and other modules. The current 'big red button' only works if you have
no other modules or already have them configured.
- Instructions written for someone who knows nothing about mod_perl, and
possible very little about unix. This is a general problem for all open source
projects. With today's IT shortage, more and more sys admins are just power
users who were promoted or sucked into duties because someone else left. If you
want to catch their eye, make sure you talk at their level. I realize this can
be a pain in you know where, and it's something that as you look to advocate you
need to think about. "Do we want to target everyone, or should there be a
minimum level or aptitude before we recommend someone installs this?" Anyone can
walk into Staples these days and install Linux. If they have a decent
distribution installing everything is easy. But even without a package manager
like RH, apache is usually very painless to install. I know a number of
non-profits who just have competent users maintaining a Linux server with
apache, because for the most part it's trouble free. At worst they might have to
restart the server.


Technical Issues:
The second problem I see with mod_perl is a technical one. Because of the design
of mod_perl, debugging problems can be fairly involved. Is the problem my code?
Or is it apache, or maybe mod_perl? Could even be perl for that matter. Take for
example the problem I ran into recently. (Please don't take this as a rant just
because I had problems, I'm happy with mod_perl. But I'm fairly capable around
unix and compiling, instead imagine this happening to someone who wasn't that
comfortable.)

The event calendar works great under CGI, so I try it under mod_perl. It was
written to work under mod_perl by a better perl programmer that I'll ever be
(Jon Howell of Faq-o-matic fame) and is very well designed. It even worked under
mod_perl with some minor changes like supplying the user/pass to the database
since it wasn't running under cgiwrap any longer. And it worked! But only 90% of
the time.

The other 10% of the time, the client received no data, and the page generated
by the script ended up in the apache log. After cleaning up one implicit
database handle destruction warning the problem persisted, and I began to
attempt to discover where the connection was being closed. So I did what any
lazy programmer does, I added some print statements to send a note to STDERR.
While these all showed up when the program worked correctly, when problem
occured, the prints to STDERR dissapeared. But the html page was printed to the
apache log, basicly standard error. So it looks like if the socket is closed,
stderr dissapears, and stdout goes to the error log. So no pointers appeared in
the log, which wasn't very helpful.

Next attempt was to do some packet sniffing to see why the socket was closeing.
Turns out that the web server sends an orderly release indication (T_ORDEL_IND =
132), so the client being a good citizen reponds with a orderly release request
and there goes the socket.

While my description of the problem was more in-depth that I meant it to be, my
point is that now I'm left with the need to trace through system calls made by
apache, mod_perl and my program to try and find 

[OFF] strace

2000-11-27 Thread Stephen A. Cochran


I'm trying to debug an intermittant problem on a Dec Unix server, and have
gotten to the point where I need to use strace. 

On Dec Unix, strace wants a module ID, not a process ID. Anyone here familiar
with Dec Unix?

Steve Cochran

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Document Contains no data

2000-11-17 Thread Stephen A. Cochran


I have a program which runs fine 90% of the time under mod_perl. About 10% of
the time Netscape reports "Document contains no data". Looking at the socket
traffic, the client receives an orderly release indication (T_ORDEL_IND = 132)
on the socket and reponds with a orderly release request, which closes the
socket. 

I've added some printing calls to determine how far it's getting in the script,
even one on the first line. When it fails there are no warnings, none of the
STDERR output shows up in the error log, and the html is still generated and
output to the error_log. 

It seems like once the socket it closed, the script continues, but output to
STDERR dissapears and STDOUT goes to the error log. Any ideas why the server is
sending the orderly release indication or any ways to trace it? I've run the
server in single process mode, but it still doesn't give any errors or warnings.

I've tried on two different machines, both DECs, one running Perl 5.00404,
Apache/1.3.12, mod_perl/1.24, the other running perl 5.00404, Apache/1.3.6,
mod_perl/1.20.

Steve Cochran

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Page contains no data error

2000-11-01 Thread Stephen A. Cochran


I'm moving someone else's CGIs to run under mod_perl, and about 95% of the time
they work. 

The other 5% of the time Netscape gets a "Document contains no data." error and
the web page that should have been sent to the brower is written into the apache
error log. No other error is given in the error log. 

This is running on Apache 1.3.12, perl 5.004_04, and mod_perl 1.24.

I'm beginning to suspect that mod_perl and perl arn't playing well together,
since mod_perl and apache were just upgraded. After a server process gives the
error, all mod_perl requests (such as perl-status) that hit that process will
get the same error.

Any ideas what it might be or a better way to track it down?

Steve Cochran



@INC and use

2000-10-20 Thread Stephen A. Cochran


I've been porting a CGI to mod_perl, and had it working. Then last night
mod_perl and apache were upgraded and recompiled and it stopped working. 

The script parses the URL for a command name (ex: ?cmd=search) and then hands
off the job to a different module (ex: search.pm). 

The path for this module is loaded as a library with the use command at the
beginning of the module which dispatches all the different commands (use lib
'/data/public/myapp/dev/lib';). The dispatcher parses the module name at during
execution, not at compile time. 

From the mod_perl guide:
(http://perl.apache.org/guide/porting.html#Reloading_Modules_and_Required_F), it
looks as if the use statment is only effective during compile time, and the @INC
is reset to normal, which wouldn't include this path. Am I understanding this
correctly? And if I am understanding this correctly, I'm curious why it was
working in the first place.

Steve Cochran
Dartmouth College