"Could not open socket" error

2,378 views
Skip to first unread message

Harry M

unread,
Aug 31, 2010, 4:57:52 PM8/31/10
to reCAPTCHA
I'm using reCAPTCHA with PHP code. It was working several months ago,
but when I checked recently I encountered this "Could not open socket"
error. I downloaded and utilized the latest Google code, but still get
the same error. The error is consistent and occurs for people using
different ISP's. I've traced the error to the fsockopen() function
call from _recaptcha_http_post(), which is in the Google-supplied
recaptchalib.php module. The relevant parameters are set as follows:

host: www.google.com
port: 80
errno: 110
errstr: Connection timed out.

I'm using php version 5.2.9 and apache version 2.2.11 on a shared
Linux server (kernel ver 2.6.18-164.11.1.e15). The domain this applies
to is: harrymagnet.com. I contacted inmotionhosting (hosting provider)
and they say it's not their problem.

The form is web-accessible at:
http://www.harrymagnet.com/test_contact_form/





Harry M

unread,
Sep 1, 2010, 10:50:57 AM9/1/10
to reCAPTCHA
As of this morning, the error is no longer occurring.

Harry M

unread,
Sep 1, 2010, 11:51:32 AM9/1/10
to reCAPTCHA
I spoke to soon. It's happening again. Is there anyone from Google who
can shed some light on why this intermittent error occurs?

reCAPTCHA Support

unread,
Sep 1, 2010, 12:40:42 PM9/1/10
to reca...@googlegroups.com
It's hard for us to debug this specific problem without more info. If
you could answer as many of the following questions as you can, that'd
be helpful:

What's the URL to your reCAPTCHA-protected page?
Are you using reCAPTCHA over SSL, or over normal HTTP?

Can you run the following commands from your web server and paste the
output? (I'm assuming your web server runs Linux; if you are on
Windows the commands might be slightly different):

host www.google.com
nslookup www.google.com
traceroute www.google.com

If you have a web browser accessible on your server, can you access
http://www.google.com/recaptcha/demo/ ?

Thanks,
Colin

> --
> You received this message because you are subscribed to the Google Groups "reCAPTCHA" group.
> To post to this group, send email to reca...@googlegroups.com.
> To unsubscribe from this group, send email to recaptcha+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/recaptcha?hl=en.
>
>

--
reCAPTCHA: stop spam, read books
http://recaptcha.net

Harry M

unread,
Sep 1, 2010, 12:58:36 PM9/1/10
to reCAPTCHA
The URL of the reCAPTCHA protected page is:
http://www.harrymagnet.com/test_contact_form/

At the moment, the timeout error is occurring.

I'm using reCAPTCHA over HTTP (not SSL)

I can't run commands, because I'm on a shared server that doesn't
allow SSH or telnet access. I'll pass your additional questions on to
inmotion and see if they can answer them.

--Harry
> > For more options, visit this group athttp://groups.google.com/group/recaptcha?hl=en.

Harry M

unread,
Sep 1, 2010, 2:51:31 PM9/1/10
to reCAPTCHA
Here are the outputs of the commands you requested:

tier1adv@biz54 [~]# host www.google.com
www.google.com is an alias for www.l.google.com.
www.l.google.com has address 66.102.7.99
www.l.google.com has address 66.102.7.104
tier1adv@biz54 [~]# dig www.google.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> www.google.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56721
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;www.google.com. IN A

;; ANSWER SECTION:
www.google.com. 604748 IN CNAME www.l.google.com.
www.l.google.com. 248 IN A 66.102.7.104
www.l.google.com. 248 IN A 66.102.7.99

;; AUTHORITY SECTION:
google.com. 345544 IN NS ns2.google.com.
google.com. 345544 IN NS ns3.google.com.
google.com. 345544 IN NS ns4.google.com.
google.com. 345544 IN NS ns1.google.com.

;; ADDITIONAL SECTION:
ns1.google.com. 345543 IN A 216.239.32.10
ns2.google.com. 345543 IN A 216.239.34.10
ns3.google.com. 345543 IN A 216.239.36.10
ns4.google.com. 345543 IN A 216.239.38.10

;; Query time: 1 msec
;; SERVER: 74.124.198.200#53(74.124.198.200)
;; WHEN: Wed Sep 1 10:09:41 2010
;; MSG SIZE rcvd: 220

tier1adv@biz54 [~]# traceroute www.google.com
traceroute to www.google.com (66.102.7.104), 30 hops max, 40 byte
packets
send: Operation not permitted

reCAPTCHA Support

unread,
Sep 1, 2010, 3:17:01 PM9/1/10
to reca...@googlegroups.com
> tier1adv@biz54 [~]# traceroute www.google.com
> traceroute to www.google.com (66.102.7.104), 30 hops max, 40 byte
> packets
> send: Operation not permitted

That's a bit odd. Does your provider not allow outbound sockets to be
opened? (Can you get any info from them on what sort of firewalls or
other weird network settings they have in place?)

Can they successfully run a command like:
curl -v http://www.google.com/recaptcha/api/verify
and paste the result?

Colin

Harry M

unread,
Sep 2, 2010, 1:26:39 PM9/2/10
to reCAPTCHA
The problem was on the web hosting provider side. Here's what they
came back with: "I have attempted the steps google suggested and it
failed. After further research it appears googles IP addresses had
been blocked on the server due to a large number of connections. Our
systems team has been made aware of this and I have unblocked googles
IP addresses. The script should now function normally." Thanks for
your help.

--Harry

On Sep 1, 3:17 pm, reCAPTCHA Support <supp...@recaptcha.net> wrote:
> > tier1adv@biz54 [~]# traceroutewww.google.com
> > traceroute towww.google.com(66.102.7.104), 30 hops max, 40 byte
> > packets
> > send: Operation not permitted
>
> That's a bit odd.  Does your provider not allow outbound sockets to be
> opened?  (Can you get any info from them on what sort of firewalls or
> other weird network settings they have in place?)
>
> Can they successfully run a command like:
> curl -vhttp://www.google.com/recaptcha/api/verify

P JH

unread,
Sep 2, 2010, 2:15:22 PM9/2/10
to reca...@googlegroups.com
On Tue, Aug 31, 2010 at 9:57 PM, Harry M <hmagnet20...@yahoo.com> wrote:
> I contacted inmotionhosting (hosting provider)
> and they say it's not their problem.

On Thu, Sep 2, 2010 at 6:26 PM, Harry M <hmagnet20...@yahoo.com> wrote:
> The problem was on the web hosting provider side. Here's what they
> came back with:

Most illuminating.

--
PJH

Reply all
Reply to author
Forward
0 new messages