Skip to content

Can not download ~200GB file using storage blob #1425

@rdubitsky-syberry

Description

@rdubitsky-syberry

Execution fails when ~128gb is downloaded and code fail does not depend on time spent on downloading this 128 gb of file.

Environment details

OS type and version: Linux
Java version: 11

Code example

JsonObject jsonObject = new JsonObject(); jsonObject.addProperty(GoogleCredentialsConstants.CLIENT_ID, CLIENT_ID); jsonObject.addProperty(GoogleCredentialsConstants.CLIENT_EMAIL, CLIENT_EMAIL); jsonObject.addProperty(GoogleCredentialsConstants.ACCOUNT_TYPE, ACCOUNT_TYPE); jsonObject.addProperty(GoogleCredentialsConstants.PRIVATE_KEY_ID, PRIVATE_KEY_ID); jsonObject.addProperty(GoogleCredentialsConstants.PRIVATE_KEY, PRIVATE_KEY); String credentials = jsonObject.toString(); GoogleCredentials googleCredentials; try (InputStream inputStream = new ByteArrayInputStream(credentials.getBytes(StandardCharsets.UTF_8))) { googleCredentials = GoogleCredentials.fromStream(inputStream); } catch (IOException ex) { throw new CustomException(ex); } Storage storage = StorageOptions.newBuilder() .setProjectId(projectId) .setCredentials(googleCredentials ) .build() .getService(); Blob blob = storage.get(BlobId.of(bucketName, remoteFilePath)); blob.downloadTo(localFilePath); // line where code fails

Stack trace

Caused by: java.net.SocketException: Connection reset by peer (Write failed)	at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)	at java.base/java.net.SocketOutputStream.socketWrite(Unknown Source)	at java.base/java.net.SocketOutputStream.write(Unknown Source)	at java.base/sun.security.ssl.SSLSocketOutputRecord.flush(Unknown Source)	at java.base/sun.security.ssl.OutputRecord.changeWriteCiphers(Unknown Source)	at java.base/sun.security.ssl.KeyUpdate$KeyUpdateProducer.produce(Unknown Source)	at java.base/sun.security.ssl.KeyUpdate$KeyUpdateKickstartProducer.produce(Unknown Source)	at java.base/sun.security.ssl.SSLHandshake.kickstart(Unknown Source)	at java.base/sun.security.ssl.PostHandshakeContext.kickstart(Unknown Source)	at java.base/sun.security.ssl.TransportContext.kickstart(Unknown Source)	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)	at java.base/sun.security.ssl.SSLSocketImpl.tryKeyUpdate(Unknown Source)	at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)	at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(Unknown Source)	at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)	at java.base/java.io.BufferedInputStream.read1(Unknown Source)	at java.base/java.io.BufferedInputStream.read(Unknown Source)	at java.base/sun.net.www.MeteredStream.read(Unknown Source)	at java.base/java.io.FilterInputStream.read(Unknown Source)	at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)	at com.google.api.client.http.javanet.NetHttpResponse$SizeValidatingInputStream.read(NetHttpResponse.java:164)	at java.base/java.io.BufferedInputStream.read1(Unknown Source)	at java.base/java.io.BufferedInputStream.read(Unknown Source)	at java.base/java.io.FilterInputStream.read(Unknown Source)	at com.google.common.io.ByteStreams.copy(ByteStreams.java:112)	at com.google.api.client.googleapis.media.MediaHttpDownloader.executeCurrentRequest(MediaHttpDownloader.java:243)	at com.google.api.client.googleapis.media.MediaHttpDownloader.download(MediaHttpDownloader.java:183)	at com.google.api.client.googleapis.media.MediaHttpDownloader.download(MediaHttpDownloader.java:142) 

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions