﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
22109	[WIP PATCH] IPv6-only system: java.net.SocketException: Network is unreachable	vazhnov	team	"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"	defect	closed	minor	22.06	Core	latest	fixed	IPv6	
