Modify

Opened 4 years ago

Closed 11 days ago

#11208 closed defect (worksforme)

network (or API server) is unreachable on ipv6 only network

Reported by: miklcct@… Owned by: miklcct@…
Priority: normal Milestone:
Component: Core Version: tested
Keywords: ipv6 Cc:

Description

What steps will reproduce the problem?

  1. Put the computer on an IPv6-only network with NAT64 and DNS64 properly configured
  2. start JOSM

What is the expected result?

It can be used normally.

What happens instead?

It immediately tells me "network is unreachable". When I switch on clatd, it functions normally again.

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

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-02-01 02:33:54
Last Changed Author: Don-vip
Revision: 7995
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-01-31 15:17:59 +0100 (Sat, 31 Jan 2015)
Last Changed Rev: 7995

Identification: JOSM/1.5 (7995 en_GB) Linux Ubuntu 14.10
Memory Usage: 175 MB / 864 MB (54 MB allocated, but free)
Java version: 1.7.0_75, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u75-2.5.4-1~utopic1


Last errors/warnings:
- W: Failed to read MOTD. Exception was: java.net.ConnectException: Network is unreachable
- W: java.net.ConnectException: Network is unreachable
- E: java.net.ConnectException: Network is unreachable

Attachments (0)

Change History (15)

comment:1 Changed 4 years ago by stoecker

Owner: changed from team to miklcct@…
Status: newneedinfo

I doubt that your network is properly configured. Especially the JOSM server is reachable by IPv4 and IPv6. So however JOSM/Java tries it would reach the server. So I assume configuration on your side is wrong. Java defaults to prefer IPv4 connections.

Please try "ping josm.openstreetmap.de" and tell results. Same with "ping6 josm.openstreetmap.de". Do you probably use a proxy and forgot to set it in JOSM as well?

comment:2 Changed 4 years ago by miklcct@…

michael@laptop-ubuntu:~$ ping -c 4 josm.openstreetmap.de
connect: Network is unreachable
michael@laptop-ubuntu:~$ ping6 -c 4 josm.openstreetmap.de
PING josm.openstreetmap.de(josm.openstreetmap.de) 56 data bytes
64 bytes from josm.openstreetmap.de: icmp_seq=1 ttl=48 time=323 ms
64 bytes from josm.openstreetmap.de: icmp_seq=2 ttl=48 time=348 ms
64 bytes from josm.openstreetmap.de: icmp_seq=3 ttl=48 time=311 ms
64 bytes from josm.openstreetmap.de: icmp_seq=4 ttl=48 time=307 ms

--- josm.openstreetmap.de ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 307.675/322.783/348.601/16.016 ms

comment:3 Changed 4 years ago by stoecker

Resolution: worksforme
Status: needinfoclosed

If ping can't access josm.openstreetmap.de, then this is not JOSM specific. Your IPv6 network is setup correctly, but your IPv4 connectivity is broken.

Nothing we can help with I fear. I have only dual stacked networks.

comment:4 Changed 4 years ago by miklcct@…

Resolution: worksforme
Status: closedreopened

I deliberately put my machine on a network with no IPv4 and it should not fail with only IPv6. Please reopen the issue because I am reporting josm failing in IPv6 only network.

comment:5 Changed 4 years ago by stoecker

Resolution: worksforme
Status: reopenedclosed

As said: When "ping" cannot access IPv4 addresses, then this is nothing special to JOSM. Simply your whole machine cannot access IPv4 then. So you aren't able to access any IPv4 address.

You can set expert option "prefer.ipv6" then you can access josm.openstreetmap.de and also api.openstreetmap.org, but already nearly all background imagery will fail, because they don't have IPv6 addresses.

You need to fix you machine to correctly work with IPv4 as well. IPv6 only is not an option today.

comment:6 Changed 4 years ago by miklcct@…

Sorry I think you have to study more about IP network. I am running IPv6 with NAT64 and DNS64 from my ISP. There has been a few mobile operators giving out IPv6 only addresses today. As you have mentioned that the API server has IPv6 addresses, it should be possible for us to connect using IPv6 only. Even some other servers are IPv4 only, as long as the ISP has a NAT64 and DNS64 server, IPv6 only hosts are able to connect to them by host names. IPv4 literals will fail, but a properly written application should not hard code any IP addresses for proper functioning.

Telling the user network is unreachable when in fact he is able to browse OpenStreetMap correctly is not what a user expects.

comment:7 Changed 4 years ago by stoecker

Sorry I think you have to study more about IP network

I'm developing networking software for about 15 years now and did implementation of IPv6 in our company software many years ago. Our company servers as well as my private managed servers are running dual stacked for several years now. Believe me that I know what I'm talking about.

