error-codes missing in failure response

4,086 views
Skip to first unread message

Richard Davies

unread,
Dec 16, 2014, 5:59:07 PM12/16/14
to reca...@googlegroups.com
I have a verification request that's returning the following response:

{
  "success": false
}

Notice that the "error-codes" element is not present. Although the docs at https://developers.google.com/recaptcha/docs/verify state that the error-codes element is "optional", am I correct in interpreting the docs to mean that error-codes should always be present if success=false? So is this a bug or do I need to be prepared to handle failures that don't have any error codes? It would seem silly to return a failure without any explanation.

Benjamin Löffel

unread,
Dec 17, 2014, 5:14:46 AM12/17/14
to reca...@googlegroups.com
The reCAPTCHA is supposed to display the error messages if they occur. If none of them showed up it probably means that your problem is coming from entering the captcha or checking the checkbox itself.

Error code reference

Error codeDescription
missing-input-secretThe secret parameter is missing.
invalid-input-secretThe secret parameter is invalid or malformed.
missing-input-responseThe response parameter is missing.
invalid-input-responseThe response parameter is invalid or malformed.

James Turner

unread,
Dec 17, 2014, 5:27:36 AM12/17/14
to reca...@googlegroups.com
If you use a regularly maintained library this kind of edge case has already been captured (https://github.com/phpninjas/ReCaptcha).
As you stated error-codes are optional, and the behaviour exhibited is peculiar (i.e. that failure SHOULD also encompass an error code).
The only way to really treat it is to assume that captcha failed for some unknown reason and reshow the captcha again.

Christopher O'Connell

unread,
Feb 23, 2015, 5:11:07 PM2/23/15
to reca...@googlegroups.com
I have to bring this post back up.

In testing, nearly every request made returns "success": false, but no error-codes. I was successfully able to pass the CAPTCHA twice. Subsequently, I have failed every single try, running on multiple machines and browsers.

I receive no meaningful error code and the panel has no hint as to what's gone wrong. I should note that on every attempt, the box successfully "checks" to a blue checkmark on the first try, or shows me a number to type in and checks to a blue checkmark.

Is there any way to determine why requests are failing? If I've made an error in my implementation, it's mighty hard to discover it.

All the best,

~ Christopher

Travis Lawrie

unread,
Feb 23, 2015, 6:39:01 PM2/23/15
to reca...@googlegroups.com
debug your code and copy paste the server web client call URI it into chrome with developer tools and see what you get. or, if you cant step-through debug, have the server send things to the client that you wouldn't normally do in production so you can see what your server is doing when it compiles together the URI api call string



--
You received this message because you are subscribed to the Google Groups "reCAPTCHA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to recaptcha+...@googlegroups.com.
To post to this group, send email to reca...@googlegroups.com.
Visit this group at http://groups.google.com/group/recaptcha.
For more options, visit https://groups.google.com/d/optout.

Christopher O'Connell

unread,
Feb 23, 2015, 6:52:23 PM2/23/15
to reca...@googlegroups.com

I've done that. The uri looks perfectly reasonable, and it gets a well good response with a 200 code. It just says "success": false.

You received this message because you are subscribed to a topic in the Google Groups "reCAPTCHA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/recaptcha/kuhCI1JYG8A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to recaptcha+...@googlegroups.com.

Travis Lawrie

unread,
Feb 23, 2015, 7:09:20 PM2/23/15
to reca...@googlegroups.com
​​
does the final api call look like this:

(note: brackets [] are just for looks)

"

secret=[your secret]

&response=[your response]

&remoteip=[client ip]

"

?

Christopher O'Connell

unread,
Feb 23, 2015, 7:11:42 PM2/23/15
to reca...@googlegroups.com

Indeed it does.

I've made it work as follows: removed the client ip. Looking in Wireshark, I noticed that the server is sending a v4 ip, while the javascript is connecting to Google over a v6 ip.

Removing the IP seems to have solved the problem.

Red Road

unread,
Mar 30, 2016, 5:06:05 PM3/30/16
to reCAPTCHA
I am having exactly the same result.  I have tried removing the client IP to no avail.  I've tried it on 4 different servers, with 4 different browsers connecting to each one, and with the simplest imaginable interface, and I get the same result every single time.  The green checkmark is checked, but the siteverify comes back with success:false and no error codes at all.
I've tried manually adding "WTF" to my site key, and I get the expected error - invalid site key.  I've tried adding "WTF" manuall to the g-recaptcha-response and I get the expected error there too.  But with correct keys and response codes, no error but no success either.
Reply all
Reply to author
Forward
0 new messages