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.

Firestore conflicting with Cloud Scheduler library

See original GitHub issue

Describe your environment

  • Operating System version: AppEngine Java 8 standard
  • Firebase SDK version: 6.10.0
  • Library version: 6.10.0
  • Firebase Product: Firestore

Describe the problem

Steps to reproduce:

I recently had to use Cloud Scheduler to trigger tasks for my AppEngine project.

Adding the dependency to the project :

implementation 'com.google.apis:google-api-services-cloudscheduler:v1-rev4-1.25.0'
implementation 'com.google.auth:google-auth-library-oauth2-http:0.17.2'

(The latest I had to add cause GoogleCredential depreciation)

From there, Firestore stopped working due to some opencensus library deprecation, logs are as follow :

java.lang.IllegalAccessError: tried to access field io.opencensus.trace.unsafe.ContextUtils.CONTEXT_SPAN_KEY from class io.grpc.internal.CensusTracingModule$TracingClientInterceptor

Checking the google-cloud-firestore library, it seems the problem was already fixed. So I tried to update my configuration as follow :

implementation("com.google.firebase:firebase-admin:6.10.0")  {
	exclude group: "com.google.cloud", module: "google-cloud-firestore"
}
implementation 'com.google.cloud:google-cloud-firestore:1.26.0'

From there, the dependency issue seems to be gone, although none of my query are performed correctly (at least in less than 60 seconds).

Relevant Code:

Reduced for lisibility :

FirestoreClient
                .getFirestore()
                .collection("my_collection")
                .whereEqualTo("id", object.getId())
                .get()
                .get()

The collection contains 15 documents, id is indexed, and the query times out when the AppEngine thread serving is dying, but it spent 58 seconds performing it (which is almost 58 more seconds than our firebase client on the frontend for the same query)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Sdwzcommented, Oct 8, 2019

Updated to Spring Cloud SR3, issue is fixed !

1reaction
Sdwzcommented, Oct 7, 2019

Thanks for your reply.

Let me takes this as a next step :

  1. Just read a couple issue here and a good first idea would be to raise the logging level to understand what’s happening in the background
  2. As for the dependencies issues, it’s similar to https://github.com/firebase/firebase-admin-java/issues/310
  3. Will try to replicate locally
  4. Going to make a small spring boot app and see if it happens once deployed and share it here.

Will report my finding asap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing conditions for Cloud Firestore Security Rules - Firebase
Note: The server client libraries bypass all Cloud Firestore Security Rules and instead authenticate through Google Application Default Credentials.
Read more >
Scheduling data exports | Firestore - Google Cloud
This page describes how to schedule exports of your Firestore data. To run exports on a schedule, we recommend using Cloud Functions and...
Read more >
Spring Framework on Google Cloud
Spring Data Cloud Firestore ... Cloud Firestore Spring Boot Starter; 15.10. ... To do that, go to the API library page of the...
Read more >
Cannot install google-api-core package in our python app ...
We want to install this package on the Google Cloud Platform. Could somebody please help me with the conflicting dependency issue? We tried...
Read more >
CouchDB, The Open-Source Cloud Firestore Alternative?
Since CouchDB runs on the server, many client library allows to ... So, the only way not to struggle with conflicts using Firestore...
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