fpCGI failure

Nancy Palmquist nlp at vss3.com
Thu Mar 13 14:40:29 PDT 2008


Matt Cordes wrote:
>> What about stdout?  I believe fpsupport already asked you about that,
>> but I don't know if you sent them that info or not.
> 
> Let me give a rundown of the testing:
> 
> We have an fP process for handling web orders, it is an involved process with plenty of looping, lookups, record handling, etc.  I took some sample form submissions from our live server (meaning the text files created for FPCGI listing key/value pairs from the form), and cleaned out sensitive customer data like CC# and email address (so nobody gets billed or emailed accidentally on our test server).  Using a couple of these, I set up a script to submit each form--over and over--every few seconds.  They were timed asynchronously, so that the server would sometimes get hit with several form submissions at once, and would have to handle lookups, create records and other nontrivial filepro stuff under the hood.  
> 
> The server was getting hit with about 1500 form submission an hour (though there were only 5 flavors of the form being submitted ad naseum).  It was going fine for about 2 hours when I noticed the page responses were coming up 404.  I stopped the scripts and quickly found that the response html files were no longer being created (in /apache where the form submission text files also sit). 
> 
> Checking the files, it had suddenly stopped creating responses.  I can provide a log file of a successful form submission and unsuccessful one, both a few minutes from each other where the time changed.  I would need to go through both files and clear our ALL customer information before posting it to a message board, but looking through it myself, the only difference I could make was the following:
> 

Is this 5.6 and if it is, did someone tell you how to check to see if the 
licensing was exceeded?  I have 5.6 but have not used it enough to remember how 
to handle the tools.


I had issues like this with filePro.  It would exit with a Seg Violation.  The 
Return code 0 tells you nothing.  These errors were buggers to find.  I added 
log entries to my processing using LOGTEXT so I could narrow down to where the 
crash was happening.

I can honestly say that it could be hundreds of things but here is my check this 
list:

1) make sure you are not using a Declared Variable that matches a Field Heading.
2) make sure you lock and write all records that you change.
3) make sure all variables are defined correctly.
4) check your labels and make sure they do not match declared variables, array 
names, commands, or aliases.

I fussed with stuff for months until I finally found it.  I think the 
suggestions about writing stdout and errout to files helped.  Also running it 
outside of fpcgi, in a test mode, pointed out a few issues.

My tables use many calls, Open(), import/export, all those things, and when 
tables are layered like that it is easy to tromp on something.

Once I got it fixed, it has run flawlessly for months.  I know it can work, the 
error was mine.  It would have been nice if filePro could have helped with 
better syntax checking or something but the responsibility is all mine.

I works exactly as you indicated, when it is broken.  You set variables to tell 
filePro to continue after x seconds, so it just fails and fpcgi returns nothing 
since filePro made nothing.  fpCGI is very happy, you are not back at the web 
page since nothing is there.

I certainly feel your pain.

Nancy

> WORKING submission:
> ----------------
> 2008-03-06 14:08:29 INFO   PID(00006006) SUCCESSFUL return from command designated in Field_cmd
> 2008-03-06 14:08:29 INFO   PID(00006006) Command string is /appl/fp/rreport ajax -fp cWebInvoice -sr 34 -n -u -y automaticCGI -rw /usr/local/apache/htdocs/rweb1fe
> 2008-03-06 14:08:29 INFO   PID(00006006) Return code from command is 0. Errno is 0
> 2008-03-06 14:08:29 INFO   PID(00006006) Command as returned by cgival(Field_cmd1) is L
> <snip>
> 2008-03-06 14:08:29 DEBUG  PID(00006006) fpcgi.c 001553 Checking to see if [/usr/local/apache/htdocs/rweb1fe.htm] exists
> 2008-03-06 14:08:29 DEBUG  PID(00006006) fpcgi.c 001567 Yes. It exists.
> ----------------
> 
> versus...
> 
> BROKEN submission:
> ----------------
> 2008-03-06 14:22:26 INFO   PID(00008186) SUCCESSFUL return from command designated in Field_cmd
> 2008-03-06 14:22:26 INFO   PID(00008186) Command string is /appl/fp/rreport ajax -fp cWebInvoice -sr 34 -n -u -y automaticCGI -rw /usr/local/apache/htdocs/rweb2a2
> 2008-03-06 14:22:26 INFO   PID(00008186) Return code from command is 0. Errno is 0
> 2008-03-06 14:22:26 INFO   PID(00008186) Command as returned by cgival(Field_cmd1) is L 
> <snip>
> 2008-03-06 14:22:26 DEBUG  PID(00008186) fpcgi.c 001553 Checking to see if [/usr/local/apache/htdocs/rweb2a2.htm] exists
> 2008-03-06 14:22:26 DEBUG  PID(00008186) fpcgi.c 001573 No. It does not exist. Errno is 2
> ----------------
> 
> 
> Next came redirecting stdout (1) and stderr (2) as requested.  I changed the form's Field_cmd to reflect this.  Here's a snip from another log to show what fpcgi was seeing:
> 
> 2008-03-11 15:59:57 DEBUG  PID(00002595) fpcgi.c 000773 Name: Field_cmd  Value: rreport ajax -fp cWebInvoice -sr 307 -n -u -y automaticCGI 1> /tmp/fpcgi/fpcgi.113108_15330.4.log 2> /tmp/fpcgi/fpcgi.113108_15330.4.err.log
> 
> The result is no files are created.  A response htm is not generated, and /tmp/fpcgi remains empty; not even 0 byte files are created (i've made sure the permissions are correct).  
> 
> In addition, I'd kind of hope redirection like this didn't work, and that there's really a different way to redirect output through fpcgi.  If I had a choice between letting anyone submit a form that could utilize I/O redirection on my server, versus not letting anyone do that, i'll take the latter (I don't even want to THINK about pipes working like this!).
> 
> Let me know if you have any questions or would like to see any of the complete log files.
> 
> Thanks
> 
> Matt
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 
> 


-- 
Nancy Palmquist 		MOS & filePro Training Available
Virtual Software Systems	Web Based Training and Consulting	
PHONE: (412) 835-9417		   Web site:  http://www.vss3.com


More information about the Filepro-list mailing list