-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
190.4.67.219 runtime error: index out of range #7
Comments
I dont know if this is similar, but I also have an index out of range error, what ever is the IP I test goroutine 15 [running]: |
@aurellenb Have you downloaded an loaded the correct MaxMind GeoIP database? |
Yes, and we use it in production. |
Which DB are you using? I need to reproduce the error before fixing the bug. |
GeoLite Country (Binary) |
As somebody who ran into this issue, this is fixed by using the legacy database as opposed to the newest format. (as above) For an example of using this take a quick look at my repo: https://github.com/ThomasRooney/GeoIP-echo. It grabs and unzips the relevant database itself using wget and gz. Thanks @vanbroup |
I'm getting the following error with some IP addresses:
190.4.67.219 runtime error: index out of range
/opt/_/src/ip/ip2country.go:32 (0x535a1e)
func.001: debug.PrintStack()
/usr/local/go/src/pkg/runtime/panic.c:229 (0x413581)
/usr/local/go/src/pkg/runtime/panic.c:487 (0x413d23)
/usr/local/go/src/pkg/runtime/panic.c:442 (0x413b55)
/opt/gopkg/src/github.com/nranchev/go-libGeoIP/libgeo.go:223 (0x5a1be1)
com/nranchev/go-libGeoIP.(_GeoIP).GetLocationByIPNum: location.CountryCode = countryCode[offset-countryBegin]
/opt/gopkg/src/github.com/nranchev/go-libGeoIP/libgeo.go:204 (0x5a1a85)
com/nranchev/go-libGeoIP.(GeoIP).GetLocationByIP: return gi.GetLocationByIPNum(AddrToNum(ip))
/opt/_/src/ip/ip2country.go:37 (0x5354a3)
Ip2country: loc := gi.GetLocationByIP(ip.String())
/opt/__/src/***/program.go:171 (0x4617ec)
saveCert: ipcountry := ip.Ip2country(conn.RemoteAddr().(net.TCPAddr).IP)
/opt/******/src/**_****/program.go:142 (0x461622)
queue: doSomething(next)
/usr/local/go/src/pkg/runtime/proc.c:1223 (0x4170e0)
The text was updated successfully, but these errors were encountered: