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

Could not find GeoIP data file in data directories. #40

Open
hellais opened this issue Sep 17, 2018 · 0 comments
Open

Could not find GeoIP data file in data directories. #40

hellais opened this issue Sep 17, 2018 · 0 comments
Labels
bug Something isn't working linux-packaging

Comments

@hellais
Copy link
Member

hellais commented Sep 17, 2018

@paperbag commented on Wed Apr 18 2018

Description

I found that ooniprobe dashboard doesn't show my location and AS numbers properly.
ooniprobe-screenshot

I look up the logs. These are many message like that:

2018-04-18 16:39:56,330899+0800 [HTTP11ClientProtocol,client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf
2018-04-18 16:39:56,331411+0800 [HTTP11ClientProtocol,client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf
2018-04-18 16:39:56,331891+0800 [HTTP11ClientProtocol,client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf
2018-04-18 16:39:56,332662+0800 [HTTP11ClientProtocol,client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf
[...]

Then I found ooniresources --update-geoip is deprecated.

root@debian:~# ooniresources --help
/usr/bin/ooniresources
    [DEPRECATED] Usage of this script is deprecated and it will be deleted
    in future versions of ooniprobe.
Options:
      --update-inputs  (deprecated) update the resources needed for inputs.
      --update-geoip   (deprecated) Update the geoip related resources.
      --version        
      --help           Display this help and exit.

So I don't know how to solve this problem.

Steps to Reproduce

Expected behavior: show my location and AS numbers properly.

Actual behavior: show AS number is AS0, and location is ZZ.

Further information

How did you install ooniprobe

Debian package, following the OONIPROBE: Installation Guide. Then I run ooniprobe --web-ui.

What operating system are you running and what version is it?

Debian Jessie

Output of `ooniprobe -v --info`
root@debian:~# ooniprobe -v --info
Paths
-----
inputs directory: /var/lib/ooni/inputs
scheduler directory: /var/lib/ooni/scheduler
resources directory: /var/lib/ooni/resources
decks available directory: /opt/venvs/ooniprobe/share/ooni/decks-available
decks enabled directory: /var/lib/ooni/decks-enabled
measurements directory: /var/lib/ooni/measurements
running path: /var/lib/ooni
config files: /var/lib/ooni/ooniprobe.conf,/etc/ooniprobe.conf
ooni home: /root/.ooni
var_lib path: /opt/venvs/ooniprobe/var/lib/ooni
etc path: /opt/venvs/ooniprobe/etc
usr_share path: /opt/venvs/ooniprobe/share/ooni
nettest directory: /opt/venvs/ooniprobe/lib/python2.7/site-packages/ooniprobe-2.2.0-py2.7.egg/ooni/nettests
web ui directory: /opt/venvs/ooniprobe/lib/python2.7/site-packages/ooniprobe-2.2.0-py2.7.egg/ooni/ui/web/client
Output of `ooniprobe --version`
ooniprobe version: 2.2.0

@hellais commented on Wed Apr 18 2018

Hi @paperbag thanks for reporting this.

This could be an issue with the debian package.

From the screenshots you posted it seems like the system daemon is not running (as it says not running).

Is this a fresh install of ooniprobe? If so you may want to wait a bit for the system daemon to properly start and download the required resources to properly resolve your IP address.

In any case can you check that ooniprobe-agent is running by doing: ps aux | grep ooniprobe-agent?

If that does show up something, then I would suggest you just wait a bit for it to download the required resources.


@paperbag commented on Wed Apr 18 2018

Is this a fresh install of ooniprobe?

Yes.

In any case can you check that ooniprobe-agent is running by doing: ps aux | grep ooniprobe-agent?

I just restart my machine.

root@debian:~# ps aux | grep ooniprobe-agent
root      2090  0.0  0.2  12728  2200 pts/6    S+   18:02   0:00 grep ooniprobe-agent

Now it says running.
ooniprobe-screenshot-2

And it still show Location: ZZ (AS0).

The following log as shown on http://127.0.0.1:8842/client/#/logs:

[...]
2018-04-18 17:50:20,221016+0800 [-] Removing stale pidfile /var/lib/ooni/twistd.pid
2018-04-18 17:50:21,025236+0800 [HTTP11ClientProtocol,client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf
2018-04-18 17:59:56,176178+0800 [-] Removing stale pidfile /var/lib/ooni/twistd.pid
2018-04-18 17:59:57,190161+0800 [HTTP11ClientProtocol,client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf
2018-04-18 18:01:46,279999+0800 [HTTPPageDownloader (TLSMemoryBIOProtocol),client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf
2018-04-18 18:01:49,193193+0800 [HTTPPageGetter (TLSMemoryBIOProtocol),client] [!] Could not find GeoIP data file in data directories.Try running ooniresources or edit your ooniprobe.conf

This could be an issue with the debian package.

May be should I install ooniprobe from git repository?


@hellais commented on Wed Apr 18 2018

Humm. It's strange though that you don't see a ooniprobe-agent running, given that you can access the local web server.

Did you run the ps command while you had the web UI open?

Other things to try:

Do you have systemd on your machine?

If so you should check if inside of /etc/systemd/system you have something similar to this: https://github.com/OpenObservatory/ooniprobe-fpm/blob/master/conf/debian/systemd/ooniprobe.service.

If not you should create that file and enable the service by running:

systemctl enable ooniprobe.service
systemctl start ooniprobe

(I believe this is the correct syntax)


@hellais commented on Wed Apr 18 2018

@irl do you know what may be going on here?


@paperbag commented on Wed Apr 18 2018

Did you run the ps command while you had the web UI open?

Yes.

Do you have systemd on your machine?

If so you should check if inside of /etc/systemd/system you have something similar to this: https://github.com/OpenObservatory/ooniprobe-fpm/blob/master/conf/debian/systemd/ooniprobe.service.

I can't found /etc/systemd/system/ooniprobe.service. So I create that file.

root@debian:~# systemctl enable ooniprobe.service
Created symlink from /etc/systemd/system/multi-user.target.wants/ooniprobe.service to /etc/systemd/system/ooniprobe.service.
root@debian:~# systemctl start ooniprobe
Job for ooniprobe.service failed. See 'systemctl status ooniprobe.service' and 'journalctl -xn' for details.
root@debian:~# systemctl status ooniprobe.service
● ooniprobe.service - ooniprobe-agent system service
   Loaded: loaded (/etc/systemd/system/ooniprobe.service; enabled)
   Active: failed (Result: exit-code) since Wed 2018-04-18 18:55:19 HKT; 59s ago
     Docs: man:ooniprobe(1)
           https://ooni.torproject.org/
  Process: 2252 ExecStart=/usr/bin/ooniprobe-agent start (code=exited, status=217/USER)

Apr 18 18:55:19 debian systemd[1]: Starting ooniprobe-agent system service...
Apr 18 18:55:19 debian systemd[2252]: Failed at step USER spawning /usr/bin/ooniprobe-agent: No such process
Apr 18 18:55:19 debian systemd[1]: ooniprobe.service: control process exited, code=exited status=217
Apr 18 18:55:19 debian systemd[1]: Failed to start ooniprobe-agent system service.
Apr 18 18:55:19 debian systemd[1]: Unit ooniprobe.service entered failed state.
root@debian:~# 

So I edited ooniprobe.service like that :

[...]
[Service]
#User=debian-ooni
User=root
Type=forking
ExecStart=/usr/bin/ooniprobe-agent start
ExecStop=/usr/bin/ooniprobe-agent stop
PIDFile=/var/lib/ooni/twistd.pid
[...]

Then run systemctl status ooniprobe.service.

root@debian:~# systemctl status ooniprobe.service
● ooniprobe.service - ooniprobe-agent system service
   Loaded: loaded (/etc/systemd/system/ooniprobe.service; enabled)
   Active: failed (Result: exit-code) since Wed 2018-04-18 19:05:38 HKT; 39s ago
     Docs: man:ooniprobe(1)
           https://ooni.torproject.org/
  Process: 2307 ExecStart=/usr/bin/ooniprobe-agent start (code=exited, status=1/FAILURE)

Apr 18 19:05:37 debian ooniprobe-agent[2307]: An error has occurred: b"CannotListenError: Couldn't listen on 127.0.0.1:8842: [Errno ...n use."
Apr 18 19:05:37 debian ooniprobe-agent[2307]: Please look at log file for more information.
Apr 18 19:05:37 debian systemd[1]: ooniprobe.service: control process exited, code=exited status=1
Apr 18 19:05:38 debian systemd[1]: Failed to start ooniprobe-agent system service.
Apr 18 19:05:38 debian systemd[1]: Unit ooniprobe.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
root@debian:~# 

It says couldn't listen on 127.0.0.1:8842. I run lsof -i :8842 command, founding that port is used by ooniprobe.

root@debian:~# lsof -i :8842
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
firefox-e 1551 root   45u  IPv4  20792      0t0  TCP localhost:44731->localhost:8842 (ESTABLISHED)
firefox-e 1551 root   48u  IPv4  23703      0t0  TCP localhost:44863->localhost:8842 (ESTABLISHED)
firefox-e 1551 root   49u  IPv4  21280      0t0  TCP localhost:44752->localhost:8842 (ESTABLISHED)
ooniprobe 1827 root   14u  IPv4  20793      0t0  TCP localhost:8842->localhost:44731 (ESTABLISHED)
ooniprobe 1827 root   15u  IPv4  20086      0t0  TCP localhost:8842 (LISTEN)
ooniprobe 1827 root   17u  IPv4  23704      0t0  TCP localhost:8842->localhost:44863 (ESTABLISHED)
ooniprobe 1827 root   22u  IPv4  21281      0t0  TCP localhost:8842->localhost:44752 (ESTABLISHED)
root@debian:~# 

@hellais commented on Wed Apr 18 2018

Ok I see.

So I think the debian package you used is broken. This is not the expected behaviour. cc @irl

I think I know how you can fix this though.

Try going through these steps:

  1. Kill the ooniprobe process you started with ooniprobe --web-ui
  2. Fixup the permissions of the ooniprobe paths by doing (from root or with sudo):
chown -R Debian-ooni /var/lib/ooni
chown -R Debian-ooni /var/log/ooni
  1. Determine what is the correct path for ooniprobe-agent by running which ooniprobe-agent
  2. Take the path from 3 and replace /usr/bin/ooniprobe-agent in ooniprobe.service with that path
  3. Reinstate the systemd service
systemctl reload ooniprobe.service
systemctl start ooniprobe.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux-packaging
Projects
None yet
Development

No branches or pull requests

1 participant