I just recently witnessed a strange error message popping up in one instllation every now and then: "You can't request more than @num challenges without solving them. Your previous challenges were flushed."
In my case it was actually "You can't request more than 20 challenges without solving them..." but I found that @num from the locale module..

I am actually not 100% sure if this is a CAPTCHA related thing - but I somewhere (http://scottsigler.com/node/639) found a hint that it might be CAPTCHA related - and "challenge" seems to be a typical CAPTCHA-term.. so I thought I first try here. Of course it could also be any other module and since that website uses some modules (five star, top node, comment notify, etc) it is not easy for me..

..I hope somebody can tell me what this is about - and how/ where I can edit the setup so that thie "error" is not shown anymore..?

thanks in advance! greetz! till..

CommentFileSizeAuthor
#8 flushing213928_01.patch1.31 KBsoxofaan

Comments

samo’s picture

Title: strange message:" You can't request more than @num challenges without solving them..." » "You can't request more than @num challenges without solving them..."
Category: support » bug

Anonymous browsing of a site can result in this error message.

To replicate:

1) Ensure that the comment form is displayed on every node.

2) Ensure that captcha is displayed on the comment form.

3) Browse 20 pages on the site.

To remove the error message, simply disable the drupal_set_message in captcha.module.

Is there a better, long-term solution for this issue?

soxofaan’s picture

Category: bug » support

First: it is indeed a CAPTCHA thing

Second: the flushing of challenges is meant to avoid unlimited filling of your sessions database table. Every time a challenge is requested/displayed, an challenge entry (with the challenge solution) is added to the session of the user, for validating after form submission. If you have a lot of users (and spammers), this can lead to a session table growing too big. By default, the CAPTCHA module flushes all solutions when there are 20 unsolved entries in the session.
You can change this threshold in the source code at the top of captcha.module:
define('CAPTCHA_UNSOLVED_CHALLENGES_MAX', 20);
There is no option in the CAPTCHA admin gui for this (yet)

Third: it is not recommended to have a setup where there is a CAPTCHA on every page view. From the CAPTCHA help page:

Note that the CAPTCHA module interacts with page caching (see performance settings). Because the challenge should be unique for each generated form, the caching of the page it appears on is prevented. Make sure that these forms do not appear on too many pages or you will lose much caching efficiency. For example, if you put a CAPTCHA on the user login block, which typically appears on each page for anonymous visitors, caching will practically be disabled. The comment submission forms are another example. In this case you should set the "Location of comment submission form" to "Display on separate page" in the comment settings for better caching efficiency.

Christefano-oldaccount’s picture

This happens to me on groups.drupal.org from time to time.

timurek’s picture

Category: support » feature

Shall we please just remove displaying of this annoying message? It doesn't look out good, user is notified of something he didn't cause in any way.
If CAPTCHA is needed, such as on my website, on almost every page, then OK, we will simply loose caching. On small sites it is not a problem, but displaying annoying message of unknown origin to innocent user we may call a problem :-)

soxofaan’s picture

Version: 5.x-3.1 » 5.x-3.x-dev
Component: Miscellaneous » User interface

What precisely do you request?

  • Add an option to not show the message, but still do the flushing?
  • Change the message string? If you know a better phrasing, be welcome. Maybe 'challenge' should be changed to 'CAPTCHA'
  • Add an option to change the flush threshold with a possibility to never flush?
  • something else?
Christefano-oldaccount’s picture

I like the first option of not showing the message but still flushing the challenges.

soxofaan’s picture

Another solution would be to flush only the oldest challenges. That would mean a FIFO design instead of the current 'flush everything when full'. Then the message is not needed anymore.

soxofaan’s picture

Assigned: Unassigned » soxofaan
Status: Active » Needs review
StatusFileSize
new1.31 KB

this patch implements the idea of #7

johnalbin’s picture

Category: feature » bug
Status: Needs review » Reviewed & tested by the community

Works for me.

Christefano-oldaccount’s picture

Works for me, too. Thanks!

RedBaron’s picture

I've the same problem with this error. I've downloaded the patch, but I don't know how I can apply this patch?

Do I have just to copy the new code over the old one?

Thanks for your help!

Edit: I've just copied the code over the old one and everything is fine! Thank you guys, the problem is solved! :)

soxofaan’s picture

Version: 5.x-3.x-dev » 6.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
soxofaan’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.