Forum OpenACS Q&A: Re: Openacs process disappearing

Posted by Jason Cheung on
Thanks for reminding. I didn't know that. I've set the OpenACS user (serice0, service1) ulimit now. Thanks

AOLserver crash
I think I am quite sure that it is crashed itself. Because:

1) I haven't shut it down.
2) I haven't schedule any shutdown at this frequency (10 or more in an hour sometimes)
3) There is no log for shutdown in the log file

Unless there is other evidence I can look for, I suppose the AOLserver process crashes itself.

Posted by Andrew Piskorski on
Well, were the ulimit settings wrong, or not? Your assumption that AOLserver is crashing is still unfounded, for all the same reasons I explained above. If you fix the 'ulimit -c' setting and then see AOLserver leaving a corefile, then you would actually know that it is in fact crashing. And more importantly, you could run gdb on it to see where and perhaps even why it's crashing. Didn't you try that already, above on Nov. 27? So, do you see a corefile now, or not?
Posted by Jason Cheung on
I have narrowed the problem to a problem in configuration or coding of my website. It seems the request processor is not handling server errors properly from invalid URLs. - - [27/Jun/2006:02:07:50 +0800] "GET /robots.txt HTTP/1.1" 200 303
"" "Mozilla/5.0 (compatible; Yahoo! Slurp;
/slurp)" -

[27/Jun/2006:02:07:51][25599.3024083888][-conn:service0::49] Notice: MONITORING WEBSITE MOVEMENT <<<<<
<<<<<<<<<< iso-8859-1 /public/contents/category?cid=1017%3C/p%3E%0D%0A%3Cp%3E >>>>>>>>>>>>>>>>>>>

What has been entered is a bad id being entered from the clients browser and it is not redirecting the 500 to a file-not-found.html in /global.

Furthermore, if the url as a space after the file name followed by the above query - it results in server error and process is gone.

Any advice is appreciated.

Posted by Jason Cheung on
Whats odd is that /public/main is a valid url (there is a main.adp,tcl) and typing /public/maintestingerror redirects fine back to the home page - BUT if I try something like /public/contents/a then it crashes.
Posted by Jason Cheung on
It seems that the integer validation of cid is not working .. is there anything wrong with this snippet of code?

ad_page_contract {

A gateway, base one Category_id, redirect user to specific page

} {
{lang ""}

Posted by Gustaf Neumann on
Jason, what version of openacs are you using? what version of tcl?

try the following in the shell:
set var x
set val 123
ad_page_contract_filter_proc_integer var val

(this is a valid test and returns 1) and then

set var x
set val [ns_urldecode 1017%3C/p%3E%0D%0A%3Cp%3E]
ad_page_contract_filter_proc_integer var val

(this is the test with the invalid id from your example)
If the integer test is the problem, the second one crashes.
the second call should return 0.

for me, this works nicely...

Posted by Jason Cheung on
Hi Gustaf,

Thank you for your reply,

openacs 5.1.2d
tcl: version 8.4

The two tests did not return any error - and to update on further investigation, another website (lets say website B) using the same tcl version and openacs version did not have the same problem with entering a string in the query. I.E. it would complain:

We had a problem with your input:

group_id is not an integer

Please back up using your browser, correct the above , and resubmit your entry.

Thank you.

Whereas in website A (if I enter category?cid=a),it returns 500 Internal Server Error. Tested string and email also; they work fine.

Not sure if it relates to the openacs core installation or the custom tcl code or aolserver configuration.

Jason, do the tests return on both systems the correct boolean value? To be sure, try to use the function ad_page_contract_filter integer from version 1.20

don't you see any error message in the error log from the 500 error?


After some more testing it seems I know where the problem lies. It seems the master template (blank-master.adp) contained

ad_page_contract {

} {

{item_id:integer 0}
{cid:integer 0}
{return_url ""}

which it did not agree with .. guess it did do the validation after all and it was the display template which had the 500 problem!


I have 2 files - test.tcl and blank-master.tcl


ad_page_contract {

} {

ns_log Notice INSIDETEST


ad_page_contract {

} {
{x ""}

ns_log Notice BLANKMASTER

How might I pass value of x into blank-master in usual circumstances such as test?x=1 and test?x=a (this works;returns error) and also catch invalid urls such as test?x=1017%3C/p%3E%0D%0A%3Cp%3E (this causes server error).

A quick solution is to pass as a property in default-master and do integer validation further down in blank-master.

However, is there a coding convention that I am missing for passing queries to blank-master with better exception handling ?

The problem that I have had was rp processor displaying the error message within the master template which caught the same validation error thus resulting in a neverending error loop.