Your IPv4 network IS unreachable! On your system only IPv6 is working. The option I told you above switches JOSM to prefer IPv6. If your network translation is working fine and nobody is back-translating the mapped addresses, then you may be able to use most pages also from JOSM.

BTW, even you IPv6 setup must be broken: With proper working NAT64 and DNS64 JOSM would only see an IPv6 address and never try IPv4. So when JOSM fails this cannot be the case.

Telling the user network is unreachable when in fact he is able to browse OpenStreetMap correctly is not what a user expects.

Java tries only one connection, many browsers try multiple connections until one succeeds. So a browser may hide a broken network, Java doesn't do it.

Anyway it remains a fact that I don't see any sense in such a setup as you describe, as a lot of software will not work with IPv6 only as well as remote control for JOSM wont work and many other things. In an dual IPv4/IPv6 network like we have nowadays having no IPv4 connectivity on the local host must be considered broken. And this will very likely be the case some decades in the future. When routers do such conversions transparent it is another issue. Devices with more restricted software like mobile phones may be used in IPv6 only networks much earlier, but not normal computers.

comment:8 Changed 4 years ago by miklcct@…

I am running JOSM on a laptop which moves between different networks. Some have only IPv4 and some have only IPv6. As long as the API server can be accessed by both Internet, JOSM should work across both. However, this is not the case.

In this case, when my laptop is in an IPv6-only network, the IPv4 connection stack is BROKEN. When my laptop is in an IPv4-only network, the IPv6 connection stack is also BROKEN. It does not make sense to tell the user to modify a configuration file "every time" when he moves between different networks. Especially, Ubuntu Phone has been released already and it is completely normal for a user to bring his Ubuntu phone, running JOSM on the ground to do mapping with an IPv6-only mobile Internet.

Java tries only one connection, many browsers try multiple connections until one succeeds. So a browser may hide a broken network, Java doesn't do it.

I don't care how the underlying programming language work, no matter it is C, C++, Java, Haskell, Scala, Javascript, etc. As long as I have a working Internet connection, JOSM should connect me to the server. Making it do this way should be as simple as writing a loop. Even for a single Internet, there may be multiple addresses returned by a host name, and some may be down at the moment.

comment:9 Changed 4 years ago by stoecker

If you have a laptop moving between IPv4 and IPv6 only networks, then configure it properly. In an IPv4 network address resolution should return IPv4 addresses. In an IPv6-only network it should return only IPv6 addresses. In an dual stacked network it can return both and application decides. My laptops are also moving between networks with IPv4 and IPv6 and they correctly handle that.

Relying on the user application to fix your broken network setup is strange.

Happy Eyeballs algorithms are a workaround and only a few applications implement them, most of them are browsers. Java does not implement this workaround. Open a bug report for java if you want it. We wont implement something alike in JOSM only to fix broken setups.

As long as I have a working Internet connection, JOSM should connect me to the server.

You don't. You have a broken setup. And as long as you don't accept that you will have trouble.

Get advice from some network expert to fix your system.

comment:10 Changed 4 years ago by miklcct@…

If you have a laptop moving between IPv4 and IPv6 only networks, then configure it properly. In an IPv4 network address resolution should return IPv4 addresses. In an IPv6-only network it should return only IPv6 addresses. In an dual stacked network it can return both and application decides. My laptops are also moving between networks with IPv4 and IPv6 and they correctly handle that.

The responsibility of getting whatever kind of network addresses to consume is in the application. I write applications in C/C++ and uses getaddrinfo(3) in order to resolve addresses. Sometimes it is useful to obtain IPv4 addresses even when the IPv4 connection is broken, for example, an application which does lookups for other purposes than connecting to it. In my configuration there are no IPv4 addresses, and if I program in C, I set AI_ADDRCONFIG in hints->ai_flags to getaddrinfo(), such that it does not return IPv4 addresses if there is no IPv4 connectivity. Similar for IPv6. It is the application, not the system, broken.

comment:11 Changed 4 years ago by hartmut.holzgraefe@…

I'm fighting with this while on the road right now. api.openstreetmap.org is accessible via Firefox and wget with the URLs Josm complains about. In-browser editing with ID works, BING background shows just fine there, too. It is only JOSM that tells me "network is unreachable"

This happens with both the venues "Freifunk" WLAN and when using my phone and USB teethering ...

I haven't looked into this too deeply yet, but for now I'm in the "It is the application, not the system" camp ...

comment:12 Changed 4 years ago by stoecker

As already said in comment 9 - Report this for java if you want improvements.

Here is already one bugreport regarding the proper address resolution handling. 2 Years old and nobody cared for it:
https://bugs.openjdk.java.net/browse/JDK-8016521

And as also already said: Set "prefer.ipv6" to true to workaround that or simply fix your IPv4 connectivity.

