Error uploading files
jonybuzz opened this issue · 2 comments
Netxlcoud version: 18.0
Connector version: 11.3.0
I am creating folders and uploading files to a dockerized Nextcloud Server from teh official image. I´m doing a batch upload (multiple files, sequentially) and it fails on some files, after creating all the folder structure. All the files are <1MB.
As a side note, I´m using Spring Boot as framework. Tryed the same WebDav operation from Postman and it works all the time. Also if I use Nextcloud UI. If you need any other info please let me know.
Does anybody knows why this could be happening?
My code snippet:
File srcFile = new File("name.pdf);
FileUtils.writeByteArrayToFile(srcFile, byteArray);
connector.uploadFile(srcFile, "MyFiles/docs/" + srcFile.getName());
srcFile.delete();
Logs:
Caused by: org.aarboard.nextcloud.api.exception.NextcloudApiException: org.apache.http.NoHttpResponseException: xxx_server_xxx:8080 failed to respond
at org.aarboard.nextcloud.api.webdav.Files.uploadFile(Files.java:59) ~[nextcloud-api-11.3.0.jar!/:na]
at org.aarboard.nextcloud.api.NextcloudConnector.uploadFile(NextcloudConnector.java:798) ~[nextcloud-api-11.3.0.jar!/:na]
at com.saenz.cconline.repository.NextCloudRepository.upload(NextCloudRepository.java:54) ~[classes!/:1.9.0]
... 42 common frames omitted
Caused by: org.apache.http.NoHttpResponseException: xxx_server_xxx:8080 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) ~[httpcore-4.4.13.jar!/:4.4.13]
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) ~[httpcore-4.4.13.jar!/:4.4.13]
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) ~[httpcore-4.4.13.jar!/:4.4.13]
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) ~[httpcore-4.4.13.jar!/:4.4.13]
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:221) ~[httpclient-4.5.12.jar!/:4.5.12]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165) ~[httpclient-4.5.12.jar!/:4.5.12]
at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:1050) ~[sardine-5.9.jar!/:5.9]
at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:1019) ~[sardine-5.9.jar!/:5.9]
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:930) ~[sardine-5.9.jar!/:5.9]
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:913) ~[sardine-5.9.jar!/:5.9]
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:901) ~[sardine-5.9.jar!/:5.9]
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:958) ~[sardine-5.9.jar!/:5.9]
at org.aarboard.nextcloud.api.webdav.Files.uploadFile(Files.java:56) ~[nextcloud-api-11.3.0.jar!/:na]
For me it looks like your server at xxxx:8080 isn't answering your requests.
This must be a problem in your docker network environment
I don´t know the real cause, but I changed the Nextcloud FPM+nginx image for the Apache one and it works fine now. Perhaps a reverse proxy configuration issue.
I had the previous version running with the official suggested config, unchanged.