尝试更新 geoip 得到错误 -21 - 它一直在工作直到最近
Posted
技术标签:
【中文标题】尝试更新 geoip 得到错误 -21 - 它一直在工作直到最近【英文标题】:trying to update geoip gets error -21 - It has been working until recently 【发布时间】:2019-08-31 14:49:37 【问题描述】:我已经下载 geoip lite 数据库很长时间了。但是,某处发生了一些变化,导致错误 -21。这是详细的输出:
sudo geoipupdate -v
Opened License file /etc/GeoIP.conf
Read in license key 000000000000
number of product ids 2
Connecting to MaxMind GeoIP server
via Host or Proxy Server: updates.maxmind.com:80
sending request GET /app/update_getfilename?product_id=506 HTTP/1.0
Host: updates.maxmind.com
database product id 506 database file name /usr/share/GeoIP/GeoLiteCountry.dat
/usr/share/GeoIP/GeoLiteCountry.dat can't be opened, proceeding to download database
MD5 sum of database /usr/share/GeoIP/GeoLiteCountry.dat is 0000000000000000000000000000000
Connecting to MaxMind GeoIP Update server
sending request GET /app/update_getipaddr HTTP/1.0
Host: updates.maxmind.com
client ip address: 162.230.29.192
md5sum of ip address and license key is b2e7d4d48d92ec691a3f67b6d861e1bb
sending request GET /app/update_secure?db_md5=0000000000000000000000000000000&challenge_md5=b2e7d4d48d92ec691a3f67b6d861e1bb&user_id=999999&edition_id=506 HTTP/1.0
Host: updates.maxmind.com
Downloading gzipped GeoIP Database...
Done
Updating /usr/share/GeoIP/GeoLiteCountry.dat
Saving gzip file to /usr/share/GeoIP/GeoLiteCountry.dat.gz ... download data to a gz file named /usr/share/GeoIP/GeoLiteCountry.dat.gz
Done
Uncompressing gzip file ... Done
Performing sanity checks ... Database type is 1
database_info FAIL null
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
Connecting to MaxMind GeoIP server
via Host or Proxy Server: updates.maxmind.com:80
sending request GET /app/update_getfilename?product_id=533 HTTP/1.0
Host: updates.maxmind.com
database product id 533 database file name /usr/share/GeoIP/GeoLiteCity.dat
/usr/share/GeoIP/GeoLiteCity.dat can't be opened, proceeding to download database
MD5 sum of database /usr/share/GeoIP/GeoLiteCity.dat is 0000000000000000000000000000000
md5sum of ip address and license key is b2e7d4d48d92ec691a3f67b6d861e1bb
sending request GET /app/update_secure?db_md5=0000000000000000000000000000000&challenge_md5=b2e7d4d48d92ec691a3f67b6d861e1bb&user_id=999999&edition_id=533 HTTP/1.0
Host: updates.maxmind.com
Downloading gzipped GeoIP Database...
Done
Updating /usr/share/GeoIP/GeoLiteCity.dat
Saving gzip file to /usr/share/GeoIP/GeoLiteCity.dat.gz ... download data to a gz file named /usr/share/GeoIP/GeoLiteCity.dat.gz
Done
Uncompressing gzip file ... Done
Performing sanity checks ... Database type is 1
database_info FAIL null
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
我不清楚 dat 文件是否没有下载(每个都收到“无法打开”)消息,这可能是正常的。或者,如果解压缩时发生了导致更新无法通过完整性检查的问题。有人可以帮我解决这个问题吗? TIA。
【问题讨论】:
【参考方案1】:GeoLite Legacy 为 discontinued。您的geoipupdate
版本给出的错误似乎不是特别有用。较新版本的geoipupdate
说404 Not Found: Database edition not found
。
【讨论】:
感谢您的回复。有免费更换还是现在才付费? 我想有,但我需要找到有关如何使用 GeoIP2 配置 awstats 的信息。目前只能找到旧版的。以上是关于尝试更新 geoip 得到错误 -21 - 它一直在工作直到最近的主要内容,如果未能解决你的问题,请参考以下文章
maxmind free geoip DB返回错误的国家/地区
GeoIP IPv4 数据库返回不正确的国家代码 - 需要 GeoIP 更新?
在 Windows 上安装 GeoIP-Python 时出错