An IPV6 only network connection is simply not usable nowadays. And even if Java implementation of address resolution is non-optimal it is not our task to take care of these strange and in my eyes broken systems using IPv6 only.

comment:13 Changed 4 months ago by anonymous

It is bit strange that this is still a problem today.

I am using dual stack on my PC. Both ipv4 and ipv6 {over tunnel} working OK.

When starting JOSM I can see this message:

2019-05-09 11:12:03.703 INFO: Log level is at INFO (INFO, 800)
2019-05-09 11:12:04.165 INFO: Detected useable IPv6 network, preferring IPv6 over IPv4.
Warning: Nashorn engine is planned to be removed from a future JDK release
2019-05-09 11:12:07.178 INFO: GET ​https://api.openstreetmap.org/api/capabilities -> !!!
2019-05-09 11:12:07.179 WARNING: java.net.SocketTimeoutException: connect timed out

So I am opening settings and expert mode, finding prefer.ipv6 is set to "auto".
Changing that to "false" and restarting JOSM, working OK.

comment:14 Changed 11 days ago by Jaleks

Priority: majornormal
Resolution: worksforme
Status: closedreopened
Summary: network is unreachable on ipv6 only networknetwork (or API server) is unreachable on ipv6 only network

With (here) current Debian 11.0 and JOSM 15238 behind a FritzBox 6490 (FRITZ!OS: 07.01), which is in default config for IPv6 ("IPv6 with 6to4 tunnel protocol"), JOSM recognizes IPv6 at startup, but can not load any data from the API servers. (Workaround with expert option prefer.ipv6=false is working, but that should not be the way casual users would want to live with, in my opinion, all the more they would not really would know what to look for at all, to solve this.)

  • There should be at least a GUI option to set whether IPV6 shall be used (yes/no/only if IPv4 fails/auto) by JOSM.
  • The automatic check for IPv6 should check the data URLs which are currently set in JOSM, to be really sure they are reachable.
  • instead of just warning about proxy settings, if connection fails, the user should also be informed about the IPv6 option

$ ping josm.openstreetmap.de
PING josm.openstreetmap.de (95.216.72.248) 56(84) bytes of data.
64 bytes from josm.openstreetmap.de (95.216.72.248): icmp_seq=1 ttl=52 time=76.7 ms
64 bytes from josm.openstreetmap.de (95.216.72.248): icmp_seq=2 ttl=52 time=75.4 ms
64 bytes from josm.openstreetmap.de (95.216.72.248): icmp_seq=3 ttl=52 time=74.6 ms
^C
--- josm.openstreetmap.de ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 74.596/75.584/76.729/0.877 ms

$ ping6 josm.openstreetmap.de
PING josm.openstreetmap.de(josm.openstreetmap.de (2a01:4f9:2b:907::2)) 56 data bytes
64 bytes from josm.openstreetmap.de (2a01:4f9:2b:907::2): icmp_seq=1 ttl=57 time=74.1 ms
64 bytes from josm.openstreetmap.de (2a01:4f9:2b:907::2): icmp_seq=2 ttl=57 time=72.2 ms
64 bytes from josm.openstreetmap.de (2a01:4f9:2b:907::2): icmp_seq=3 ttl=57 time=73.1 ms
64 bytes from josm.openstreetmap.de (2a01:4f9:2b:907::2): icmp_seq=4 ttl=57 time=75.0 ms
^C
--- josm.openstreetmap.de ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 72.157/73.601/75.029/1.101 ms


$ ping api.openstreetmap.org
PING api.openstreetmap.org (130.117.76.11) 56(84) bytes of data.
64 bytes from 130.117.76.11 (130.117.76.11): icmp_seq=1 ttl=51 time=44.3 ms
64 bytes from 130.117.76.11 (130.117.76.11): icmp_seq=2 ttl=51 time=42.7 ms
64 bytes from 130.117.76.11 (130.117.76.11): icmp_seq=3 ttl=51 time=41.9 ms
^C
--- api.openstreetmap.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 41.884/42.954/44.295/1.030 ms

$ ping6 api.openstreetmap.org
PING api.openstreetmap.org(2001:978:2:2c::172:d (2001:978:2:2c::172:d)) 56 data bytes
^C
--- api.openstreetmap.org ping statistics ---
40 packets transmitted, 0 received, 100% packet loss, time 980ms


→ note the "40 packets transmitted, 0 received, 100% packet loss"

comment:15 Changed 11 days ago by stoecker

Resolution: worksforme
Status: reopenedclosed

Don't re-open old tickets which have nothing to do with your issue.

If you can't ping6 api.openstreetmap.org, then your IPv6 setup is broken, See e.g. #17761 for a similar issue with Telekom and svn.openstreetmap.org. Report the issue to your provider.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain miklcct@….
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.