fpCGI failure
Matt Cordes
mcordes at healthyhabitsweb.com
Thu Mar 13 12:48:17 PDT 2008
> 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:
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
More information about the Filepro-list
mailing list