Modify

Opened 3 years ago

Closed 18 months ago

Last modified 17 months ago

#21431 closed defect (fixed)

[PATCH] Failed to download data

Reported by: jim.walseth@… Owned by: team
Priority: normal Milestone: 22.10
Component: Core Version:
Keywords: template_report HOT connection timeout Cc: angoca

Description

What steps will reproduce the problem?

  1. Select task to validate in TM (HOTOSM)
  2. Bounding box is there, but error occurs when downloading data.

What is the expected result?

What happens instead?

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-09-03 03:12:33 +0200 (Fri, 03 Sep 2021)
Build-Date:2021-09-03 01:31:19
Revision:18193
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18193 en) Mac OS X 10.15.7
OS Build number: Mac OS X 10.15.7 (19H1419)
Memory Usage: 1654 MB / 3641 MB (474 MB allocated, but free)
Java version: 1.8.0_301-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 69734272 1440×900 (scaling 1.00×1.00) Display 459083570 3440×1440 (scaling 1.00×1.00)
Maximum Screen Size: 3440×1440
Best cursor sizes: 16×16→16×16, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-2ea82160, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Dmacosx.jnlpx.dock.name=JOSM, -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/25/4c122699-6c51c1a8.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp , -Djnlpx.jvm="<java.home>/bin/java"]
Dataset consistency test: No problems found

Plugins:
+ buildings_tools (35823)
+ mapathoner (1.1.10)
+ scripting (30798)
+ todo (30306)

Map paint styles:
- ${HOME}/Downloads/josm_styles-master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleBuildingTags&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleRoofTags&zip=1
+ https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip
+ https://github.com/MissingMaps/josm_styles/archive/master.zip

Last errors/warnings:
- 01624.062 W: java.net.SocketTimeoutException: connect timed out
- 01624.063 E: java.net.SocketTimeoutException: connect timed out
- 01624.076 E: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.SocketTimeoutException: connect timed out
- 01624.097 E: IO Exception - <html>Failed to upload data to or download data from<br>'https://api.openstreetmap.org/api/0.6/map?bbox=81.7025757,25.4457548,81.7053223,25.4482349'<br>due to a problem with transferring data.<br>Details (untranslated): connect timed out</html>
- 01624.126 E: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.SocketTimeoutException: connect timed out
- 01624.126 E: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.SocketTimeoutException: connect timed out
- 01624.127 E: org.openstreetmap.josm.io.OsmTransferException: Failed to upload data to or download data from<br>'https://api.openstreetmap.org/api/0.6/map?bbox=81.7025757,25.4457548,81.7053223,25.4482349'<br>due to a problem with transferring data.<br>Details (untranslated): connect timed out
- 01624.131 E: Handled by bug report queue: org.openstreetmap.josm.io.OsmTransferException: Failed to upload data to or download data from<br>'https://api.openstreetmap.org/api/0.6/map?bbox=81.7025757,25.4457548,81.7053223,25.4482349'<br>due to a problem with transferring data.<br>Details (untranslated): connect timed out



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-2 (41) of javawsApplicationThreadGroup
org.openstreetmap.josm.io.OsmTransferException: Failed to upload data to or download data from<br>'https://api.openstreetmap.org/api/0.6/map?bbox=81.7025757,25.4457548,81.7053223,25.4482349'<br>due to a problem with transferring data.<br>Details (untranslated): connect timed out
	at org.openstreetmap.josm.io.remotecontrol.handler.LoadAndZoomHandler.lambda$handleRequest$0(LoadAndZoomHandler.java:169)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.awt.Dialog.show(Dialog.java:1084)
	at java.awt.Component.show(Component.java:1671)
	at java.awt.Component.setVisible(Component.java:1623)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at org.openstreetmap.josm.gui.HelpAwareOptionPane.doShowOptionDialog(HelpAwareOptionPane.java:353)
	at org.openstreetmap.josm.gui.HelpAwareOptionPane.showOptionDialog(HelpAwareOptionPane.java:289)
	at org.openstreetmap.josm.gui.HelpAwareOptionPane.showOptionDialog(HelpAwareOptionPane.java:368)
	at org.openstreetmap.josm.gui.ExceptionDialogUtil.showErrorDialog(ExceptionDialogUtil.java:43)
	at org.openstreetmap.josm.gui.ExceptionDialogUtil.explainNestedIOException(ExceptionDialogUtil.java:139)
	at org.openstreetmap.josm.gui.ExceptionDialogUtil.explainOsmTransferException(ExceptionDialogUtil.java:397)
	at org.openstreetmap.josm.gui.ExceptionDialogUtil.explainException(ExceptionDialogUtil.java:491)
	at org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler.lambda$run$1(PostDownloadHandler.java:109)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Attachments (0)

Change History (25)

comment:1 by skyper, 3 years ago

Component: CoreCore remotecontrol
Keywords: HOT added

comment:2 by skyper, 3 years ago

Seems you had some connection problems with the OSM Api. Does this problem persist?

comment:3 by skyper, 3 years ago

Owner: changed from team to jim.walseth@…
Status: newneedinfo

comment:4 by anonymous, 3 years ago

JOSM is now functioning normally it seems. I would not file a bug report but it said "This is always a coding error". Probably you can close this.

comment:5 by skyper, 3 years ago

Component: Core remotecontrolCore
Keywords: connection timeout added
Owner: changed from jim.walseth@… to team
Status: needinfonew

