alexreisner/geocoder

MaxMind Local not work

amowu opened this issue ยท 5 comments

amowu commented

BEFORE POSTING AN ISSUE, PLEASE MAKE SURE THE PROBLEM IS NOT ADDRESSED IN THE README!

Expected behavior

I an follow https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md#maxmind-local-maxmind_local---experimental steps

When I run:

# generate migration to create tables
rails generate geocoder:maxmind:geolite_city

I got correct DB tables.

And When I run:

# download, unpack, and import data
rake geocoder:maxmind:geolite:load PACKAGE=city LICENSE_KEY=<KEY>

It should be work.

Actual behavior

But it got:

SocketError: Failed to open TCP connection to geolite.maxmind.com:80 (getaddrinfo: nodename nor servname provided, or not known)


Caused by:
SocketError: getaddrinfo: nodename nor servname provided, or not known

Tasks: TOP => geocoder:maxmind:geolite:load => geocoder:maxmind:geolite:download
(See full trace by running task with --trace)

Steps to reproduce

https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md#maxmind-local-maxmind_local---experimental steps

Environment info

  • Geocoder version: 1.8.1
  • Rails version: 6.1.6.1
  • Database (if applicable):
  • Lookup (if applicable):

Is this problem solve after this PR ? ๐Ÿ™๐Ÿป

amowu commented

Is this problem solve after this PR ? ๐Ÿ™๐Ÿป

@RongRongTeng you are right.

#1600 merge only the latest version of the master branch has the LICENSE_KEY.

The current version 1.8.1 does not have the LICENSE_KEY option.

But even if I change it to the master version, it still doesn't work.

- gem 'geocoder', '1.8.1'
+ gem 'geocoder', github: 'alexreisner/geocoder', ref: '3f9e9'

237614869-f75f7f91-a96a-4bf7-9b24-b75b25c63f84

The reason is that at line 33, it calls archive_url_path:

p = archive_url_path(package)

But in #1600, this method has already been renamed:

https://github.com/alexreisner/geocoder/pull/1600/files#diff-e70a403b9d56449ef46d7338bfa456ed872a01a51a8f5ac7a8a058137ece6eaaL97-R97

cc @coder2000

I thought I had accounted for all instances of the method calls. I will have a fix available for testing tomorrow if someone else doesn't do it first.

@coder2000 did you end up building a fix?

No. If I remember they changed their download URIs. It shouldn't be too hard to find the new ones and add them.