Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#22109 closed defect (fixed)

[WIP PATCH] IPv6-only system: java.net.SocketException: Network is unreachable

Reported by: vazhnov Owned by: team
Priority: minor Milestone: 22.06
Component: Core Version: latest
Keywords: IPv6 Cc:

Description

My desktop is IPv6-only. JOSM proxy settings is "no proxy".

When I run JOSM, it couldn't work because of error "java.net.SocketException: Network is unreachable".

I think the issue can be caused by some legacy code, which forces to use AF_INET instead of AF_INET6 + AF_INET.

I saw something similar with a Python code: https://github.com/platformio/platformio-core/pull/4151

But my internet connection works fine. Here is a curl examples:

 $ curl -vI https://josm.openstreetmap.de
*   Trying 2a01:4f9:2b:907::2:443...
* Connected to josm.openstreetmap.de (2a01:4f9:2b:907::2) port 443 (#0)
* ALPN: offers h2
…
 $ curl -vI https://github.com
*   Trying 2001:67c:2b0:db32:0:1:8c52:7904:443...
* Connected to github.com (2001:67c:2b0:db32:0:1:8c52:7904) port 443 (#0)
* ALPN: offers h2
…
 $ curl -vI https://api.openstreetmap.org/api/
*   Trying 2001:978:2:2c::172:c:443...
* Connected to api.openstreetmap.org (2001:978:2:2c::172:c) port 443 (#0)
* ALPN: offers h2
…
 $ ping -c3 api.openstreetmap.org
PING api.openstreetmap.org(2001:978:2:2c::172:d (2001:978:2:2c::172:d)) 56 data bytes
64 bytes from 2001:978:2:2c::172:d (2001:978:2:2c::172:d): icmp_seq=1 ttl=52 time=25.1 ms
64 bytes from 2001:978:2:2c::172:d (2001:978:2:2c::172:d): icmp_seq=2 ttl=52 time=24.5 ms
64 bytes from 2001:978:2:2c::172:d (2001:978:2:2c::172:d): icmp_seq=3 ttl=52 time=26.1 ms

--- api.openstreetmap.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 24.538/25.274/26.145/0.662 ms

When I use "report bug", I see the same error. So I paste the output here:

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-04-04 22:26:00 +0200 (Mon, 04 Apr 2022)
Revision:18427
Build-Date:2022-04-05 01:30:55
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18427 en_GB) Linux Devuan GNU/Linux 5 (daedalus/ceres)
Memory Usage: 256 MB / 4002 MB (81 MB allocated, but free)
Java version: 17.0.3+7-Debian-1, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 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: XFCE
fonts-noto: fonts-noto:-

Plugins:
+ apache-commons (35924)
+ apache-http (35924)
+ imagery_offset_db (35893)
+ jna (35924)
+ photo_geotagging (35933)
+ photoadjust (35893)
+ reverter (35893)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/Emergency_access&zip=1

Map paint styles:
- https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/RecyclingMaterials&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleRoofTags&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleBuildingTags&zip=1
- https://raw.githubusercontent.com/yopaseopor/indoormap/master/indoormap-style.mapcss

Last errors/warnings:
- 00009.396 W: Already here java.net.SocketException: Network is unreachable
- 00009.396 E: Error initialising test ApiCapabilitiesTest:
- 00009.792 W: java.net.SocketException: Network is unreachable
- 00009.793 W: Already here java.net.SocketException: Network is unreachable
- 00009.793 W: Already here java.net.SocketException: Network is unreachable
- 00009.801 W: org.openstreetmap.josm.io.OsmApiInitializationException: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable. Cause: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable. Cause: java.net.SocketException: Network is unreachable
- 00609.841 W: java.net.SocketException: Network is unreachable
- 00609.842 W: Already here java.net.SocketException: Network is unreachable
- 00609.843 W: Already here java.net.SocketException: Network is unreachable
- 00609.845 W: org.openstreetmap.josm.io.OsmApiInitializationException: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable. Cause: org.openstreetmap.josm.io.OsmTransferException: java.net.SocketException: Network is unreachable. Cause: java.net.SocketException: Network is unreachable

Attachments (3)

Screenshot_2022-06-04_13-01-28_JOSM_IPv6-only_error.png (48.5 KB ) - added by vazhnov 3 years ago.
Network errors occured
josm-custom.jar (16.1 MB ) - added by taylor.smock 3 years ago.
22109.patch (1.9 KB ) - added by taylor.smock 3 years ago.

Change History (18)

by vazhnov, 3 years ago

Network errors occured

comment:1 by vazhnov, 3 years ago

Also every JOSM start I see a message

2022-06-04 13:00:27.238 INFO: Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.

comment:2 by vazhnov, 3 years ago

I found a workaround: -Djava.net.preferIPv6Addresses=true works for me.

Also I found function checkIPv6() has code:

                                Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
                                if (!wasv6) {
                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart."));
                                } else {
                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4."));
                                }

where, probably, somebody forgot to add Config.getPref().putBoolean("validated.ipv6", true)

in reply to:  1 comment:3 by skyper, 3 years ago

Replying to vazhnov:

Also every JOSM start I see a message

2022-06-04 13:00:27.238 INFO: Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.

+1, me too. I have faced this message over and over again with IPv6 and IPv4 available.

comment:4 by taylor.smock, 3 years ago

Summary: IPv6-only system: java.net.SocketException: Network is unreachable[WIP PATCH] IPv6-only system: java.net.SocketException: Network is unreachable

This should fix the problem. I'll upload a test jar for you and skyper to play with, and I'll check and make certain it works for me (I am on IPv4 only).

  • src/org/openstreetmap/josm/gui/MainApplication.java

    diff --git a/src/org/openstreetmap/josm/gui/MainApplication.java b/src/org/openstreetmap/josm/gui/MainApplication.java
    index 79450865b7..87ff8c3815 100644
    a b public class MainApplication {  
    12881288                                Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
    12891289                                if (!wasv6) {
    12901290                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart."));
     1291                                    Config.getPref().putBoolean("validated.ipv6", true);
    12911292                                } else {
    12921293                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4."));
    12931294                                }

in reply to:  4 comment:5 by vazhnov, 3 years ago

Replying to taylor.smock:

This should fix the problem.

Thank you for a patch and build!

With a custom build on IPv6-only workstation:

First run:

 $ java -jar /tmp/josm-custom.jar
2022-06-06 21:51:17.735 INFO: Log level is at INFO (INFO, 800)
2022-06-06 21:51:19.708 INFO: Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.
2022-06-06 21:51:22.061 INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> !!! (3 ms)
2022-06-06 21:51:22.063 WARNING: java.net.SocketException: Network is unreachable
…

Second run:

 $ java -jar /tmp/josm-custom.jar
2022-06-06 21:52:02.931 INFO: Log level is at INFO (INFO, 800)
2022-06-06 21:52:04.936 INFO: Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.
2022-06-06 21:52:07.261 INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> !!! (2 ms)
2022-06-06 21:52:07.263 WARNING: java.net.SocketException: Network is unreachable
…

And I see in "advanced preferences": validated.ipv6=false.

Even if I set manually validated.ipv6=true in GUI "advanced preferences", then after JOSM restart I see again: validated.ipv6=false.

comment:6 by taylor.smock, 3 years ago

Can you try running it with java -jar /tmp/josm-custom.jar --trace (Note: Please only paste exceptions, Detected Usable IPv6 Network and Exception while checking IPv6 connectivity).

And I don't think the patch is worthwhile -- I missed a line added by BastiK in 2017 at the end where we are supposedly storing the hasv6 variable in validated.ipv6.

Anyway, I'll upload a different patch and jar.

by taylor.smock, 3 years ago

Attachment: josm-custom.jar added

by taylor.smock, 3 years ago

Attachment: 22109.patch added

comment:7 by vazhnov, 3 years ago

 $ java -jar /tmp/1/josm-custom.jar --trace
2022-06-09 21:18:41.792 INFO: Log level is at FINEST (FINEST, 300)
2022-06-09 21:18:41.811 FINE: lsb_release -i -s
2022-06-09 21:18:41.912 FINE: System property 'debug' set to 'true'. Old value was 'null'
2022-06-09 21:18:41.913 INFO: Enabled detailed debug level (trace)
2022-06-09 21:18:42.240 FINEST: Update obsolete preference keys for version 18468
2022-06-09 21:18:42.242 FINEST: Remove obsolete preferences for version 18468
2022-06-09 21:18:42.310 FINE: System property 'http.agent' set to 'JOSM/1.5 (18468 SVN en_GB) Linux Devuan GNU/Linux 5 (daedalus/ceres)'. Old value was 'null'
2022-06-09 21:18:42.312 FINE: System property 'user.language' set to ''. Old value was 'en'
2022-06-09 21:18:42.315 FINE: System property 'sun.net.http.retryPost' set to 'false'. Old value was 'null'
2022-06-09 21:18:42.316 FINE: System property 'java.security.manager' set to 'allow'. Old value was 'null'
2022-06-09 21:18:42.614 FINE: System property 'java.protocol.handler.pkgs' set to 'org.openstreetmap.josm.io.protocols'. Old value was 'null'
2022-06-09 21:18:42.770 FINE: Determining plugins to load...
2022-06-09 21:18:42.771 FINE: Plugins list initialized to [imagery_offset_db, apache-commons, photoadjust, photo_geotagging, jna, reverter, apache-http]
…
2022-06-09 21:18:43.653 FINE: Processing file 'site-josm.openstreetmap.de-_pluginicons.txt'
2022-06-09 21:18:43.763 FINE: System property 'java.net.preferIPv6Addresses' set to 'true'. Old value was 'null'
2022-06-09 21:18:43.764 INFO: Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.
2022-06-09 21:18:43.770 FINE: Processing plug-in files...
…
2022-06-09 21:18:45.594 INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> !!! (3 ms)
2022-06-09 21:18:45.596 WARNING: java.net.SocketException: Network is unreachable
java.net.SocketException: Network is unreachable
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:633)
	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:498)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
	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:380)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:189)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:175)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
	at org.openstreetmap.josm.tools.Http1Client.performConnection(Http1Client.java:78)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:157)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:195)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:138)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:122)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:86)
	at org.openstreetmap.josm.io.OsmServerReader.fetchData(OsmServerReader.java:424)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:170)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:158)
	at org.openstreetmap.josm.data.UserIdentityManager.initFromOAuth(UserIdentityManager.java:239)
	at org.openstreetmap.josm.data.UserIdentityManager.getInstance(UserIdentityManager.java:74)
	at org.openstreetmap.josm.gui.MainFrame.initialize(MainFrame.java:118)
	at org.openstreetmap.josm.gui.MainApplication.initializeMainWindow(MainApplication.java:417)
	at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:103)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:955)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:283)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:743)

