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

DBIP GeoIP (php) geolocation does not show as installed #17714

Closed
kevin-shelaga opened this issue Jun 27, 2021 · 12 comments
Closed

DBIP GeoIP (php) geolocation does not show as installed #17714

kevin-shelaga opened this issue Jun 27, 2021 · 12 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. invalid For issues or pull requests that are no longer relevant to Matomo core. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@kevin-shelaga
Copy link

kevin-shelaga commented Jun 27, 2021

After downloading/extracting/renaming DBIP-City.mmdb to the misc directory the DBIP GeoIP 2 (php) doe not show as installed. I can see the current location gets updated from USA to Canada, which is correct, so I assume the file is being detected.

Expected Behavior

Should show as selectable and installed

Current Behavior

Not selectable and not installed

Possible Solution

None

Steps to Reproduce (for Bugs)

Context

Matomo 4.3.1

Your Environment

  • Matomo Version:
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:
  • Browser:
  • Operating System:
@kevin-shelaga kevin-shelaga added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jun 27, 2021
@diosmosis diosmosis added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Jun 27, 2021
@diosmosis
Copy link
Member

Hi @kevin-shelaga, thanks for the report! I can reproduce this locally. When I change the name of my database to DBIP-City.mmdb, the location provider is suddenly unavailable.

Note: you could workaround this by changing the name of the file to GeoLite2-City.mmdb. It shouldn't affect the result of geolocation just get Matomo to recognize it's existence.

@kevin-shelaga
Copy link
Author

@diosmosis I couldnt get the work around to work. I have renamed the file but still geolocation does not show as installed.

/matomo/misc$ ls -l
total 96664
-rw-r--r-- Jun 27 12:35 GeoLite2-City.mmdb
drwxrwxr-x Jun 27 11:58 user

@diosmosis
Copy link
Member

@kevin-shelaga actually it seems I made a mistake when testing, looking again it's working for me. Can you check if the user your webserver runs as can see the file? Eg, checking if <?php echo file_exists('/matomo/misc/GeoLite2-City.mmdb'); works when run in a web request.

@kevin-shelaga
Copy link
Author

@diosmosis The file exists but it's at /etc/bitnami/matomo/misc/

I wonder if that's the issue, matomo isn't expecting the bitnami subdirectory?

@diosmosis
Copy link
Member

@kevin-shelaga it shouldn't be, I just didn't know where the root directory for matomo was so I put the same path you put. Everything will be relative to the matomo root directory.

@kevin-shelaga
Copy link
Author

@diosmosis Does the user require root access?

@diosmosis
Copy link
Member

@kevin-shelaga the user that whatever is running the matomo PHP scripts (eg, php-fpm or apache or something else) needs to have access to the file in the misc directory. I'm assuming you added it there yourself and didn't use the UI downloader in the admin settings, correct?

@kevin-shelaga
Copy link
Author

The UI download worked though I'm still not sure why I can't get the file I downloaded to work as the user (1001) does own the file.

Thank you for all your help @diosmosis

@kevin-shelaga
Copy link
Author

@diosmosis I just wanted to let you know that the UI stuck the mmdb file under /misc/user and not under /misc, so im guessing this is why the file i added was not being registered.

@diosmosis
Copy link
Member

That's interesting, it works for me in the /misc directory. I guess there are some configuration differences between my local setup and however you're deploying (I'm guessing docker?).

@kevin-shelaga
Copy link
Author

Yes, it is the bitnami docker image. But it's pretty basic, standard configuration.

@mattab mattab added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. invalid For issues or pull requests that are no longer relevant to Matomo core. labels Jul 26, 2021
@oktak
Copy link

oktak commented Dec 23, 2021

[FYI] I use bitnami's matomo docker image too. My case is the UI download seems not work for me (I deployed the docker image on Oracle Cloud, perhaps some network issues I didn't solved).

I inspected the running docker container, the DBIP-City.mmdb file should be placed in /opt/bitnami/matomo/misc folder inside the docker container. This path /opt/bitnami/matomo is the place that those .php files locate.

Meanwhile, their example docker-compose.yaml is mounting like matomo_data:/bitnami/matomo where the config/config.ini.php is locating at.

My screenshot:
Screenshot from 2021-12-23 09-10-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. invalid For issues or pull requests that are no longer relevant to Matomo core. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

4 participants