ipfs-shipyard / java-ipfs-http-client

A Java implementation of the HTTP IPFS API
MIT License
538 stars 243 forks source link

IPFS.add "Connection reset" Problem #179

Closed Elegenthus closed 1 year ago

Elegenthus commented 3 years ago

I'm trying to upload files to my server by using the official examples and got Connection reset errors.

IPFS ipfs = new IPFS(new MultiAddress("/ip4/my_server_ip/tcp/5001"));
NamedStreamable.FileWrapper savefile = new NamedStreamable.FileWrapper(new File(newPath));
MerkleNode result = ipfs.add(savefile).get(0);

java.lang.RuntimeException: Connection reset at io.ipfs.api.Multipart.finish(Multipart.java:155) at io.ipfs.api.IPFS.add(IPFS.java:118) at io.ipfs.api.IPFS.add(IPFS.java:107) at io.ipfs.api.IPFS.add(IPFS.java:103) at io.ipfs.api.IPFS.add(IPFS.java:99) at com.elegenthus.fabricdemo.test.demo1VerifyOrgs.main(demo1VerifyOrgs.java:110) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:209) at java.net.SocketInputStream.read(SocketInputStream.java:141) at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) at java.io.BufferedInputStream.read1(BufferedInputStream.java:286) at java.io.BufferedInputStream.read(BufferedInputStream.java:345) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:675) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) at io.ipfs.api.Multipart.finish(Multipart.java:129) ... 10 more

Can you provide any solutions ?

mognify commented 1 year ago

which of those 3 lines is line 110 in your demo1VerifyOrgs.java?

kevodwyer commented 1 year ago

Closing issue as stale, feel free to re-open and provide more detail if required