2014-03-25 Forecast::IO 599 Internal Exception
Forecast.io provide great public weather data service API. They also provide SDK for many languages which is very friendly to developers.
However if you are using their Perl module Forecast::IO, maybe you will have this error when you try to install it
1
Running make test
2
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
3
t/forecast.t .. # Please enter your Forecast.io API key:
4
xxxxxxxxxxxxxxxxxxxx
5
Request to 'https://api.forecast.io/forecast/xxxxxxxxxxxxxxxxxxxx/43.6667,-79.4167,1373241600?units=auto' failed: 599 Internal Exception
6
# Looks like your test exited with 255 before it could output anything.
7
t/forecast.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
8
Failed 6/6 subtests
Copied!
The root cause of this error is Forecast::IO use HTTP::Tiny for HTTP request. And HTTP::Tiny need Net::SSLeay module to access HTTPS url. If the module was not installed HTTP::Tiny would only say 599 error and you can't know the real reason unless you look into the code and try it like below.
1
$ perl -e "use HTTP::Tiny; use Data::Dumper; print Dumper(HTTP::Tiny->new>get('https://api.forecast.io/forecast/xxxxxxxxxxxxxxxxxxxx/43.6667,-79.4167,1373241600?units=auto'));"
2
$VAR1 = {
3
'success' => '',
4
'headers' => {
5
'content-type' => 'text/plain',
6
'content-length' => 53
7
},
8
'status' => 599,
9
'content' => 'Net::SSLeay 1.49 must be installed for https support',
10
'reason' => 'Internal Exception',
11
'url' => 'https://api.forecast.io/forecast/xxxxxxxxxxxxxxxxxxxx/43.6667,-79.4167,1373241600?units=auto'
12
};
Copied!
This is really a confused way to report this error.
Anyway, to fix this issue you only need to install the module Net::SSLeay
1
sudo perl -MCPAN -e 'install Net::SSLeay'
Copied!
最近更新 1yr ago
复制链接