openvenues / libpostal

A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
MIT License
4.04k stars 417 forks source link

Error loading geodb module #16

Closed eater closed 8 years ago

eater commented 8 years ago

I just installed on a Debian system, following the step-by-step instructions in the readme. Then I tried running the parser from the command line, and got this error:

# ./address_parser
Loading models...
ERR   Error loading geodb module
   at libpostal_setup_parser (libpostal.c:1071) errno: None

I made sure the data directory is world-readable. What am I missing?

albarrentine commented 8 years ago

Hm, do you have enough disk space? It sounds like something didn't download.

albarrentine commented 8 years ago

Assuming the disk isn't full, can you remove anything in the data directory, run make again from your source checkout, and post the output?

eater commented 8 years ago

Yes, plenty of disk space free. I removed everything from the data directory and ran make again, and I still get the error:

root@Nvidia /usr/local/src/libpostal
 # make                                      
make  all-recursive
make[1]: Entering directory `/usr/local/src/libpostal'
Making all in src
make[2]: Entering directory `/usr/local/src/libpostal/src'
Making all in sparkey
make[3]: Entering directory `/usr/local/src/libpostal/src/sparkey'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/usr/local/src/libpostal/src/sparkey'
make[3]: Entering directory `/usr/local/src/libpostal/src'
./libpostal_data download all /usr/local/libpostal-data/libpostal
Checking for new libpostal data file...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0  9.9M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
New libpostal data file available
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9.9M  100  9.9M    0     0  7328k      0  0:00:01  0:00:01 --:--:-- 7327k
address_expansions/
address_expansions/address_dictionary.dat
numex/
numex/numex.dat
transliteration/
transliteration/transliteration.dat
Checking for new libpostal geodb data file...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0  464M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
New libpostal geodb data file available
Downloading multipart: http://libpostal.s3.amazonaws.com/geodb.tar.gz, size=486746092
Downloading part 1: filename=/usr/local/libpostal-data/libpostal/geodb.tar.gz.1, offset=0, max=97349217
Downloading part 2: filename=/usr/local/libpostal-data/libpostal/geodb.tar.gz.2, offset=97349218, max=194698435
Downloading part 3: filename=/usr/local/libpostal-data/libpostal/geodb.tar.gz.3, offset=194698436, max=292047653
Downloading part 4: filename=/usr/local/libpostal-data/libpostal/geodb.tar.gz.4, offset=292047654, max=389396871
Downloading part 5: filename=/usr/local/libpostal-data/libpostal/geodb.tar.gz.5, offset=389396872, max=486746092
geodb/
geodb/geodb.spi
geodb/geodb.spl
geodb/geodb_feature_graph.dat
geodb/geodb_features.trie
geodb/geodb_names.trie
geodb/geodb_postal_codes.dat
Checking for new libpostal parser data file...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0  181M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
New libpostal parser data file available
Downloading multipart: http://libpostal.s3.amazonaws.com/parser.tar.gz, size=190250553
Downloading part 1: filename=/usr/local/libpostal-data/libpostal/parser.tar.gz.1, offset=0, max=38050109
Downloading part 2: filename=/usr/local/libpostal-data/libpostal/parser.tar.gz.2, offset=38050110, max=76100219
Downloading part 3: filename=/usr/local/libpostal-data/libpostal/parser.tar.gz.3, offset=76100220, max=114150329
Downloading part 4: filename=/usr/local/libpostal-data/libpostal/parser.tar.gz.4, offset=114150330, max=152200439
Downloading part 5: filename=/usr/local/libpostal-data/libpostal/parser.tar.gz.5, offset=152200440, max=190250553
address_parser/
address_parser/address_parser.dat
address_parser/address_parser_vocab.trie
address_parser/address_parser_phrases.trie
Checking for new libpostal language classifier data file...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0  641M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
New libpostal language classifier data file available
Downloading multipart: http://libpostal.s3.amazonaws.com/language_classifier.tar.gz, size=672728402
Downloading part 1: filename=/usr/local/libpostal-data/libpostal/language_classifier.tar.gz.1, offset=0, max=134545679
Downloading part 2: filename=/usr/local/libpostal-data/libpostal/language_classifier.tar.gz.2, offset=134545680, max=269091359
Downloading part 3: filename=/usr/local/libpostal-data/libpostal/language_classifier.tar.gz.3, offset=269091360, max=403637039
Downloading part 4: filename=/usr/local/libpostal-data/libpostal/language_classifier.tar.gz.4, offset=403637040, max=538182719
Downloading part 5: filename=/usr/local/libpostal-data/libpostal/language_classifier.tar.gz.5, offset=538182720, max=672728402
language_classifier/
language_classifier/language_classifier.dat
make[3]: Leaving directory `/usr/local/src/libpostal/src'
make[2]: Leaving directory `/usr/local/src/libpostal/src'
Making all in test
make[2]: Entering directory `/usr/local/src/libpostal/test'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/src/libpostal/test'
make[2]: Entering directory `/usr/local/src/libpostal'
make[2]: Leaving directory `/usr/local/src/libpostal'
make[1]: Leaving directory `/usr/local/src/libpostal'
albarrentine commented 8 years ago

Ok, which version of Debian? I'll try to replicate.

eater commented 8 years ago

7.9. I also just tried on Ubuntu 14.04 and see the same error.

albarrentine commented 8 years ago

Strange. One of the boxes I test on is Ubuntu 14.04 (our Travis build also runs Ubuntu 12.04). I just nuked the data dir/checkout there and tried a full reinstall. Not seeing the error.

How much memory does the machine/VM have available? The address parser should need a little under 1G.

eater commented 8 years ago

It has 8GB. I also tried reinstalling from scratch, but no joy.

albarrentine commented 8 years ago

Can you send me the output of uname -a on that system?

eater commented 8 years ago

Linux Nvidia 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:02 UTC 2015 i686 i686 i686 GNU/Linux

albarrentine commented 8 years ago

Ah, that's it, it's a 32-bit system. I'm working on some fixes now for #18 which will solve this for you. Will test on something similar to your setup and update this issue when the changes are pushed.

albarrentine commented 8 years ago

Ok, so I've pushed some fixes for 32-bit compatibility with https://github.com/openvenues/libpostal/commit/d35f97f6f1ce5c367eb7dd0e780ff7f1dfbdc38c. Pulling latest should get everything working on your system. Let me know if any other issues come up.

Travis, our CI system, doesn't appear to support testing on 32-bit architectures (see: https://github.com/travis-ci/travis-ci/issues/986), so unfortunately I won't be able to add an automated 32-bit build, but as a matter of good practice will avoid baking in 64-bit size_t assumptions going forward.

eater commented 8 years ago

Works now on both machines! Thanks.