mediagis / nominatim-docker

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

Failed to load URL : https://www.openstreetmap.org/api/0.6/node/10165779452/1 #388

Closed chance7bin closed 1 year ago

chance7bin commented 1 year ago

2022-11-08 12:14:32: Using project directory: /nominatim 2022-11-08 12:14:32: Initialising replication updates 2022-11-08 12:14:53: Failed to load URL: https://www.openstreetmap.org/api/0.6/node/10165779452/1 Traceback (most recent call last): File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/usr/lib/python3.10/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output self.send(msg) File "/usr/lib/python3.10/http/client.py", line 975, in send self.connect() File "/usr/lib/python3.10/http/client.py", line 1454, in connect self.sock = self._context.wrap_socket(self.sock, File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "/usr/lib/python3.10/ssl.py", line 1071, in _create self.do_handshake() File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/nominatim", line 14, in exit(cli.nominatim(module_dir='/usr/local/lib/nominatim/module', File "/usr/local/lib/nominatim/lib-python/nominatim/cli.py", line 264, in nominatim return parser.run(*kwargs) File "/usr/local/lib/nominatim/lib-python/nominatim/cli.py", line 126, in run return args.command.run(args) File "/usr/local/lib/nominatim/lib-python/nominatim/clicmd/replication.py", line 189, in run return self._init_replication(args) File "/usr/local/lib/nominatim/lib-python/nominatim/clicmd/replication.py", line 79, in _init_replication replication.init_replication(conn, base_url=args.config.REPLICATION_URL) File "/usr/local/lib/nominatim/lib-python/nominatim/tools/replication.py", line 36, in init_replication date = status.compute_database_date(conn) File "/usr/local/lib/nominatim/lib-python/nominatim/db/status.py", line 50, in compute_database_date data = get_url(node_url) File "/usr/local/lib/nominatim/lib-python/nominatim/tools/exec_utils.py", line 164, in get_url with urlrequest.urlopen(request) as response: # type: IO[bytes] File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.10/urllib/request.py", line 519, in open response = self._open(req, data) File "/usr/lib/python3.10/urllib/request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain result = func(args) File "/usr/lib/python3.10/urllib/request.py", line 1391, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error TLS/SSL connection has been closed (EOF) (_ssl.c:997)>

mtmail commented 1 year ago

Do you have more context? Have you run the command multiple times to rule out temporary network issues?

chance7bin commented 1 year ago

Do you have more context? Have you run the command multiple times to rule out temporary network issues?

I've tried it many times, it is at the time of request the address wrong

mtmail commented 1 year ago

I haven't seen that behaviour before. Unless it's network or firewall related.

Can you login to the container and request the URL with curl or wget? Do other https URLs work from inside the container?

openstreetmap.org has some policies https://operations.osmfoundation.org/policies/ which ultimately could lead to your IP address or IP range being banned. I've only ever seen it with tile and nominatim.osm.org usage and often it's only a 24h ban.

The website might be slow. It's rare but could depend on how far away you are from their datacenters. I saw the python request library might not be handling timeouts optimal https://github.com/osm-search/Nominatim/pull/2871

philipkozeny commented 1 year ago

Please retry it with the latest release of Nominatim 4.2 and reopen the ticket, if it still fails.

chance7bin commented 1 year ago

Please retry it with the latest release of Nominatim 4.2 and reopen the ticket, if it still fails.

I have solved this problem by setting --offline when importing data(nominatim import) and it will import offline

weskamm commented 1 year ago

But there is no flag / env parameter for this image to use the offline mode, right? I think that would be handy. The issue still occurs with version 4.2 when offline or using a custom node_id (importing custom / own data).