mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.03k stars 434 forks source link

nominatim reverse cli call with external database #550

Open lucasmaj opened 3 months ago

lucasmaj commented 3 months ago

When running nominatim cli nominatim reverse --lat 43.73282549781305 --lon -87.42420819014446 I get reverse geocode result followed by error. I am using external postresql database. Running reverse via WEB REST API call, does not appear causing any errors but I am worried something is not right.

nominatim reverse --lat 43.73282549781305 --lon -87.42420819014446

{ "place_id": 63099588, "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright", "osm_type": "relation", "osm_id": 270625, "lat": "43.7128967", "lon": "-87.9370433", "category": "boundary", "type": "administrative", "place_rank": 12, "importance": 0.24000999999999997, "addresstype": "county", "name": "Sheboygan County", "display_name": "Sheboygan County, Wisconsin, United States", "boundingbox": [ "43.5423730", "43.8925880", "-88.1622240", "-87.0753571" ] } 2024-04-09 22:14:48: Fatal error on SSL transport protocol: <asyncio.sslproto.SSLProtocol object at 0x7fabccb2bdf0> transport: <_SelectorSocketTransport closing fd=6> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/selector_events.py", line 924, in write n = self._sock.send(data) OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/sslproto.py", line 690, in _process_write_backlog self._transport.write(chunk) File "/usr/lib/python3.10/asyncio/selector_events.py", line 930, in write self._fatal_error(exc, 'Fatal write error on socket transport') File "/usr/lib/python3.10/asyncio/selector_events.py", line 725, in _fatal_error self._force_close(exc) File "/usr/lib/python3.10/asyncio/selector_events.py", line 737, in _force_close self._loop.call_soon(self._call_connection_lost, exc) File "/usr/lib/python3.10/asyncio/base_events.py", line 753, in call_soon self._check_closed() File "/usr/lib/python3.10/asyncio/base_events.py", line 515, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed

bfnsga commented 2 months ago

I had this same issue with the "nominatim search" command to an external Postgre database on a standard Nominatim installation on Ubuntu 22 (not nominatim-docker).

What worked for me was manually activating the python virtual environment while logged in as the "nominatim" user (source ~/nominatim-venv/bin/activate). After activiting the virtual environment and running the same nominatim search command, the error dissappeared. Since the REST API server uses the virtual environment I would imagine that is why the error does not appear for those queries either.

Again, I am not using nominatim-docker but hopefully the above information helps provide a fix.