0

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.

4
  • The warning says that you are using an outdated option name for the version of Apache you are using. Replace MaxRedirects with LimitInternalRecursion and 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. Commented May 24, 2014 at 16:25
  • @Sumurai8 Yes, I cottoned on to that as I was writing this out, so I actually commented out the MaxRedirects line, 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 the Db_ActiveRecord calls, but for the life of me I can't figure out why. Commented May 24, 2014 at 16:58
  • Maybe this can help. Commented May 24, 2014 at 17:02
  • @Sumurai8 Thanks for the link. I tried just about everything that was relevant and didn't get any closer to knowing what was going on. However, I then tried my own test; I created a completely 'themeless' page (no CSS, JS, HTML, nada) and just that line of code; worked. I added back the theme wrapper; worked. I added a Lemonstand page 'Action' of shop:customer_profile and BOOM! Failed. This appears to be a problem with the actual framework, which unfortunately Lemonstand have basically abandoned. So, fun times ahead! Commented May 24, 2014 at 17:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.