Hello,
I've already read a lot of threads related to this issue but none solved my problem.
I am currently having an issue with image_captcha in that the captcha image is not being displayed for any form when the user is anonymous. When I log in, I can see the captcha image correctly.
Also, this issue only happens on the production server. Localhost is ok for both admin and anonymous users.
I did try to do the following:
* I verified that GD is working and the fonts are working (they have to be since an image is created when a user logs in, and on the captcha admin page (i.e. the 10 examples page)).
* Using Firebug NET panel, I see a 0x0 image being loaded. I get a 200 request, so apart from the 0x0 px, the request seens to be ok.
* I switched the captcha type to math to see if it would work, and it worked correctly when the user is anonymous.
* I viewed the page source for the form as an anonymous user, and I could see the tag for the captcha image.
* I tried switching the drupal caching from normal to disabled, and no changes.
* I checked my users table and there is a row for user id=0.
* I checked my sessions table and there are several rows for user id 0.
What it's weird:
* Although the image is generated correctly in the Captcha admin Example pages (admin/user/captcha/captcha/examples and admin/user/captcha/captcha/examples/image_captcha/Image) and in the Example fieldset of the ImageCaptcha admin page (admin/user/captcha/image_captcha), the images of the "Font settings" fieldset on the ImageCaptcha admin page are not being displayed for auth user. They are broken just the way the captcha is broken for anonuymous users.
* In the production server I had to add a "ob_clean();" on the line 26 of "image_captcha.user.inc" to make the captcha image be rendered in the admin pages. It seems that one of the site files is outputing a trash-character (maybe encoding problem), but it doesn't happen in my localhost. I've already uploaded all files to production again, but the problem persists.
Thank you!
Comment | File | Size | Author |
---|---|---|---|
#20 | CAPTCHA_bug.png | 5.6 KB | lhugg |
#19 | Screen Shot 2013-04-18 at 00.33.34.png | 274.2 KB | soxofaan |
#8 | 976436-clean-ob-image-captcha-01.patch | 873 bytes | soxofaan |
Comments
Comment #1
soxofaan CreditAttribution: soxofaan commentedHi,
Thanks for such an elaborate report, this saves us a lot of time and back and forth posting.
Anyway: if you say ".. math captcha worked correctly when the user is anonymous.", do you mean that the challenge just shows up for anonymous visitors, or did you also test that submitting the form was correctly blocked with a wrong CAPTCHA response and correctly allowed with a correct CAPTCHA response?
Are there any relevant error/warning messages in the Drupal watchdog log or your server logs?
Is this production site publicly accessible? Can you disclose an URL so I can have a look?
Comment #2
matheusgorino CreditAttribution: matheusgorino commentedHi Soxofaan,
The website is not publicly accessible, it hasn't been launched yet.
Yes, Math Captcha works and there's no error messages on Drupal or server logs =/
But I have a new information:
- I have uploaded a local database backup to the production server and then captcha started to work for anonymous users.
- Then I restored the production database again and it stopped work.
So there's something with the database. I've just cleared all the caches, sessions and captcha_sessions tables, but it didn't resolved my problem.
I can't get rid of the production database because the client have already entered a lot of information =/
Thank you.
Comment #3
soxofaan CreditAttribution: soxofaan commentedIs completely uninstalling and reinstalling the captcha module an option?
Comment #4
matheusgorino CreditAttribution: matheusgorino commentedJust did and it still doesn't work :(
Comment #5
soxofaan CreditAttribution: soxofaan commented(Sorry for the delay, my time for drupal support is limited)
Do you have a lot of modules enabled on your site?
Comment #6
qasimzee CreditAttribution: qasimzee commentedI am having the exact same bug. Is there any fix? Watch dog shown:
CAPTCHA problem: unexpected result from hook_captcha() of module image_captcha when trying to retrieve challenge type sites for form captcha_examples.
Comment #7
vomitHatSteve CreditAttribution: vomitHatSteve commentedSubscribing:
I have had a very similar problem with captcha/image_captcha 6.x-2.4, but I believe I was not having the problem with 6.x-2.3. (The problem wasn't noticed until a client pointed it out. Whoops!)
The titular image_captcha image captchas were not loading. If you tried to view it directly in firefox, it would generate an image saying:
Adding an ob_clean() call before line 26 of image_captcha/image_captcha.user.inc (as the OP suggested) seems to resolve the issue.
Comment #8
soxofaan CreditAttribution: soxofaan commented@vomitHatSteve: There didn't change much in the image captcha between 6.x-2.3 and 6.x-2.4, so I don't think the upgrade is the culprit in you case. More likely an update or addition to another modules that fills the output buffer for some reason.
Anyway, here is a patch to add an ob_clean(), based on Drupal core's file.inc
Comment #10
soxofaan CreditAttribution: soxofaan commented#8: 976436-clean-ob-image-captcha-01.patch queued for re-testing.
Comment #12
shadowmihai CreditAttribution: shadowmihai commentedsubscribe.
Same thing in drupal 7 with 7-x-1.0-alpha2. It was working fine, then stopped showing up. No error messages, and it appears that the system is generating the image, but it disappears. Also - and I think this must be important somehow - the "sample fonts" are not displayed in the configuration page - but the directory is listed in place of the font images. They stopped showing up at the same time.
Comment #13
wundo CreditAttribution: wundo commented#8: 976436-clean-ob-image-captcha-01.patch queued for re-testing.
Comment #15
wundo CreditAttribution: wundo commentedAlthough it failed the testing it seems good for me, committed.
Comment #16
soxofaan CreditAttribution: soxofaan commentedthanks
I also "git cherrypicked" it to the 7.x-1.x branch (master)
Comment #18
cristian100I have this very same issue with Image Captcha, in some forms it works, and at some others it doesn't:
Look at this, at the form at the right sidebar:
http://www.buscarsalud.com/perfil/cristian-antonio-gonzalez-cienfuegos-2...
Comment #19
soxofaan CreditAttribution: soxofaan commentedlooks normal to me (see attached screenshot).
What is the problem you are seeing?
Comment #20
lhugg CreditAttribution: lhugg commentedThis issue is still happening. Using Image CAPTCHA, the image would paint and then vanish in a split second. This happens on all our sites that upgraded to 7.x-1.0 from one of the betas, usually beta 2.
I'm still trying things, but it seems at this point to happen when you add 'noise' to the image. As I find more I'll update this.
But this would be good for the maintainers to look into.
Thanks.
Comment #21
soxofaan CreditAttribution: soxofaan commentedIf you have this issue, please provide enough info: which browsers? which version of drupal? which other modules do you have installed? is there a publicly accessible url to test it? what happens when you do download/"open image in new tab" (or whatever your browser provides)?
without this kind of info there is not much the maintainers can do
Comment #22
michaelkoehne CreditAttribution: michaelkoehne commentedKaspersky + Chrome. Shut down Kaspersky and try again, or try in another browser.
Comment #23
Stephen OllmanI had the same issue suddenly happen to me after an update to 6.x-2.5.
I made the mistake of logging out so could not get back in to the site as admin.
So, if you cannot login because of Captcha do the following:
(If you are logged in then skip to step 4)
1. Access database tables (I used phpMyAdmin)
2. Run the following SQL query:
SELECT * FROM `system`WHERE filename LIKE '%captcha%'
3. Edit the /captcha/captcha.module and /captcha/image_captcha/image_captcha.module entries and change the status values to '0'
You should now be able to login again as Captcha is now disabled.
4. Go to: /admin/user/captcha/image_captcha and select a font in the font setting fieldset. (for some reason mine had unchecked after the module update).
5. Save and you're good to go. (test in another browser that Captcha now appears)
Hope this helps someone.
Comment #24
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedI'm closing this 5 year old support request as cannot reproduce.