#23721 closed defect (fixed)
[PATCH] Application hangs indefinitely if Bing API unavailable
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | normal | Milestone: | 24.07 |
Component: | Core imagery | Version: | |
Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- Try to import Bing imagery
- Watch the program hang indefinitely and have to kill it with a process manager
What is the expected result?
If Bing API is unavailable the app shouldn't crash
What happens instead?
The whole time while it's waiting for Bing, the app is unresponsive. This is an issue when the retry timeout doubles each time.
Please provide any additional information below. Attach a screenshot if possible.
2024-06-08 11:27:28.805 WARNING: Could not connect to Bing API. Will retry in 64 seconds.: java.net.SocketTimeoutException: Connect timed out 2024-06-08 11:28:47.877 INFO: GET https://dev.virtualearth.net/REST/v1/Imagery/Metadata/AerialOSM?include=ImageryProviders&output=xml&key=...stripped... -> !!! (15.1 s) 2024-06-08 11:28:47.877 WARNING: java.net.SocketTimeoutException: Connect timed out java.net.SocketTimeoutException: Connect timed out at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546) at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) at java.base/java.net.Socket.connect(Socket.java:751) at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:636) at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264) at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1237) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:141) at org.openstreetmap.josm.tools.Http1Client.performConnection(Http1Client.java:78) at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:162) at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:136) at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:125) at org.openstreetmap.josm.data.imagery.CachedAttributionBingAerialTileSource$BingAttributionData.updateData(CachedAttributionBingAerialTileSource.java:65) at org.openstreetmap.josm.io.CacheCustomContent.updateForce(CacheCustomContent.java:131) at org.openstreetmap.josm.io.CacheCustomContent.updateForceString(CacheCustomContent.java:143) at org.openstreetmap.josm.io.CacheCustomContent.updateIfRequiredString(CacheCustomContent.java:121) at org.openstreetmap.josm.data.imagery.CachedAttributionBingAerialTileSource.lambda$getAttributionLoaderCallable$0(CachedAttributionBingAerialTileSource.java:88) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.lang.Thread.run(Thread.java:1583) 2024-06-08 11:28:47.878 WARNING: Already here java.net.SocketTimeoutException: Connect timed out 2024-06-08 11:28:47.878 WARNING: Could not connect to Bing API. Will retry in 128 seconds.: java.net.SocketTimeoutException: Connect timed out
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2024-06-03 18:08:14 +0200 (Mon, 03 Jun 2024) Revision:19096 Build-Date:2024-06-04 01:31:15 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (19096 en_GB) Linux Freedesktop SDK 23.08 (Flatpak runtime) Memory Usage: 252 MB / 8008 MB (144 MB allocated, but free) Java version: 21.0.3+2, Flathub, OpenJDK 64-Bit Server VM Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel Screen: :0.0 1920×1080 (scaling 1.00×1.00) :0.1 1920×1080 (scaling 1.00×1.00) Maximum Screen Size: 1920×1080 Best cursor sizes: 16×16→16×16, 32×32→32×32 Environment variable LANG: en_GB.UTF-8 System property file.encoding: UTF-8 System property sun.jnu.encoding: UTF-8 Locale info: en_GB Numbers with default locale: 1234567890 -> 1234567890 Desktop environment: GNOME VM arguments: [--module-path=/app/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djava.net.useSystemProxies=true, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED] Plugins: + BuildingGeneralization (36) + ImageWayPoint (36226) + ImproveWay (32) + OpeningHoursEditor (36258) + buildings_tools (36226) + centernode (v1.0.4) + indoorequal (0.0.7) + indoorhelper (1.2.3) + terracer (36205) + wikipedia (605) Map paint styles: + <josm.userdata>/plugins/indoorhelper/resources/sit.mapcss
Attachments (2)
Change History (22)
comment:1 by , 11 months ago
Component: | External imagery source → Core imagery |
---|
comment:2 by , 11 months ago
This is actually going to take some modifications in JMapViewer
; it might not be a bad idea to put some modifications in JOSM as well to handle this.
The problem is that JMapViewer
calls future.get()
even if the future is not done; instead, it should return null
to indicate that loading is not yet complete.
by , 11 months ago
Attachment: | 23721.jmapviewer.patch added |
---|
by , 11 months ago
Attachment: | 23721.core.patch added |
---|
comment:3 by , 11 months ago
Milestone: | → 24.06 |
---|---|
Summary: | Application hangs indefinitely if Bing API unavailable → [PATCH] Application hangs indefinitely if Bing API unavailable |
comment:8 by , 9 months ago
I have this warning also with 19149 build: and I con not close josm, only break. Is this related?
2024-07-23 15:21:32.365 WARNING: Already here sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 2024-07-23 15:21:32.366 WARNING: Could not connect to Bing API. Will retry in 128 seconds.: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. Cause: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. Cause: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
follow-up: 10 comment:9 by , 9 months ago
If anything, r19149 should allow you to close JOSM if you cannot reach the Bing API since we are fetching the Bing API in the background instead of in the UI thread. There should be a window with a Cancel
button that you can click.
comment:10 by , 9 months ago
Replying to taylor.smock:
If anything, r19149 should allow you to close JOSM if you cannot reach the Bing API since we are fetching the Bing API in the background instead of in the UI thread. There should be a window with a
Cancel
button that you can click.
Sorry, but I don't have any window with Cancel
follow-up: 12 comment:11 by , 9 months ago
Can you open a new ticket?
If you are having a freeze, and assuming you are using a JDK instead of one of the JOSM installers, you can help me out by running the following on the command line:
# jps will print the running process ids for Java applications. # JOSM can show up as one of several different applications, depending upon how it was started. # The first column is the process id (PID). Copy that for the next step. $ jps 61813 josm-latest.jar 45208 Boot 65259 MainApplication $ jstack ${id_from_jps} [...a whole bunch of text you should attach to the new ticket...]
- If you are running JOSM with
java -jar
,jstack $(jps | grep 'josm' | awk '{print $1}')
is a good one-liner. - If you are running JOSM with OpenWebStart,
jstack $(jps | grep 'Boot' | awk '{print $1}')
is a good one-liner. - If you are running JOSM using an installer,
jstack $(jps | grep 'MainApplication' | awk '{print $1}')
should work, but you will probably have to fall back to readingjps
manually.
For the last two options, you probably don't have a JDK installed. We typically recommend Azul (Windows (use msi
) or mac (use dmg
)), but any JDK (e.g. Temurin) will work.
Thanks for your report, however your ticket is incomplete and therefore not helpful in its current form.
Please add all needed information according to this list:
- The required parts of the Status Report from your JOSM.
- Please, use
Report Bug from Help menu and copy & paste.
- Please, use
- Describe what behaviour you expected.
- Describe what did happen instead.
- Describe if and how the issue is reproducible.
- Add any relevant information like error messages or screenshots.
To ensure that all technical relevant information is contained, create new tickets by clicking in JOSMs Main Menu on Help → Report Bug.
Remember: This is a generic notice so we don't need to write the same stuff again and again. It may only apply in parts to the specific case!
comment:12 by , 9 months ago
Replying to taylor.smock:
Can you open a new ticket?
If you are having a freeze, and assuming you are using a JDK instead of one of the JOSM installers, you can help me out by running the following on the command line:
# jps will print the running process ids for Java applications. # JOSM can show up as one of several different applications, depending upon how it was started. # The first column is the process id (PID). Copy that for the next step. $ jps 61813 josm-latest.jar 45208 Boot 65259 MainApplication $ jstack ${id_from_jps} [...a whole bunch of text you should attach to the new ticket...]
- If you are running JOSM with
java -jar
,jstack $(jps | grep 'josm' | awk '{print $1}')
is a good one-liner.- If you are running JOSM with OpenWebStart,
jstack $(jps | grep 'Boot' | awk '{print $1}')
is a good one-liner.- If you are running JOSM using an installer,
jstack $(jps | grep 'MainApplication' | awk '{print $1}')
should work, but you will probably have to fall back to readingjps
manually.For the last two options, you probably don't have a JDK installed. We typically recommend Azul (Windows (use
msi
) or mac (usedmg
)), but any JDK (e.g. Temurin) will work.
Thanks for your report, however your ticket is incomplete and therefore not helpful in its current form.
Please add all needed information according to this list:
- The required parts of the Status Report from your JOSM.
- Please, use
Report Bug from Help menu and copy & paste.
- Describe what behaviour you expected.
- Describe what did happen instead.
- Describe if and how the issue is reproducible.
- Add any relevant information like error messages or screenshots.
To ensure that all technical relevant information is contained, create new tickets by clicking in JOSMs Main Menu on Help →
Report Bug.
Remember: This is a generic notice so we don't need to write the same stuff again and again. It may only apply in parts to the specific case!
Sorry, after recheck and load the correct josm-latest.jar I have window with Cancel button, so my fault.
comment:13 by , 9 months ago
Sorry, after recheck and load the correct josm-latest.jar I have window with Cancel button, so my fault.
No problem. Mistakes happen.
comment:14 by , 9 months ago
There is still an annoying glitch as the tiles are not automatically reloaded once the attribution was successfully loaded. Right now, Error: Attribution is not loaded yet
remains on the screen and I have to manually reload the tiles on every zoom level.
follow-up: 17 comment:15 by , 9 months ago
@skyper: that isn't going to be a simple fix. Can you open another ticket?
follow-up: 18 comment:16 by , 9 months ago
Don't we have a "reload error tiles" function. Would simply calling it when attribution is loaded help?
comment:17 by , 9 months ago
Replying to taylor.smock:
@skyper: that isn't going to be a simple fix. Can you open another ticket?
See #23841
comment:18 by , 9 months ago
Replying to stoecker:
Don't we have a "reload error tiles" function. Would simply calling it when attribution is loaded help?
Yes. The problem is calling it from a location where we know that the attribution has been loaded.
We can do one of several different things (semi-psuedocode):
- Call
MainApplication.getLayerManager().getLayersOfType(TMSLayer.class).stream().filter(l -> l.getInfo() == 'Bing').forEach(TMSLayer::reloadTiles)
- Add an overload with a
Runnable
that will be called when the attribution is loaded.
(1) is easier, (2) is better IMO.
comment:20 by , 9 months ago
I agree, but it is the "easy" fix. I'd rather do 2, but I think I'm going to have to do changes in JMapViewer. It isn't that difficult, but it is going to take a little bit of time.
Hanging is a core issue.