Thanks. I am not sure if JOSM should ask for a bug report in case of connection timeouts but in general, please, keep reporting problems, thanks.

This looks similar to #20774 but without the GOAWAY.

comment:6 by skyper, 2 years ago

Ticket #21466 has been marked as a duplicate of this ticket.

comment:7 by taylor.smock, 2 years ago

Ticket #21787 has been marked as a duplicate of this ticket.

comment:8 by skyper, 2 years ago

Just for notice. While I find org.openstreetmap.josm.io.remotecontrol.handler.LoadAndZoomHandler.lambda$handleRequest in many of these (duplicate) tickets, I have faced this problem once without using remote control, the last days. I had not time to report it and it happened just once. I remember some conflicts on upload and I am not sure how often I restarted the upload to the same changeset but I think it was several times finding new conflicts before the error. Maybe the search for open changeset brings a delay.

comment:9 by skyper, 2 years ago

Ticket #21389 has been marked as a duplicate of this ticket.

comment:10 by skyper, 2 years ago

Ticket #21925 has been marked as a duplicate of this ticket.

comment:11 by GerdP, 23 months ago

Ticket #22094 has been marked as a duplicate of this ticket.

comment:12 by taylor.smock, 22 months ago

Ticket #22159 has been marked as a duplicate of this ticket.

comment:13 by taylor.smock, 22 months ago

Ticket #22212 has been marked as a duplicate of this ticket.

comment:14 by taylor.smock, 21 months ago

Ticket #22217 has been marked as a duplicate of this ticket.

comment:15 by taylor.smock, 21 months ago

Ticket #22229 has been marked as a duplicate of this ticket.

comment:16 by taylor.smock, 21 months ago

Ticket #22228 has been marked as a duplicate of this ticket.

comment:17 by skyper, 19 months ago

Ticket #22421 has been marked as a duplicate of this ticket.

comment:18 by skyper, 19 months ago

Cc: angoca added

comment:19 by taylor.smock, 19 months ago

Summary: Failed to download data[PATCH] Failed to download data

I believe I might have a fix for this:

  • src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    diff --git a/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java b/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
    a b  
    99import java.util.Collection;
    1010import java.util.Collections;
    1111import java.util.LinkedHashSet;
     12import java.util.List;
    1213import java.util.Map;
    1314import java.util.Set;
    1415import java.util.concurrent.ExecutionException;
    1516import java.util.concurrent.Future;
    1617import java.util.concurrent.TimeUnit;
    1718import java.util.concurrent.TimeoutException;
     19import java.util.stream.Collectors;
    1820
    1921import javax.swing.JOptionPane;
    2022
     
    164166                                future.get(OSM_DOWNLOAD_TIMEOUT.get(), TimeUnit.SECONDS);
    165167                                if (osmTask.isFailed()) {
    166168                                    Object error = osmTask.getErrorObjects().get(0);
    167                                     throw error instanceof OsmApiException
    168                                         ? (OsmApiException) error
    169                                         : new OsmTransferException(String.join(", ", osmTask.getErrorMessages()));
     169                                    if (error instanceof OsmApiException) {
     170                                        throw (OsmApiException) error;
     171                                    }
     172                                    List<Throwable> exceptions = osmTask.getErrorObjects().stream()
     173                                                    .filter(Throwable.class::isInstance).map(Throwable.class::cast)
     174                                                    .collect(Collectors.toList());
     175                                    OsmTransferException osmTransferException =
     176                                            new OsmTransferException(String.join(", ", osmTask.getErrorMessages()));
     177                                    if (!exceptions.isEmpty()) {
     178                                        osmTransferException.initCause(exceptions.get(0));
     179                                        exceptions.remove(0);
     180                                        exceptions.forEach(osmTransferException::addSuppressed);
     181                                    }
     182                                    throw osmTransferException;
    170183                                }
    171184                            } catch (InterruptedException | ExecutionException | TimeoutException |
    172185                                    OsmTransferException | RuntimeException ex) { // NOPMD

Explanation:
ExceptionDialogUtil.explainException has special handling for OsmTransferException. Unfortunately, it requires that the exception have a cause set, and not only are we not setting the cause, we weren't even adding any additional suppressed exceptions.

Steps to reproduce:

  1. Disable your internet connection
  2. Run curl 'http://localhost:8111/load_and_zoom?left=92.846832&bottom=22.522706&right=92.852325&top=22.529048'
  3. See exception along with dialog box telling us that there was an unknown host.

The patch fixes the exception dialog, but now we have two dialogs both saying (almost) the same thing. One is a bit more verbose and has the full URL.

comment:20 by taylor.smock, 19 months ago

Ticket #21450 has been marked as a duplicate of this ticket.

comment:21 by taylor.smock, 19 months ago

Milestone: 22.10

comment:22 by taylor.smock, 19 months ago

Ticket #22433 has been marked as a duplicate of this ticket.

comment:23 by taylor.smock, 19 months ago

Ticket #22438 has been marked as a duplicate of this ticket.

comment:24 by taylor.smock, 18 months ago

Resolution: fixed
Status: newclosed

In 18581/josm:

Fix #21431: Failed to download data in LoadAndZoomHandler

ExceptionDialogUtil.explainException has special handling for OsmTransferException.
Unfortunately, it requires that the exception have a cause set, and not only are we not
setting the cause, we weren't even adding any additional suppressed exceptions.

This does currently produce two notification windows for the same problem.

comment:25 by taylor.smock, 17 months ago

Ticket #22500 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.