Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Storage: Unable to get blobs with space in their name after upgrading to 1.103.0 #53

Closed
zeev-lilt opened this issue Jan 10, 2020 · 5 comments
Assignees
Labels
api: storage Issues related to the googleapis/java-storage API. duplicate This issue or pull request already exists 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@zeev-lilt
Copy link

zeev-lilt commented Jan 10, 2020

  1. API: Cloud storage
  2. OS type and version: OSX
  3. Java version: 1.8.0_161
  4. storage version(s): 1.103.0

Steps to reproduce

  1. Upload a blob that contains a space in its name.
  2. Try to get it.

Code example

Storage gcs = StorageOptions.getDefaultInstance().getService();
gcs.get("my_bucket", "my blob")
// returns null

Any additional information below

This works in version 1.102.0 but returns null in 1.103.0.
I've tried replacing the space with %20 or +, but that didn't work either.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 11, 2020
@dmitry-fa
Copy link
Contributor

Yes, this functionality is broken.
The issue: #57

@elharo
Copy link
Contributor

elharo commented Jan 15, 2020

Tracking in #57

@elharo elharo closed this as completed Jan 15, 2020
@google-cloud-label-sync google-cloud-label-sync bot added the api: storage Issues related to the googleapis/java-storage API. label Jan 31, 2020
@elharo
Copy link
Contributor

elharo commented Feb 10, 2020

FYI, this is believed to be completely fixed in the current versions of the relevant libraries that you get with libraries-bom 4.0.0. If anyone still sees this with the latest versions of all libraries, please reopen this bug and @ me.

@dmitry-fa
Copy link
Contributor

@elharo No, it doesn't work with libraries-bom 4.0.0

Simple code to reproduce:

package storage;
import com.google.cloud.storage.*;
public class Spaces {
    public static void main(String... args) throws Exception {
        String bucketName = "bucket_generation_signed";
        String blobName = "1 2";
        byte[] content = "Hello world".getBytes("utf8");
        StorageOptions.getDefaultInstance().getService().create(BlobInfo.newBuilder(bucketName, blobName ).build(), content);
        System.out.println("sent: " + content.length);
        Storage s = StorageOptions.getDefaultInstance().getService();
        byte[] read = s.readAllBytes(bucketName, blobName);
        System.out.println("read: " + read.length);
    }
}

Exception in thread "main" com.google.cloud.storage.StorageException: 404 Not Found
No such object: bucket_generation_signed/1+2

@dmitry-fa
Copy link
Contributor

@elharo #57 is still open, I don't think we need to reopen this one.

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. duplicate This issue or pull request already exists 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants