Modify

Opened 3 years ago

Closed 3 years ago

#22191 closed defect (fixed)

[PATCH] URISyntaxException when http2 is installed and wikipedia attempts to download due to `|` characters

Reported by: TrickyFoxy Owned by: floscher
Priority: normal Milestone:
Component: Plugin wikipedia Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Install http2 and wikipedia plugins
  2. Click Download elements
  3. Click Wikipedia articles in viewport

What is the expected result?

The articles should download.

What happens instead?

Nothing is happening

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

You can try downloading articles near https://www.openstreetmap.org/node/613273579

Revision:18495
Is-Local-Build:true
Build-Date:2022-06-15 18:45:08

Identification: JOSM/1.5 (18495 SVN ru) Mac OS X 11.6.7
OS Build number: macOS 11.6.7 (20G630)
Memory Usage: 526 MB / 2048 MB (119 MB allocated, but free)
Java version: 19-ea+25, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: Display 69732352 1440×900 (scaling 2.00×2.00)
Maximum Screen Size: 1440×900
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: ru_RU
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=18495, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=/Applications/JOSM.app/Contents/MacOS/JOSM]
Dataset consistency test: No problems found

Plugins:
+ BuildingGeneralization (36)
+ Create_grid_of_ways (35976)
+ DirectDownload (35982)
+ EasyPresets (1623509627)
+ FastDraw (35978)
+ FixAddresses (35978)
+ HouseNumberTaggingTool (35951)
+ ImproveOsm (215)
+ ImproveWay (32)
+ MakeParallel (v1.1.0)
+ Mapillary (2.0.0-beta.12)
+ OpeningHoursEditor (35924)
+ PicLayer (1.0.2)
+ PolygonCutOut (v0.7)
+ Relation.Validation.Plugin (1.0.1)
+ RelationDissolve (0.2.0)
+ Review.Changes (1.0.5)
+ alignways (35951)
+ apache-commons (35924)
+ apache-http (35924)
+ auto_tools (81)
+ buildings_tools (35978)
+ centernode (v1.0.4)
+ changeset-viewer (v0.0.4)
+ comfort0 (35976)
+ conflation (0.6.9)
+ continuosDownload (99)
+ contourmerge (v0.1.9)
+ editgpx (35931)
+ ext_tools (35893)
+ graphview (35976)
+ gridify (1606242219)
+ http2 (35921)
+ jna (35924)
+ jts (35976)
+ junctionchecking (35893)
+ merge-overlap (35893)
+ osmwiki-dataitem (1.2.3)
+ photoadjust (35893)
+ rasterfilters (1.0.3)
+ reltoolbox (35976)
+ reverter (35980)
+ russia-address-helper (0.8.0)
+ terracer (35978)
+ turnrestrictions (35976)
+ undelete (35893)
+ utilsplugin2 (35970)
+ waydownloader (35976)
+ wikipedia (605)

Tagging presets:
+ https://raw.githubusercontent.com/ruosm-presets/literan-moscow/master/russian_shops.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/StreetCabinet&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Playground_Equipment&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Quick-highways&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Quick-stops&zip=1
+ https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/RU.zip
+ https://josm.openstreetmap.de/josmfile?page=Presets/OneClick&zip=1
+ <josm.userdata>/EasyPresets.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/BuildingPreset&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/WifiHotspots&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Manholes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/MappingAccessibility&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Maxspeed-zones&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/FixmeAndNote&zip=1
+ ${HOME}/JOSM/presets/style-power-voltage-color.mapcss
- ${HOME}/JOSM/presets/style-power-tower-solid/power-tower-solid.mapcss
+ https://raw.githubusercontent.com/species/josm-preset-traffic_sign_direction/master/direction.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Lit&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Power&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PowerMapping&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Noname&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/NewHighwayColors&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/AddressValidator&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_buildings&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/iD&zip=1
- https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip
- https://raw.githubusercontent.com/yopaseopor/indoormap/master/indoormap-style.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/NewParkingFeatures&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Surface&zip=1

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/KeepRight&zip=1
+ https://raw.githubusercontent.com/zetx16/Josm-HnumbValidator/master/ru-housenumber.validator.mapcss

Last errors/warnings:
- 00025.401 E: Не удалось найти изображение «pics/icons/Russian_Post.svg»
- 00025.402 W: [NODE, CLOSEDWAY, MULTIPOLYGON] Russian Post: Could not get presets icon pics/icons/Russian_Post.svg
- 00026.133 E: Не удалось найти изображение «https://image.flaticon.com/icons/png/512/47/47421.png»
- 00026.560 W: [NODE, CLOSEDWAY, MULTIPOLYGON] Clothes dryer: Could not get presets icon https://image.flaticon.com/icons/png/512/47/47421.png

Attachments (0)

Change History (4)

comment:1 by taylor.smock, 3 years ago

Looking at the stack trace I've been able to get:

2022-07-05 09:08:43.147 SEVERE: java.net.URISyntaxException: Illegal character in query at index 111: https://en.wikipedia.org/w/api.php?action=query&list=geosearch&format=xml&gslimit=500&gsbbox=56.517980391279394|43.60044355281165|56.517567672689665|43.60115939131226
java.net.URISyntaxException: Illegal character in query at index 111: https://en.wikipedia.org/w/api.php?action=query&list=geosearch&format=xml&gslimit=500&gsbbox=56.517980391279394|43.60044355281165|56.517567672689665|43.60115939131226
	at java.base/java.net.URI$Parser.fail(URI.java:2913)
	at java.base/java.net.URI$Parser.checkChars(URI.java:3084)
	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3172)
	at java.base/java.net.URI$Parser.parse(URI.java:3114)
	at java.base/java.net.URI.<init>(URI.java:600)
	at java.base/java.net.URL.toURI(URL.java:1061)
	at org.openstreetmap.josm.plugins.http2.Http2Client.createRequest(Http2Client.java:63)
	at org.openstreetmap.josm.plugins.http2.Http2Client.setupConnection(Http2Client.java:49)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:147)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:124)
	at org.wikipedia.WikipediaApp.connect(WikipediaApp.java:95)
	at org.wikipedia.WikipediaApp.getEntriesFromCoordinates(WikipediaApp.java:112)
	at org.wikipedia.gui.WikipediaToggleDialog$WikipediaLoadCoordinatesAction$1.getEntries(WikipediaToggleDialog.java:199)
	at org.wikipedia.gui.WikipediaToggleDialog$UpdateWikipediaArticlesSwingWorker.doInBackground(WikipediaToggleDialog.java:214)
	at org.wikipedia.gui.WikipediaToggleDialog$UpdateWikipediaArticlesSwingWorker.doInBackground(WikipediaToggleDialog.java:208)
	at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
	at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

It looks like it doesn't like the | character. I think I've run into this previously with the mapillary plugin. I want to say I fixed it by encoding the URL prior to passing it to the httpclient implementation.

comment:2 by TrickyFoxy, 3 years ago

It seems to be the same problem as in https://josm.openstreetmap.de/ticket/21126

comment:3 by taylor.smock, 3 years ago

Component: CorePlugin wikipedia
Owner: changed from team to floscher
Summary: The http2 plugin interferes with the wikipedia plugin[PATCH] URISyntaxException when http2 is installed and wikipedia attempts to download due to `|` characters

It looks like we've got two problems:

  1. wikipedia is ignoring the exception instead of reporting (or at least logging) it
  2. | encoding

Anyway, PR open at JOSM/wikipedia/pull/8.

comment:4 by taylor.smock, 3 years ago

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain floscher.
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.