Forum OpenACS Q&A: Re: error in rp_handler: can't read "tcl_url2file
I can confirm that turning off PerformanceModeP appears to fix the problem we were having with the form not advancing to the next page. But the client won't be happy with turning that off, as their performance was considerably worse with it switched off, so I need to come up with a solution to this. I have reproduced in on other installations too, so it seems to be a general issue when PerformanceModeP is switched on.
Since as long as I can remember, we always have PerformanceModeP turned on for production installations. I thought that was the official OpenACS policy?
In fact, in the case of this installation, PerformanceModeP was somehow turned off for a period, the client complained of slow performance, and we switched it back on. The performance improved considerably, but now the client is complaining of this occasional strange behaviour in the form using the "wizard" functionality.
Looking at rp_handler, I am a little confused about the logic of the use of tcl_url2file array. Whether PerformanceModeP is on or off, it always writes the file to tcl_url2file([ad_conn url]), which seems pointless when PerformanceModeP is off. But that's an aside really to my issue.
When PerformanceModeP is on, it tries to read the cached value back from tcl_url2file([ad_conn url]). Naturally, the first time, it's not going to find the value, so I don't understand why it reports an error - maybe just for debugging purposes?.
What is really confusing me is that sometimes the error we see is "no such element in array", but also often we see "no such variable", which doesn't make sense to me. Could that be an issue with the interaction of the "global" command, arrays and threads?
[25/Sep/2017:12:36:51][2034.754395456][-default:0-] Notice: RP (310 ms): error in rp_handler: can't read "tcl_url2file(/admin/site-map/)": no such variable
[25/Sep/2017:12:37:50][2034.756508992][-default:1-] Notice: RP (134 ms): error in rp_handler: can't read "tcl_url2file(/admin/site-map/)": no such element in array
We're seeing these errors even on repeated calls to the URL, where you would expect that the 2nd and subsequent calls find both the array and they key value.
(I see in the most recent OpenACS version it has been changed from global to the :: namespace - I tried changing our version to use this, but unfortunately it exhibits the same behaviour).
I'm going to focus now on the wizard tool to see if there is an obvious fix to it, but would appreciate any suggestions to resolve the tcl_url2file behaviour.