Cloud Firestore API calls do not respond running Java GAE Standard app locally on Apple M1

Viewed 172

Problem

My Java Backend application uses Firebase Admin SDK to make calls to Cloud Firestore. The application runs correctly on the App Engine Environment, but when it runs locally, Firestore calls remain pending, without ever receiving a response. This problem only occurs on my MacBook Air with Apple M1, on Windows I have no problems.

Specifications:

App: REST Web Service, using Java 8, Jersey 2.29, Maven.

IDE: IntelliJ IDEA - Community 2021.1 (for local delpoy I followed GCP's guide)

OS: Big Sur 11.2.3 on MacBook Air with Apple M1

Notes:

  • When the app runs locally, the app points to Cloud Firestore, not to a local Firestore emulator.
  • If I run the code snippet in a main method, it works perfectly.

Code snippet:

// Create a reference to the collection
CollectionReference collectionReference = FirestoreClient.getFirestore().collection(getCollectionPath());

// Create a query against the collection
DocumentReference documentReference = collectionReference.document(id);

ApiFuture<DocumentSnapshot> future = documentReference.get();

DocumentSnapshot documentSnapshot = future.get();

Obviously, setting a timout...

DocumentSnapshot documentSnapshot = future.get(TIMEOUT, TIME_UNIT);

...I get this error:

java.util.concurrent.TimeoutException: Waited 30000 milliseconds (plus 6 milliseconds delay) for com.google.api.core.AbstractApiFuture$InternalSettableFuture@627262b5[status=PENDING]

0 Answers
Related