Sitelet https://github.com/googleapis/google-cloud-java/issues/1237#top
Skip to content

400 Bad Request on Storage.copy #1237

Description

@mziccard

I started seeing this today. Sometimes our integration tests fail with the following error:

ITStorageTest.testCopyBlob:683 » Storage 400 Bad Request
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 
400 Bad Request
No file found in request.

The code that causes the error is the following:

String sourceBlobName = "test-copy-blob-source";
BlobId source = BlobId.of(BUCKET, sourceBlobName);
ImmutableMap<String, String> metadata = ImmutableMap.of("k", "v");
BlobInfo blob = BlobInfo.builder(source)
    .contentType(CONTENT_TYPE)
    .metadata(metadata)
    .build();
Blob remoteBlob = storage.create(blob, BLOB_BYTE_CONTENT);
assertNotNull(remoteBlob);
String targetBlobName = "test-copy-blob-target";
Storage.CopyRequest req = Storage.CopyRequest.of(source, BlobId.of(BUCKET, targetBlobName));
CopyWriter copyWriter = storage.copy(req); // Exception thrown here

What's weird is that we never experienced this error before today and it does not occur systematically. @Capstan any idea?

Activity

  1. Capstan commented on Sep 9, 2016

    @Capstan
    Contributor

    For issues like this, the service team finds it super helpful if you can also specify one or more example requests' HTTP log, with request and response headers and body, and any timing information. Scrub the Authorization header or any OAuth token in the request if posting to public fora.

  2. mziccard commented on Sep 9, 2016

    @mziccard
    ContributorAuthor

    For reference: the team in charge of this has been informed and the issue is being taken care of.

  3. mziccard commented on Sep 15, 2016

    @mziccard
    ContributorAuthor

    This was fixed on the service-side. I'll reopen in case we experience again.

  4. added a commit that references this issue on Dec 22, 2025
  5. added a commit that references this issue on Feb 24, 2026
  6. added a commit that references this issue on Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions