Behind a proxy
icemagno opened this issue · 0 comments
I have this question in S.O. from 2016
https://gis.stackexchange.com/questions/203905/how-to-setting-proxy-for-osmosis
And still havin problem to use osmosis behind a proxy.
opened another question here
https://gis.stackexchange.com/questions/439702/osmosis-behind-a-proxy
but no one are able to answer.
so.. how to make osmosis work behind a proxy ?
I've installed a OpenStreetMap tile server from overv/openstreetmap-tile-server Docker.
Here are some options to run ( after install using same options ):
docker run --name openstreetmap --hostname=openstreetmap --network=mynetwork --security-opt seccomp=unconfined \
-v /srv/osm-data/tiles/:/data/tiles/ \
-v /srv/osmfiles/some_merged_data.osm.pbf:/data/region.osm.pbf \
-v /srv/osm-data:/data/database/ \
-v /srv/osmfiles/update-area.poly:/data/region.poly \
-e https_proxy=http://MY_PROXY_IP.61:6160/ \
-e HTTPS_PROXY=http://MY_PROXY_IP.61:6160/ \
-e http_proxy=http://MY_PROXY_IP.61:6160/ \
-e HTTP_PROXY=http://MY_PROXY_IP.61:6160/ \
-e no_proxy="blah,blah,blah" \
-e REPLICATION_URL=https://planet.openstreetmap.org/replication/day \
-e UPDATES=enabled \
-e THREADS=24 \
-e ALLOW_CORS=enabled \
-e AUTOVACUUM=off \
-e EXPIRY_MINZOOM=13 \
-e EXPIRY_TOUCHFROM=13 \
-e EXPIRY_DELETEFROM=19 \
-e EXPIRY_MAXZOOM=20 \
--shm-size="500m" \
-e "OSM2PGSQL_EXTRA_ARGS=-C 16384" \
-p 80:80 \
--restart=always \
-d overv/openstreetmap-tile-server run
I've noticed the install process was worked fine without any error including the state file download.
After this run command, the tile server was up and running (I can access its tiles without any problem) but the log file shows this error:
Sep 01, 2022 5:19:01 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.48.3
Sep 01, 2022 5:19:02 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Sep 01, 2022 5:19:02 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Sep 01, 2022 5:19:02 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
[2022-09-01 17:19:01] 5458 start import from seq-nr 3639, replag is 235141s
[2022-09-01 17:19:01] 5458 downloading diff
tail: /var/log/tiles/osmosis.log: file truncated
Sep 01, 2022 5:19:12 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-replication-interval failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to read the state from the server.
at org.openstreetmap.osmosis.replication.common.ServerStateReader.getServerState(ServerStateReader.java:95)
at org.openstreetmap.osmosis.replication.common.ServerStateReader.getServerState(ServerStateReader.java:46)
at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.runImpl(BaseReplicationDownloader.java:273)
at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.run(BaseReplicationDownloader.java:372)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.UnknownHostException: planet.openstreetmap.org
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:229)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:203)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at org.openstreetmap.osmosis.replication.common.ServerStateReader.getServerState(ServerStateReader.java:91)
... 4 more
Sep 01, 2022 5:19:12 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
Seems it can't reach planet.openstreetmap.org even when it was able to do it before at install stage.
What I've been done wrong?
EDIT : Forgot to say I can download the state file from terminal using
wget "https://planet.openstreetmap.org/replication/day/state.txt"