Skip to content
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

Geo location should detect country, region and city from IPv6 addresses #3581

Closed
anonymous-matomo-user opened this issue Nov 26, 2012 · 20 comments
Labels
answered For when a question was asked and we referred to forum or answered it. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

Notice: geoip_country_code_by_name(): Host 2607:f878:fe00:19::2 not found in /srv/www/christoph/www-root/de/siccegge/stats/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php on line 80

Backtrace -->

#0 Piwik_ErrorHandler(...) called at [:]
#1 geoip_country_code_by_name(...) called at [/srv/www/christoph/www-root/de/siccegge/stats/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php:80]
#2 Piwik_UserCountry_LocationProvider_GeoIp_Pecl->getLocation(...) called at [/srv/www/christoph/www-root/de/siccegge/stats/plugins/UserCountry/LocationProvider.php:229]
#3 Piwik_UserCountry_LocationProvider::getAllProviderInfo(...) called at [/srv/www/christoph/www-root/de/siccegge/stats/plugins/UserCountry/Controller.php:40]
#4 Piwik_UserCountry_Controller->adminIndex(...) called at [:]
#5 call_user_func_array(...) called at [/srv/www/christoph/www-root/de/siccegge/stats/core/FrontController.php:138]
#6 Piwik_FrontController->dispatch(...) called at [/srv/www/christoph/www-root/de/siccegge/stats/index.php:53]
@anonymous-matomo-user
Copy link
Author

Attachment: Patch for Piwik's bundled MaxMind PHP GeoIP libs
maxmind-libs-ipv6.patch

@anonymous-matomo-user
Copy link
Author

The PECL GeoIP doesn't support IPv6 yet. However, a patch is available here: https://bugs.php.net/bug.php?id=59124

I've attached a patch to make piwik's MaxMind PHP lib play nice with the other patch.

@anonymous-matomo-user
Copy link
Author

Attachment: GeoIP changes for IPv6
piwik-geoip-ipv6.patch

@anonymous-matomo-user
Copy link
Author

Here's a somewhat complete changeset that would be required for IPv6 Support.

I have tested it on Fedora 18: Apache 2.4 with PHP 5.4.9, latest mod_geoip2 master branch from https://github.com/maxmind/geoip-api-mod_geoip2 (should work on 1.2.7 though) and patched PECL GeoIP with Patch from https://bugs.php.net/bug.php?id=59124

Haven't tested on non patched/stable environment yet as I didn't have the time to set up a clean VM for that yet. So I'd appreciate any testing :)

@mattab
Copy link
Member

mattab commented Dec 13, 2012

@heffer Thanks for the patch. It does look interesting and we would like to consider committing the patch. Can you please add some tests? For example maybe you could update this test: ManyVisitorsOneWebsiteTest.php

See test instructions: https://github.com/piwik/piwik/blob/master/tests/README.txt

with tests we can safely consider the code and check it's working!

@anonymous-matomo-user
Copy link
Author

I will look into writing the tests during the Christmas break because I'm pretty busy right now. If you need it before then we'd need to find someone else to do it.

@mattab
Copy link
Member

mattab commented Dec 14, 2012

We don't need it quickly (it is a bonus for us that you worked on it), after Christmas will be perfect, thanks so much!

@mattab
Copy link
Member

mattab commented Mar 11, 2013

@heffer any update on Geoip with ipv6 support? thanks for your time!

@anonymous-matomo-user
Copy link
Author

bump! hello everybody... is there a patch for ipv6 adresses? many thanks!

@anonymous-matomo-user
Copy link
Author

I stopped working on this after noticing that the tests were somewhat broken. I can't remember what the exact issue was, it's been some months. However, currently I can't find the time to work on this right now.

@anonymous-matomo-user
Copy link
Author

thanks for the answer. Actually I opened another ticked because i noticed that there are two free databases http://dev.maxmind.com/geoip/legacy/geolite/
one for ipv4 and one for ipv6

it is not possible to simply merge the two databases? (noob question probably)

@anonymous-matomo-user
Copy link
Author

Could you maybe update the patch against the current release?

Was it already considered by the devs maybe? Anything wrong with it?

@mattab
Copy link
Member

mattab commented Jan 28, 2014

The patch looks fine! I'd like to commit it to Piwik. If you can make a pull request (after testing that it works), we will do our best to merge quickly! cheers

@mattab
Copy link
Member

mattab commented May 14, 2014

see also #4487: New feature: Make geoip backend work with geoip2

@mattab
Copy link
Member

mattab commented Jun 16, 2014

see also: #5348 GeoIP Server (Apache module) compatibility with IP V6

@mygithuber
Copy link

There seems to be an aggravation, noticed in Piwik v2.8.1:
Visitor log doesn't show visitor's provider if it comes with an IPv6 adress, pls notice attached screenshot (label "unbekannt" ) .
Settings: GeoIP(PECL) is working with Maxmind's 'GeoLite City', visitor's privacy is set as shown in screenshot.

Pls look at #4391 too.

367b71ca-5a8b-11e4-834d-047
2a6a2674-5a8b-11e4-80b8-ded6210fac35

@mattab
Copy link
Member

mattab commented Oct 23, 2014

@mygithuber thanks for the report! Can you please create a new issue with your report? it will help schedule work on the fix faster. thanks!

for more info on how we manage backlog http://developer.piwik.org/guides/core-team-workflow#how-we-organise-issues

@mattab
Copy link
Member

mattab commented Nov 3, 2014

Check out the Pull request being discussed: IPv6 support #6574

@mattab
Copy link
Member

mattab commented Oct 2, 2015

see
Geo location support for IPv6 addresses #6690
Geo location ipv6 for PECL extension #6624
#5348

@mattab mattab closed this as completed Oct 2, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 2, 2015
@evgenij8585
Copy link

you will be helped by service Geolocation IpV4, IpV6, domains name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants