Skip to main content

"We couldn't contact the reCAPTCHA server" Error

More
10 years 7 months ago #231640 by Neekoy
-- url of the page with the problem -- : www.shopat86.co.uk/test/index.php?option...=register&Itemid=479
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.31
-- Browser(s) name and version -- : Chrome 48.0.2564.109 (64-bit)
-- Error-message(debug-mod must be tuned on) -- : "We couldn't contact the reCAPTCHA server to verify your answer. Please try again."

"We couldn't contact the reCAPTCHA server to verify your answer. Please try again."

This is when you submit the form to try to create an account. Server has port 80 and 443 open for outgoing TCP/UDP connections (as suggested in other threads).

There doesn't seem to be anything relevant in the PHP error logs on the server.

Please help with this error.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #231644 by nicolas
Hi,

It uses the 443 outgoing port.
But it also requires the file_get_contents function to be allowed and the allow_url_fopen directive to be turned on:
www.a2hosting.com/kb/developer-corner/ph...-url-fopen-directive

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #231724 by Neekoy
Indeed 443 outgoing is allowed as well as all_url_fopen (which should allow file_get_contents). I'm still experiencing the issue though. Is there something else that comes to mind that the plugin depends on?

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #231730 by nicolas
There is nothing else. If it's still blocked, then there is something at the hosting level blocking the connection.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #232032 by grayt7
Hi,

I'm also having the same problem. Hosts have gone through everything and there is are no blocks. The images appear for the user to match but then it doesn't authenticate.

Many thanks.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #232037 by grayt7
HI,

The hosts have fixed this issue. If anyone is having issues with this please find attached the plugin file that needs replacing.

From the hosts:

We can prove it's not a server issue via the screenshot attached.

The /home/shopat86/public_html/test/plugins/system/recaptcha2/recaptcha2.php file is processing the recaptcha output. I've made several comments in the code to assist your developer in finding the bug. The thing is, it's processing the input, it knows the value of the input is true, but it's failing.

Now, if I make it run successfully each time - bear with me, the actual recaptcha plugin should fail at a browser level if the captcha isn't successful, from what I understand - all registrations work.

Bottom line - the issue isn't related to the server, I'm afraid."


This works well. Thanks

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #232115 by nicolas
Hi,

Well, what I see in that modified code is that now you can register regardless of what you enter in the ReCaptcha field. It would always say that the captcha is correct because the hosting removed the check on the answer the plugin gets from the ReCaptcha server. In that case, you can just remove the ReCaptcha plugin completely since it always validates the registration regardless of what you write.
So it's not really a fix as far as I can see in the code. I invite you to test.

Try to change the code:
//var_dump($getResponse);var_dump($answers);exit;
//echo "<pre>"; print_r($answers); exit;
to:
var_dump($getResponse);var_dump($answers);exit;
echo "<pre>"; print_r($answers); exit;
in the code of the plugin.
That way, when you register, you should get a debug on the page displaying the request and response to the ReCaptcha server.
That will help us understand the problem if there is a problem with the way the answer is handled. But normally, it's the "success" variable which needs to be checked, like it's done by default.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #232346 by grayt7
But you can't register until you complete the captcha? Registration will always fail until you complete the captcha. The issue before showed the message "We couldn't contact the reCAPTCHA server" AND registered the users but dropped the user back to the registration page.


Here are the results if I add that code:

string(99) "{ "success": true, "challenge_ts": "2016-03-07T11:28:33Z", "hostname": " www.shopat86.co.uk " }" array(3) { ["success"]=> bool(true) ["challenge_ts"]=> string(20) "2016-03-07T11:28:33Z" ["hostname"]=> string(18) " www.shopat86.co.uk " }


Many thanks

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #232354 by nicolas
Hi,

So from what I can see it's working just fine.
The system gets the success answer from ReCaptcha when the captcha entered is correct like in this test.
And since all the change your hosting company did is to force the success answer, it means that the plugin was already working.
You probably just had entered a wrong captcha when you tested or they changed something on their end to allow the plugin to contact the Recaptcha server.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #232461 by grayt7
However, with your original plugin it just doesn't work? If you want login details / ftp to see for yourself I can send them over?

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #232465 by nicolas
What original plugin ? The code is the same besides that part, so from what I can see it should work even if you revert the change.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #232589 by grayt7
Yes the original plugin. If you revert the change it doesn't work, Just get: We couldn't contact the reCAPTCHA server. message

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago - 10 years 6 months ago #232602 by nicolas
Try changing the line:
Code:
if (trim($answers['success']) == true) {
to:
Code:
if ($answers['success'] == true) {
in the original plugin.
Last edit: 10 years 6 months ago by Jerome. Reason: [code] is nice......
The following user(s) said Thank You: grayt7

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago - 10 years 6 months ago #232701 by info@therapycable.com
Hi,

After enabling The Hikashop Captcha, I got the same error.
Please check attached file.

I changed this code
Code:
if (trim($answers ['success']) == true) {
to
Code:
if (trim($answers) == true) {
and everything is fine now.

Thanks,
Last edit: 10 years 6 months ago by Jerome. Reason: [code] is nice ; really really really nice

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #232741 by grayt7
Thanks Nicolas

Try changing the line:
if (trim($answers) == true) {
to:
if ($answers == true) {
in the original plugin.


This has worked.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #232770 by nicolas
Thanks for the feedback. I've updated the plugin on our end with the change.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #234773 by grayt7
HI,

Sorry I've spotted another issue when recaptcha is enabled.

When you have the guest checkout option enabled and try to checkout as a guest there is no captcha to fill out and the message it:

Error

The CAPTCHA solution was incorrect

Which stops checkout as a guest.

Any solutions please? Thanks.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #234775 by nicolas
Hi,

It's probably because of the way you configured the Captcha plugin to display.
Make sure that you set the display after option of the plugin to "email" and not "password". Because otherwise, the captcha won't display with the guest form since there is no password field.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #235267 by plaag666

grayt7 wrote: Thanks Nicolas

Try changing the line:
if (trim($answers) == true) {
to:
if ($answers == true) {
in the original plugin.


This has worked.




Dear Nicolas,

This didnt work for me, i still got the error <i>We couldn't contact the reCAPTCHA server to verify your answer. Please try again.</i>

Do you have any other suggestions?

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #235268 by nicolas
Hi,

Download again the install package of the reCaptcha plugin on our website and install it on yours. The package there has the necessary modifications to work properly.
So if that still doesn't work after that, there is a problem with the settings of your plugin or your server.

Please Log in or Create an account to join the conversation.

Time to create page: 0.306 seconds
Powered by Kunena Forum