2022-06-09 21:18:45.597 SEVERE: java.net.SocketException: Network is unreachable
java.net.SocketException: Network is unreachable
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:633)
	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:498)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
	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:380)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:189)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:175)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
	at org.openstreetmap.josm.tools.Http1Client.performConnection(Http1Client.java:78)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:157)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:195)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:138)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:122)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:86)
	at org.openstreetmap.josm.io.OsmServerReader.fetchData(OsmServerReader.java:424)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:170)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:158)
	at org.openstreetmap.josm.data.UserIdentityManager.initFromOAuth(UserIdentityManager.java:239)
	at org.openstreetmap.josm.data.UserIdentityManager.getInstance(UserIdentityManager.java:74)
	at org.openstreetmap.josm.gui.MainFrame.initialize(MainFrame.java:118)
	at org.openstreetmap.josm.gui.MainApplication.initializeMainWindow(MainApplication.java:417)
	at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:103)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:955)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:283)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:743)

2022-06-09 21:18:45.598 SEVERE: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: java.net.SocketException: Network is unreachable
org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:200)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:138)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:122)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:86)
	at org.openstreetmap.josm.io.OsmServerReader.fetchData(OsmServerReader.java:424)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:170)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:158)
	at org.openstreetmap.josm.data.UserIdentityManager.initFromOAuth(UserIdentityManager.java:239)
	at org.openstreetmap.josm.data.UserIdentityManager.getInstance(UserIdentityManager.java:74)
	at org.openstreetmap.josm.gui.MainFrame.initialize(MainFrame.java:118)
	at org.openstreetmap.josm.gui.MainApplication.initializeMainWindow(MainApplication.java:417)
	at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:103)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:955)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:283)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:743)
