curl: (56) Failure when receiving data from the peer while accessing http://maps.google.com/maps/api/geocode/xml - google-maps

I am facing problem while accessing http://maps.google.com/maps/api/geocode/xml through code (simplexml_load_file). Its not working from putty console also.
Here are the alternatives i used:
Option1 >
$url = 'Above URL?adress=XXXAddress HereXXX';
$xml = simplexml_load_file($url);
Error:Warning: simplexml_load_file(above URL?address=XXXAddress HereXXX): failed to open stream: Connection timed out in /data/mgr_3.2.x_5/www/manager/support_scripts/geocode.php on line 5
Warning: simplexml_load_file(): I/O warning : failed to load external entity "Above URL?address=XXXAddress HereXXX" in /data/mgr_3.2.x_5/www/manager/support_scripts/geocode.php on line 5
bool(false)
Option 2 >
Tried it from Server:
]# curl --data "XXXXXXXXXXXXXXXXX" --verbose http://maps.google.com/maps/api/geocode/
Error:
* Closing connection #0
* Failure when receiving data from the peer
curl: (56) Failure when receiving data from the peer
Curl Details:
rpm -qa|grep curl
python-pycurl-7.19.0-8.el6.x86_64
curl-7.19.7-36.el6_4.x86_64
libcurl-7.19.7-36.el6_4.x86_64
Recently my code migrated to another server and latest PHP version (5.4.14).
Tried all solutions given on various sites. I am badly stucked. Please Help out.
Thanks in advance
Sandip

http://maps.google.com/ was blocked on the server which caused this issue. Now it is allowed and issue is resolved. Thanks

Related

When I run 'hexo deploy' ,there is something wrong

fatal: unable to access 'http://github.com/***/***.github.io.git/': Recv failure: Connection reset by peer
when I run 'hexo generate -d' ,there is a wrong message like that
In _config.yml,I changed the remote repository address,"http" to "https",it works!

waiting for SSH to become available with packer too long

Anyone have already this issue with packer build ?
Waiting for SSH to become available...
[INFO] Attempting SSH connection...
reconnecting to TCP connection for SSH
handshaking with SSH
handshake error: ssh: handshake failed: read tcp 127.0.0.1:49663->127.0.0.1:3278: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
[DEBUG] SSH handshake err: ssh: handshake failed: read tcp 127.0.0.1:49663->127.0.0.1:3278: wsarecv: Une connexion existante a dû être fermée par l’hôte distant.
My packer build run correctly but the step to connect with ssh is very long (10min).
Have you a idea for resolve this ?
PS : the "space" character in log is not my fault, this is just the result of -debug packer build. Perhaps open another stackoverflow issue for resolve this.
I have a similar setup (Ubuntu, Windows 7, virtualbox-iso). My scripts include a file below that's called in the provisioners block. Lacking these may be a cause of the slowness
#!/bin/sh -x
echo "UseDNS no" >> /etc/ssh/sshd_config;
echo "GSSAPIAuthentication no" >> /etc/ssh/sshd_config;
It's also possible that the 10 minute wait is just other stuff happening in the background that you can't see. If you can post a link to your scripts and/or tell me how long the entire build process takes that might provide additional context

Sublime Text 2 - There are no packages available for installation

So many Sublime Text 2 users get error (or) no action when they want to install any sublime text 2 package #via Package Control.
When I'm clicked on Package Control: Install Package from Ctrl+Shift+P.
I got this below error:
There are no packages available for installation
Note: Some times error message is not displayed and no action is happened.
When I'm tracing error report from console. I got this below error on console.
Package Control: Trying to execute command /usr/bin/curl --user-agent 'Sublime Package Control v2.0.0' --connect-timeout 30 -sSL --compressed --dump-header /tmp/tmpwQjJVT --header 'If-Modified-Since: Sun, 03 Aug 2014 12:10:13 GMT' --cacert /usr/lib/ssl/certs/ca-certificates.crt -v https://sublime.wbond.net/channel.json
Package Control: Curl HTTP Debug General
Hostname was NOT found in DNS cache
Trying 50.116.34.243...
Trying 2600:3c02:e000:42::1...
connect to 2600:3c02:e000:42::1 port 443 failed: Network is unreachable
Failed to connect to sublime.wbond.net port 443: Network is unreachable
Closing connection 0
Package Control: Error downloading channel. curl: (7) Failed to connect to sublime.wbond.net port 443: Network is unreachable downloading https://sublime.wbond.net/channel.json.
error: Package Control
There are no packages available for installation
How to solve this problem?
This error is happened with IPv6 problem. If your Internet Service
Provider (ISP) does not support for IPv6 you will get this error.
How to solve this on Unix (OSX/Linux/Ubuntu/CentOS/etc...):
Open terminal and run this below command line.
sudo echo "50.116.34.243 sublime.wbond.net" >> /etc/hosts
How to solve this on Windows:
Click on start button on your windows desktop and find cmd.
Now right click on Command Prompt option and select Run as administrator.
Run this below command line on CMD.
echo 50.116.34.243 sublime.wbond.net >> "C:\Windows\system32\drivers\etc\hosts"
Do not hard-code the current ip of sublime.wbond.net. This will not solve the problem, and will only break your machine's connection to Package Control in the near future.
If you are having trouble with ipv6, use the latest version from https://github.com/wbond/package_control. It has a fix for curl and wget when they encounter issues with computers that provide ipv6 via DNS, but can not actually access sites via ipv6.
If you are still having trouble with Package Control, follow the instructions at https://packagecontrol.io/docs/issues. Please be sure to include a debug log, otherwise I can't help.
Three stps to solve this problem on Mac in China.
add "0.116.34.243 sublime.wbond.net" into /etc/host
open Global Mode of Shadowsocks (needed only in China)
restart Sublime
I had the same problem today, and after a long search I found out that packagecontrol.io website was down!

