Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#860 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
firebase, gcp, grpc, java

調査の方向性

Firebase Admin の依存関係宣言と、Cloud Run 上でネイティブイメージとして実行される Firebase Cloud Messaging クライアントから始め、報告されている JVM と native-image の動作を比較します。grpc-netty-shaded の除外と grpc-okhttp の置換を行った状態で 400 レスポンスを再現し、そのうえで問題がリクエストの構築にあるのか、native-image の設定にあるのかを判断します。サポートされる設定または最小限の再現可能な診断を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

api: core api: messaging

Hi,

Compiling to native this dependency:

<dependency>
      <groupId>com.google.firebase</groupId>
      <artifactId>firebase-admin</artifactId>
      <version>9.2.0</version>
</dependency>

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

<!-- FCM -->
    <dependency>
      <groupId>com.google.firebase</groupId>
      <artifactId>firebase-admin</artifactId>
      <version>9.2.0</version>
      <exclusions>
        <exclusion>
          <groupId>io.grpc</groupId>
          <artifactId>grpc-netty-shaded</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!--Using OkHttp over netty because the shaded netty included in grpc does not work with native image-->
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-okhttp</artifactId>
      <version>1.51.1</version>
    </dependency>

The problem is that FCM client always responds with error 400:

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

主要言語
Java
スター
620
フォーク
305
平均マージ
4日 9時間
マージ済み PR(30日)
4

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firebase/firebase-admin-java のほかの issue

firebase/firebase-admin-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。