Caused by: java.net.SocketException: Network is unreachable
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:633)
	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:498)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
	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:380)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:189)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:175)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
	at org.openstreetmap.josm.tools.Http1Client.performConnection(Http1Client.java:78)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:157)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:195)
	... 16 more

2022-06-09 21:18:45.607 FINEST: createImageFromSvg: jar:file:/tmp/1/josm-custom.jar!/images/wikimedia_commons.svg java.awt.Dimension[width=16,height=16]
…
Last edited 3 years ago by vazhnov (previous) (diff)

comment:8 by taylor.smock, 3 years ago

The timestamps seem to indicate that JOSM might not be restarting:

2022-06-09 21:18:43.764 INFO: Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.
2022-06-09 21:18:43.770 FINE: Processing plug-in files...
…
2022-06-09 21:18:45.594 INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> !!! (3 ms)
[...snip...]
2022-06-09 21:18:45.607 FINEST: createImageFromSvg: jar:file:/tmp/1/josm-custom.jar!/images/wikimedia_commons.svg java.awt.Dimension[width=16,height=16]

Did JOSM restart?

What happens after you stop and start JOSM again? Same thing?

Anyway, presuming its not fixed, I think I'm going to need to find a location with IPv6 in order to debug this.

Which might be hard, at least where I am.

