firebase / firebase/firebase-admin-java

Running a native image on GCP (Cloud Run) throws error 400

Offen
#860 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: core api: messaging
Vorherrschende Sprache
Java
Sterne
620
Forks
305
Ø Merge
3 Std. 23 Min.
Gemergte PRs (30 T.)
1

Beschreibung

Hi,

Compiling to native this dependency:
```java

com.google.firebase
firebase-admin
9.2.0

```

makes the build fail because grpc-netty-shaded, however with this alternative we can compile:
```java


com.google.firebase
firebase-admin
9.2.0


io.grpc
grpc-netty-shaded




io.grpc
grpc-okhttp
1.51.1

```

The problem is that FCM client always responds with error 400:
```javascript
Exception in thread "main" com.google.firebase.messaging.FirebaseMessagingException: Unexpected HTTP response with status: 400
{
"error": {
"code": 400,
"message": "Recipient of the message is not set.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "message",
"description": "Recipient of the message is not set."
}
]
},
{
"@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "INVALID_ARGUMENT"
}
]
}
}
```

Running on JVM works fine.
There is a issue with same problem: https://github.com/GoogleCloudPlatform/native-image-support-java/issues/116 for the old google native support libraries. Their workarounds didn't work for me.

Are there any know solutions?
Thanks

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit den Firebase Admin-Abhängigkeitserklärungen und dem Firebase Cloud Messaging-Client, der als natives Image auf Cloud Run ausgeführt wird, und vergleiche das gemeldete Verhalten von JVM und native-image. Reproduziere die 400-Antwort mit dem Ausschluss von grpc-netty-shaded und der Ersetzung durch grpc-okhttp und ermittle anschließend, ob das Problem in der Anfrageerstellung oder in der native-image-Konfiguration liegt. Als abgeschlossen gilt die Aufgabe, wenn eine unterstützte Konfiguration oder eine minimale reproduzierbare Diagnose dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
firebase, gcp, grpc, java
Bereich
backend-api-design, cloud
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.