question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FR] Update Java Client Libraries and Object Lifecycle Management

See original GitHub issue

Is your feature request related to a problem? Please describe. I received an email from Google advising me to update the GCP Java Client Libraries and Object Lifecycle Management. In my Gradle dependencies graph I have: com.google.cloud:google-cloud-storage:1.118.0, which I think should be at v2.6.0

Describe the solution you’d like Upgrade the GCP Java Client Libraries and Object Lifecycle Management dependencies. I don’t have much knowledge of dependency management in the Java ecosystem, but I think that #654 fixes this.

Describe alternatives you’ve considered I tried setting com.google.cloud:google-cloud-storage:2.6.0 in my gradle build script, but then I get exceptions at runtime.

Exception in thread "main" com.google.cloud.firestore.FirestoreException: java.lang.IllegalStateException: getTransportChannel() called when needsExecutor() is true
        at com.google.cloud.firestore.FirestoreException.forIOException(FirestoreException.java:94)
        at com.google.cloud.firestore.FirestoreOptions$DefaultFirestoreRpcFactory.create(FirestoreOptions.java:91)
        at com.google.cloud.firestore.FirestoreOptions$DefaultFirestoreRpcFactory.create(FirestoreOptions.java:81)
        at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:560)
        at com.google.cloud.firestore.FirestoreOptions.getFirestoreRpc(FirestoreOptions.java:365)
        at com.google.cloud.firestore.FirestoreImpl.<init>(FirestoreImpl.java:72)
        at com.google.cloud.firestore.FirestoreOptions$DefaultFirestoreFactory.create(FirestoreOptions.java:72)
        at com.google.cloud.firestore.FirestoreOptions$DefaultFirestoreFactory.create(FirestoreOptions.java:65)
        at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:540)
        at com.google.firebase.cloud.FirestoreClient.<init>(FirestoreClient.java:51)
        at com.google.firebase.cloud.FirestoreClient.<init>(FirestoreClient.java:29)
        at com.google.firebase.cloud.FirestoreClient$FirestoreClientService.<init>(FirestoreClient.java:95)
        at com.google.firebase.cloud.FirestoreClient.getInstance(FirestoreClient.java:85)
        at com.google.firebase.cloud.FirestoreClient.getFirestore(FirestoreClient.java:78)
        at com.google.firebase.cloud.FirestoreClient.getFirestore(FirestoreClient.java:64)

Additional context The contents of the email:

We’re writing to let you know that we have identified an issue with older versions of the Java Client Libraries and Object Lifecycle Management. Versions 1.50.0-2.2.3, 4.4.0 - 24.2.0 libraries-bom of this library will fail if buckets have configured any upcoming lifecycle actions. To read/set Google Cloud Storage buckets with any new lifecycle actions, update your Java client library to version 2.3.0 or higher.

What do I need to do? Update your Java Storage client to version 2.3.0 or higher to read/write Google Cloud Storage buckets with new lifecycle actions by June 20, 2022. You can find more details for the latest version in the Maven Central Repository.

If you’re unable to upgrade your Java client library version, select the needed bucket metadata fields to work with Google Cloud Storage buckets without accessing lifecycle rules.

The following example gets a bucket by selecting all bucket fields except the lifecycle rules:

Bucket bucket = storage.get(“bucket-name”, Storage.BucketGetOption.fields(Storage.BucketField.ID, Storage.BucketField.SELF_LINK, Storage.BucketField.NAME, Storage.BucketField.TIME_CREATED, Storage.BucketField.METAGENERATION, Storage.BucketField.ACL, Storage.BucketField.DEFAULT_OBJECT_ACL, Storage.BucketField.OWNER, Storage.BucketField.LABELS, Storage.BucketField.LOCATION, Storage.BucketField.LOCATION_TYPE, Storage.BucketField.WEBSITE, Storage.BucketField.VERSIONING, Storage.BucketField.CORS, Storage.BucketField.STORAGE_CLASS, Storage.BucketField.ETAG, Storage.BucketField.ENCRYPTION, Storage.BucketField.BILLING, Storage.BucketField.DEFAULT_EVENT_BASED_HOLD, Storage.BucketField.RETENTION_POLICY, Storage.BucketField.IAMCONFIGURATION, Storage.BucketField.LOGGING, Storage.BucketField.UPDATED)); The following example lists buckets by selecting all bucket fields except the lifecycle rules:

storage.list(Storage.BucketListOption.fields(Storage.BucketField.ID, Storage.BucketField.SELF_LINK, Storage.BucketField.NAME, Storage.BucketField.TIME_CREATED, Storage.BucketField.METAGENERATION, Storage.BucketField.ACL, Storage.BucketField.DEFAULT_OBJECT_ACL, Storage.BucketField.OWNER, Storage.BucketField.LABELS, Storage.BucketField.LOCATION, Storage.BucketField.LOCATION_TYPE, Storage.BucketField.WEBSITE, Storage.BucketField.VERSIONING, Storage.BucketField.CORS, Storage.BucketField.STORAGE_CLASS, Storage.BucketField.ETAG, Storage.BucketField.ENCRYPTION, Storage.BucketField.BILLING, Storage.BucketField.DEFAULT_EVENT_BASED_HOLD, Storage.BucketField.RETENTION_POLICY, Storage.BucketField.IAMCONFIGURATION, Storage.BucketField.LOGGING, Storage.BucketField.UPDATED)); If you have any questions or require assistance, please reply to this email to contact Google Cloud Support.

Thanks for choosing Google Cloud Storage.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lahirumarambacommented, May 5, 2022

Thank you @CameronProbert for reporting this issue. We are currently looking into upgrading the gcp dependencies. I need to confirm a list of things that we are breaking before moving forward with this. Please note that we have prioritized this task and will track any updates here.

1reaction
lahirumarambacommented, Jun 16, 2022

This should be fixed in v9.0.0. Thank you for your patience!

Read more comments on GitHub >

github_iconTop Results From Across the Web

EMAIL: Update your Java Libraries to work with cer...
We have recently received an email from GCP saying that we should update our Java client libraries to version 1.114.0 or higher.
Read more >
Object Lifecycle Management | Cloud Storage
In order to use Object Lifecycle Management, you define a lifecycle configuration, which must be set on a bucket. The configuration contains ...
Read more >
BucketInfo.LifecycleRule (Google Cloud Storage 1.118.0 API)
Lifecycle rule for a bucket. Allows supported Actions, such as deleting and changing storage class, to be executed when certain Conditions are met....
Read more >
Google Cloud Storage Client for Java - GitHub
See the Cloud Storage client library docs to learn how to use this Cloud Storage Client Library. Creating an authorized service object. To...
Read more >
Handling Lifecycles with Lifecycle-Aware Components
Your library clients can easily integrate those components without manual lifecycle management on the client side. Implementing a custom ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found