I'm running Nominatim on my server and I recently (2 weeks ago) imported full planet data. I'm assuming the import is complete (not sure if it is, as the output never explicitly stated "finished"). Here's my import output:
Done 87399141 in 624893 @ 139.862564 per second - Rank 30 ETA (seconds): -30.558571
Done 87399213 in 624894 @ 139.862473 per second - ETA (seconds): -31.073381
Done 87399213 in 624894 @ 139.862473 per second - FINISHED
...
CREATE INDEX
CREATE INDEX
CREATE INDEX
Postgres doesn't appear to be doing anything either:
[root~]# psql postgres
psql (9.1.9)
Type "help" for help.
postgres=# select * from pg_stat_activity;
datid | datname | procpid | usesysid | usename | application_name | client_addr | client_hostname | client
_port | backend_start | xact_start | query_start | wait
ing | current_query
-------+----------+---------+----------+---------+------------------+-------------+-----------------+-------
------+-------------------------------+-------------------------------+-------------------------------+-----
----+---------------------------------
12780 | postgres | 31281 | 16385 | root | psql | | |
-1 | 2014-02-26 11:52:00.615982-08 | 2014-02-26 11:52:10.074218-08 | 2014-02-26 11:52:10.074218-08 | f
| select * from pg_stat_activity;
(1 row)
Having said that, I'm trying to reverse geocode via Nominatim, but it's giving me error messages:
Query:
http://my-servers-ip-address/nominatim/reverse?format=xml&lat=40.731389&lon=-73.998889&zoom=18&addressdetails=1
Output:
Internal Server Error
Nominatim has encountered an internal error while processing your request. This is most likely because of a bug in the software.
Details: Could not determine closest place. Feel free to report the bug in the http://trac.openstreetmap.org OSM bug database. Please include the error message above and the URL you used.
How can I debug to see what went wrong? Could the import have gone wrong? (Nominatim, the same installation on the same machine, was working fine before I wiped the database and imported new data) Is the import actually not finished?
Thanks
EDIT:
Adding apache error message and debug=1 option in the URL:
Apache error message:
[Fri Feb 28 09:56:49 2014] [error] an unknown filter was not added: proxy-html
[Fri Feb 28 09:56:49 2014] [error] [client my-ip-address] PHP Fatal error: Cannot use object of type DB_Error as array in /postgres/OpenStreetMaps/Nominatim-2.2.0/lib/PlaceLookup.php on line 53
Output with debug=1 option:
string(561) "select place_id,parent_place_id,rank_search from placex WHERE ST_DWithin(ST_SetSRID(ST_Point(-73.998889,40.731389),4326), geometry, 0.0008) and rank_search != 28 and rank_search >= 30 and (name is not null or housenumber is not null) and class not in ('waterway','railway','tunnel','bridge') and indexed_status = 0 and (ST_GeometryType(geometry) not in ('ST_Polygon','ST_MultiPolygon') OR ST_DWithin(ST_SetSRID(ST_Point(-73.998889,40.731389),4326), centroid, 0.0008)) ORDER BY ST_distance(ST_SetSRID(ST_Point(-73.998889,40.731389),4326), geometry) ASC limit 1"
asked
26 Feb '14, 19:57
baekacaek
176●12●13●17
accept rate:
0%
If you can, amend your question by adding the relevant messages of your Apache error log file. That will make answering easier.
Thanks. I added the apache error message. I'm not sure what it's telling me to do though.
Is it possible that you forgot to create the www-data user before starting the import?
No, i created www-data user for my first import (this is my second import). I rechecked by running the command again, but no difference
It seems that for whatever reason the database query caused PostGIS to return an error. Check your database log file in /var/log/postgresql/ if you spot an error; or else do "su www-data", then "psql nominatim", and enter the "select place_id..." query in the psql shell. With any luck that will also return an error, and give us a hint about what is wrong.
I typed in "su www-data" from shell and I get "user www-data does not exist". Could this be the problem? If i run the query in psql shell, the query runs and I get 0 rows. No error message (unless I need to look elsewhere for the error message).
Btw, I'm on CentOS.
CentOS seems to have user apache instead of www-data.