firebase / firebase/firebase-admin-java

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

Đang mở
#860 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: core api: messaging
Ngôn ngữ chính
Java
Star
620
Fork
305
Merge trung bình
3 giờ 23 phút
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với các khai báo dependency của Firebase Admin và client Firebase Cloud Messaging chạy dưới dạng native image trên Cloud Run, đồng thời so sánh hành vi JVM và native-image đã được báo cáo. Tái hiện phản hồi 400 với việc loại trừ grpc-netty-shaded và thay thế bằng grpc-okhttp, sau đó xác định liệu vấn đề nằm ở việc xây dựng request hay ở cấu hình native-image. Được coi là hoàn tất khi đã ghi lại một cấu hình được hỗ trợ hoặc một chẩn đoán tối thiểu có thể tái hiện.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
firebase, gcp, grpc, java
Lĩnh vực
backend-api-design, cloud
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.