comment:9 by vazhnov, 3 years ago

Did JOSM restart?

No.

What happens after you stop and start JOSM again? Same thing?

Yes, the same. I started the binary 4 times, 4-rd is with --trace. All 4 times JOSM failed to connect and printed:

2022-06-09 19:59:52.802 INFO: Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.
…
2022-06-09 19:59:53.589 WARNING: java.net.SocketException: Network is unreachable
java.net.SocketException: Network is unreachable

Anyway, presuming its not fixed, I think I'm going to need to find a location with IPv6 in order to debug this.

I can buy a virtual machine for this. But it should be dualstack (IPv6 + IPv4) so you can connect, but the issue is for IPv6-only…

Also, I already have a dualstack virtual machine without a GUI, accessible in the Internet. You can use it as SSH jump-host. And I can use my Proxmox lab server to create IPv6-only virtual machine, similar to workstation I use.

@taylor.smock, what do you think?

comment:10 by taylor.smock, 3 years ago

It is an option. But I'd really prefer to not have remote access to someone else's machine (I have an IT business on the side, and I almost always tell people to not give remote access to someone, largely due to online tech support scams).

Anyway, I'll think about it. But I might be able to get access to an IPv6 enabled stack here at work. I'll have to ask. We are also getting a new ISP, so it is also possible that I'll have IPv6 access soonish. At which point, I might be able to fake being IPv6 only (AKA, tell the network to give me only an IPv6 address).

comment:11 by stoecker, 3 years ago

No patch necessary. Simply set "prefer.ipv6" to true.

in reply to:  11 comment:12 by gaben, 3 years ago

Replying to stoecker:

No patch necessary. Simply set "prefer.ipv6" to true.

But the

Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart.

message is misleading as it is not preferring automatically the IPv6 protocol.

I have dual stack internet connection, so if needed, I can test the changes.

comment:13 by stoecker, 3 years ago

Resolution: fixed
Status: newclosed

In 18492/josm:

fix #22109 - fix IPv6 detection, as api.openstreetmap.org fails in Java.isReachable() nowadays

comment:14 by stoecker, 3 years ago

Milestone: 22.06

comment:15 by stoecker, 3 years ago

I'd really prefer proper IPv6 support in Java, but that still seems an unrealistic wish after so many years.

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.