﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
22160	[PATCH] Retry on `SocketException: Unexpected end of file from server`	MichaelFS	team	"==== What steps will reproduce the problem?
1. Open JOSM and create one or more changes, no matter whether on ode, way or relation 
2. Click UPload

==== What is the expected result?
UPload should be accepted, a ""SUCCESS""-message should be displayed.

==== What happens instead?
Message: Connection with Remote-Server
`https://api.openstreetmap.org/api/0.6/`failed.
Please check your Internet-connection.

Of course, the Internet-connection is stable and ONline. Nevertheless, I experienced such failures up to five times for one changeset.

The issue has been reported multiple times since January 2022 from several users in the German Forum [ https://forum.openstreetmap.org/viewtopic.php?id=74624]

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
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 de) Linux Manjaro Linux
Memory Usage: 292 MB / 7832 MB (143 MB allocated, but free)
Java version: 18.0.1.1+2, N/A, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.nimbus.NimbusLookAndFeel
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: de_DE.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: de_DE
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: KDE
VM arguments: [--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, -Djosm.restart=true, -Dawt.useSystemAAFontSettings=gasp]

Plugins:
+ buildings_tools (35978)
+ continuosDownload (99)
+ fieldpapers (v0.5.0)
+ reverter (35980)
+ terracer (35893)
+ undelete (35893)
+ utilsplugin2 (35978)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/AddressValidator&zip=1
}}}

----
Note: The below stack traces may not be related to the above issue (was closed as `othersoftware`, see comment:1 )
From comment:12/comment:24
{{{
2022-06-23 21:48:55.554 INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create (229 B) ...
2022-06-23 21:48:55.558 INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create -> !!! (1 ms)
2022-06-23 21:48:55.559 WARNING: java.net.SocketException: Unexpected end of file from server. Cause: java.net.SocketException: Unexpected end of file from server
java.net.SocketException: Unexpected end of file from server
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1974)
	at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1969)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1968)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
	at org.openstreetmap.josm.tools.Http1Client$1.getResponseCode(Http1Client.java:94)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:161)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:124)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:729)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:673)
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:668)
	at org.openstreetmap.josm.io.OsmApi.sendPutRequest(OsmApi.java:663)
	at org.openstreetmap.josm.io.OsmApi.openChangeset(OsmApi.java:463)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:202)
	at org.openstreetmap.josm.gui.io.UploadPrimitivesTask.realRun(UploadPrimitivesTask.java:266)
	at org.openstreetmap.josm.gui.io.AsynchronousUploadPrimitivesTask.realRun(AsynchronousUploadPrimitivesTask.java:129)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
	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)
Caused by: java.net.SocketException: Unexpected end of file from server
	at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:866)
	at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1615)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3135)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:295)
	at org.openstreetmap.josm.tools.Http1Client$1.getResponseVersion(Http1Client.java:85)
	... 15 more

2022-06-23 21:48:55.560 INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create (229 B) ...
2022-06-23 21:48:55.684 INFO: PUT https://api.openstreetmap.org/api/0.6/changeset/create -> HTTP/1.1 200 (74 ms; 9 B)
2022-06-23 21:48:55.684 INFO: OK
}}}"	defect	closed	normal	22.08	Core	latest	fixed	Api 0.6, Upload	
