【发布时间】:2020-02-02 20:47:22
【问题描述】:
在过去一周的某个时候,我开始收到使用 URL 并检索内容的代码的错误。
这使用 Perl 模块 LWP::Simple
模块或我们的代码没有任何更改。服务器主机说没有任何变化。
http 或 https 会发生这种情况
它发生在我们托管的域之外。
来自其他服务器的 URL 不会发生这种情况。
这是错误
Result: $VAR1 = bless( { '_content' => 'Can\'t connect to coloradosportscards.ultimatecardstore.com:443 (Name or service not known) Name or service not known at /usr/local/share/perl5/LWP/Protocol/http.pm line 52. ',
'_rc' => 500,
'_headers' => bless( { 'client-warning' => 'Internal response', 'client-date' => 'Sun, 02 Feb 2020 19:40:24 GMT',
'content-type' => 'text/plain',
'::std_case' => { 'client-warning' => 'Client-Warning', 'client-date' => 'Client-Date' } }, 'HTTP::Headers' ),
'_msg' => 'Can\'t connect to coloradosportscards.ultimatecardstore.com:443 (Name or service not known)', '_request' => bless( { '_content' => '',
'_uri' => bless( do{\(my $o = 'https://coloradosportscards.ultimatecardstore.com/online_store/store/images/0000697417.jpg')},
'URI::https' ),
'_headers' => bless( { 'user-agent' => 'Mozilla/5.0' },
'HTTP::Headers' ), '_method' => 'GET' },
'HTTP::Request' ) },
'HTTP::Response' );
我们正在尝试访问此图像,它存在
https://coloradosportscards.ultimatecardstore.com/online_store/store/images/0000697417.jpg
提前感谢您的关注
迈克
【问题讨论】:
-
你安装了 LWP::Protocol::https 吗?
-
是的,LWP::Protocol::Https 6.07版这段代码已经工作多年了
-
似乎是 DNS 或 /etc/hosts 中的问题。
-
由于错误 500 是一般的服务器错误,我怀疑问题出在这一端,而不是代码或运行代码的环境。我知道你说他们说没有任何改变,但这可能是升级或改变他们没有意识到导致问题的任何数量的事情。您可以使用 curl 或其他方式从服务器上拉下图像以确认它可以访问吗?
-
perl -MLWP::Simple -e "getprint('coloradosportscards.ultimatecardstore.com/online_store/store/…)" 对我来说很好用。您能否分享代码或提供重现问题的最小示例?