getaddrinfo: start Temporary failure in name resolution Error opening specified endpoint "start" Server Exiting with code 1

While starting snmpd I am getting this error in /var/snmpd.log
**
> *getaddrinfo: start Temporary failure in name resolution Error opening
specified endpoint "start" Server Exiting with code 1*
**
For your info m using Fedora-14 & net-snmp-5.7.1 .
Thanks in Advance..Help me
Error opening specified endpoint "start" Server Exiting with code 1
means some process is using port 161.
For example try netstat -anp | grep 161, then stop that process and start snmpd again.

'Sec-WebSocket-Accept' header is missing in Chrome 17

Edit:
I tried this phpwebsocket: http://www.wilky.it/Shared/phpwebsocket.zip and it works in Firefox, but my question still remains: how do I get websockets to work with a php server in Chrome 17?
I'm following the tutorial here: http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/
It appears as though the client connects, and then immediately disconnects. I noticed this error in the console:
Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing
I'm trying it in Chrome 17.0.963.56 on my WAMP localhost with the php_sockets extension enabled.
I saw mentioned somewhere that Chrome had changed what it supported, but it didn't go in depth on how to fix it. I was hoping someone could step me through it. (I'm brand new to websockets).
Server:
{PATH}>php startDaemon.php
2012-02-20 07:02:51 System: Socket Resource id #7 created.
2012-02-20 07:02:51 System: Socket bound to localhost:8000.
2012-02-20 07:02:51 System: Start listening on Socket.
2012-02-20 07:03:01 WebSocket: Resource id #8 CONNECTED!
2012-02-20 07:03:01 WebSocket: Requesting handshake…
2012-02-20 07:03:01 WebSocket: Handshaking…
2012-02-20 07:03:01 WebSocket: Done handshaking…
2012-02-20 07:03:01 WebSocket: Resource id #8 disconnected!
Client:
Socket Status: 0
Socket Status: 3 (Closed)
I have the same problem (and I do not seem to be able to post a comment here, so I post a reply).
Actually, I just downloaded and tested phpwebsocket.
On safari 5.1.4, it works just fine.
On Chrome 17, I got the same error in the script log console:
Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing
So, in websocket.class.php, I added to the header returned by server:
$accept = base64_encode(SHA1($key."258EAFA5-E914-47DA-95CA-C5AB0DC85B11"));
And I get the error:
Error during WebSocket handshake: Sec-WebSocket-Accept mismatch
Now, the header received by the server is:
GET /websocket/server.php HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: localhost:12345
Origin: http://localhost:8888
Sec-WebSocket-Key: OqMJI0t/cOl6d6JNE+Op0g==
Sec-WebSocket-Version: 13
And the header sent back by the server is:
HTTP/1.1 101 WebSocket Protocol Handshake
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Origin: http://localhost:8888
Sec-WebSocket-Location: ws://localhost:12345/websocket/server.php
Sec-WebSocket-Accept: ZjY5ODliNTViYzJlOTNkMjk4OTg3Y2U2NjQ3MTBlZjZiNzliYzk4Yg==
The Sec-WebSocket-Accept seems good, but still there is a mismatch error. Do you see a mistake somewhere? Maybe the protocol has changed to calculate the Sec-WebSocket-Accept, but I don't find it... Thanks for your help!
Edit: Here seems to be the solution (for me, at least): adding the parameter true to the SHA1 function, as found in files given in this issue thread. So, the Sec-WebSocket-Accept must be found like this:
$accept = base64_encode(SHA1($key."258EAFA5-E914-47DA-95CA-C5AB0DC85B11", true));
And, Sec-WebSocket-Key1 and Sec-WebSocket-Key2 does not seem to be present anymore in the client request, instead, $key must be extracted from the header: "Sec-WebSocket-Key".
New issue: It seems too that even if the web socket connection now works on the handshake, it disconnects when the first message is sent.
I noticed that in the console of Chrome 19:
A server must not mask any frames that it sends to the client.
Maybe this is the problem. It disconnects as soon as a message is sent. It works fine in Firefox.
I fixed this websocket problem and it works in chrome now.
First I used:
Then I used the encode function from:
https://github.com/lemmingzshadow/php-websocket
I fixed the replaced the encode function with the one in the connection.php file in lemmingzshadow’s github and it started working. The function is called: hybi10Encode in the \server\lib\WebSocket\connection.php file.
change this parameter in the function encode: $masked = true to $masked = false
An EASY way to fix is add Sec-WebSocket-Accept information when do_handshake, code as below:
list($resource,$host,$origin,$key) = $this->getheaders($buffer);
$accept = base64_encode(SHA1($key."258EAFA5-E914-47DA-95CA-C5AB0DC85B11", true));
$upgrade = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n" .
"Upgrade: WebSocket\r\n" .
"Connection: Upgrade\r\n" .
"WebSocket-Origin: {$origin}\r\n" .
"WebSocket-Location: ws://{$host}{$resource}\r\n".
"Sec-WebSocket-Accept: " . $accept . "\r\n\r\n";
$this->handshakes[$socket_index] = true;
socket_write($socket,$upgrade,strlen($upgrade));
where,
$accept = base64_encode(SHA1($key."258EAFA5-E914-47DA-95CA-C5AB0DC85B11", true));
$key is Sec-WebSocket-Key got from $buffer, you can print_r($buffer) to have a look.
Hope this can solve your problem..