I'm making additions to a Lemonstand v1 site, but only realised after a few days that the same error was occurring on the pages that I was amending; they seemed to take a while to load (on localhost) and then would error out with a 'Connection Reset' message. I'm pretty sure this kind of error is the result of a redirect loop or similar, and the local Apache error logs seem to bear this out:
[Sat May 24 14:35:23.487444 2014] [rewrite:warn] [pid 3492:tid 1744] AH00664: RewriteOptions: MaxRedirects option has been removed in favor of the global LimitInternalRecursion directive and will be ignored.
...repeated about 30 times. In both cases I was making a database call via the Db_ActiveRecord method upon which much of Lemonstand is based. Both calls were completely different, but essentially did the same thing: made a call to the database to find all instances of a record by ID or similar. For example:
$orders = Shop_Order::create()->where('customer_id=?', $this->customer->id)->order('order_datetime desc')->find_all();
Regardless of what I do with the resulting $orders (including doing nothing with it, just declaring it), this line alone causes the error. If I comment it out, the connection reset doesn't happen. This happens elsewhere with a completely unrelated module call which similarly uses Db_ActiveRecord:
$faqCategory = AhoyFaq_Category::create()->find_by_id($product->productFaqs_faq);
Again, if I just remove that call, the pages load as normal, without recursion issues.
If you're interested in taking a look at the .htaccess file, I've put it here - but it's a completely default .htaccess for Lemonstand, so I'm not sure that's where the problem lies. I've also put the full access log (at least, the list of errors following a page refresh) here.
I've got NO idea why a DB call would result in this kind of recursion, so if anybody has any clue, that would be great. Thanks guys.
MaxRedirectswithLimitInternalRecursionand the warning should disappear. If this would cause the page to be stuck in a redirect loop, it should tell you in the browser that this is the case. Could it be that the script is just running too long, and the script is terminated before it is finished? You might need to dig deeper what is actually the case here.MaxRedirectsline, but the issue persists. I don't get a browser redirect loop though, which leads me to believe this may be a red herring; manual debugging points to theDb_ActiveRecordcalls, but for the life of me I can't figure out why.shop:customer_profileand BOOM! Failed. This appears to be a problem with the actual framework, which unfortunately Lemonstand have basically abandoned. So, fun times ahead!