talexb has asked for the wisdom of the Perl Monks concerning the following question:
I'm hoping that this is something obvious, but frankly it's a little puzzling for me. This is a server I set up last month, and now that it's time to expand the library of Perl modules, I'm having an unexpected error from cpan:
$sudo cpan install LWP::UserAgent Loading internal null logger. Install Log::Log4perl for logging messag +es Reading '/home/web/.cpan/Metadata' Database was generated on Mon, 05 Feb 2018 20:17:03 GMT Fetching with HTTP::Tiny: http://www.cpan.org/authors/01mailrc.txt.gz HTTP::Tiny failed with code[403] message[Forbidden: header 'Content-Ty +pe' value denied] Trying with /usr/bin/wget -O "/home/web/.cpan/sources/authors/01mailrc.txt.gz. +tmp16849" to get http://www.cpan.org/authors/01mailrc.txt.gz --2018-03-01 10:37:25-- http://www.cpan.org/authors/01mailrc.txt.gz Resolving www.cpan.org (www.cpan.org)... 151.101.194.49, 151.101.130.4 +9, 151.101.66.49, ... Connecting to www.cpan.org (www.cpan.org)|151.101.194.49|:80... connec +ted. HTTP request sent, awaiting response... 403 Forbidden: header 'Content +-Type' value denied 2018-03-01 10:37:25 ERROR 403: Forbidden: header 'Content-Type' value +denied. Function system("/usr/bin/wget -O "/home/web/.cpan/sources/authors +/01mailrc.txt.gz.tmp16849" "http://www.cpan.org/authors/01mailrc.txt. +gz" ") returned status 8 (wstat 2048), left /home/web/.cpan/sources/authors/01mailrc.txt.gz.tmp16849 with size 0 Warning: no success downloading '/home/web/.cpan/sources/authors/0 +1mailrc.txt.gz.tmp16849'. Giving up on it.
If I try just doing a wget on the file, I get pretty much the same thing:
$ wget --debug http://www.cpan.org/authors/01mailrc.txt.gz >foo.gz DEBUG output created by Wget 1.19.1 on linux-gnu. Reading HSTS entries from /home/web/.wget-hsts URI encoding = ‘UTF-8’ Converted file name '01mailrc.txt.gz' (UTF-8) -> '01mailrc.txt.gz' (UT +F-8) --2018-03-01 11:02:48-- http://www.cpan.org/authors/01mailrc.txt.gz Resolving www.cpan.org (www.cpan.org)... 151.101.194.49, 151.101.130.4 +9, 151.101.66.49, ... Caching www.cpan.org => 151.101.194.49 151.101.130.49 151.101.66.49 15 +1.101.2.49 2a04:4e42:600::561 2a04:4e42:400::561 2a04:4e42:200::561 2 +a04:4e42::561 Connecting to www.cpan.org (www.cpan.org)|151.101.194.49|:80... connec +ted. Created socket 3. Releasing 0x00005625bd526e10 (new refcount 1). ---request begin--- GET /authors/01mailrc.txt.gz HTTP/1.1 User-Agent: Wget/1.19.1 (linux-gnu) Accept: */* Accept-Encoding: identity Host: www.cpan.org Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.0 403 Forbidden: header 'Content-Type' value denied Content-type: text/html; charset="iso-8859-1" ---response end--- 403 Forbidden: header 'Content-Type' value denied Registered socket 3 for persistent reuse. URI content encoding = ‘"iso-8859-1"’ ] done. 2018-03-01 11:02:48 ERROR 403: Forbidden: header 'Content-Type' value +denied.
It seems like it's trying to use a content type of text/html to get a zip file -- which is obviously wrong. But this is a new server, without any weird fancy configuration. Can someone suggest something? Thanks.
Update at 1158 ET: It seems there might be a host problem:
I wonder if this host is mis-configured.Err:4 http://ca.archive.ubuntu.com/ubuntu artful/main amd64 perl-opens +sl-defaults amd64 3 403 Forbidden: header 'Content-Type' value denied [IP: 91.189.88.15 +2 80] Err:5 http://ca.archive.ubuntu.com/ubuntu artful/universe amd64 libcry +pt-ssleay-perl amd64 0.73.04-2build1 403 Forbidden: header 'Content-Type' value denied [IP: 91.189.88.15 +2 80]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Content-type error trying to run cpan
by talexb (Chancellor) on Mar 05, 2018 at 20:00 UTC |