Skip to content

GCS Upload failure from CRC32C mismatch #2099

Description

@josephui

While uploading files on via google-cloud-storage 1.0.2 / java 8, infrequently there are error messages indicating that a file has failed to upload due to CRC32C mismatch (where the calculated CRC32C=AAAAAA==, see this.

Sample code we used to produces this:

void uploadToGcs (String path, byte[] content, String mimeType, String cacheControl) {
	Builder blobBuilder = BlobInfo.newBuilder(getBucketName(), path);
	blobBuilder.setCacheControl(cacheControl);
	blobBuilder.setContentType(mimeType);
	BlobInfo blob = blobBuilder.build();

	try {
		storageClient.create(blob, content);
	} catch (StorageException e) {
		LOG.error("Failed to upload: " + path);
		throw e;
	}
}

Logs:

May 31 11:56:48 Uploading File: my-folder-1/test_file_882 on thread 1, size: 408148 bytes
May 31 11:56:48 Uploading File: my-folder-2/test_file_882 on thread 2, size: 408148 bytes
May 31 11:56:53 Uploading File: my-folder-2/test_file_883 on thread 2, size: 354568 bytes
May 31 11:56:57 Uploading File: my-folder-2/test_file_884 on thread 2, size: 315652 bytes
May 31 11:57:01 Uploading File: my-folder-2/test_file_885 on thread 2, size: 394800 bytes
May 31 11:57:05 Uploading File: my-folder-2/test_file_886 on thread 2, size: 391980 bytes
May 31 11:57:09 Failed to upload: my-folder-1/test_file_882 on thread 1
May 31 11:57:09 ERROR - restarting runner: : com.google.cloud.storage.StorageException: Provided CRC32C "eThpEg==" doesn't match calculated CRC32C "AAAAAA==".|at com.google.cloud.storage.spi.v1.HttpStorageRpc.translate(HttpStorageRpc.java:189)|at com.google.cloud.storage.spi.v1.HttpStorageRpc.create(HttpStorageRpc.java:240)|at com.google.cloud.storage.StorageImpl$3.call(StorageImpl.java:151)|at com.google.cloud.storage.StorageImpl$3.call(StorageImpl.java:148)|at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:93)|
May 31 11:57:09 Uploading File: my-folder-2/est_file_887 on thread 2, size: 322984 bytes
May 31 11:57:12 Uploading File: my-folder-2/est_file_888 on thread 2, size: 429204 bytes
May 31 11:57:13 Uploading File: my-folder-1/est_file_882 on thread 1, size: 408148 bytes
May 31 11:57:13 Uploading File: my-folder-1/est_file_883 on thread 1, size: 354568 bytes
May 31 11:57:13 Uploading File: my-folder-1/est_file_884 on thread 1, size: 315652 bytes

The uploading is done with two threads uploading files sequentially (a file is generated every 4 seconds), note that thread 2 continue to upload successfully for the duration of the error in thread 1, thus we can rule out general connectivity issue. Also note that it took a long time (21 seconds) for the error to bounce back.

Can anyone shed light to this behavior?
Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.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