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

Incompatible conversion from Pub/Sub emulator to CloudEvent for `CloudEventsFunction`

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

@taeold がすでに取り組んでいます。

2026年3月2日 から。

評価

この issue はまだ評価されていません。

説明

enhancement

In invoker/core/src/main/java/com/google/cloud/functions/invoker/Event.java, the conditional check for messages originating from the Pub/Sub emulator strips the name field, which is incompatible with this repository's conversion from legacy events to CloudEvent, throwing an exception when calling Resource.from because Resource.name is not nullable. This makes use of CloudEventFunction incompatible with a Pub/Sub emulator setup for local development.

Example stack trace:

2026-02-23 17:25:21 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Missing required properties: name
2026-02-23 17:25:21     at com.google.gson.Gson.fromJson(Gson.java:1381)
2026-02-23 17:25:21     at com.google.gson.Gson.fromJson(Gson.java:1259)
2026-02-23 17:25:21     at com.google.gson.Gson.fromJson(Gson.java:1169)
2026-02-23 17:25:21     at com.google.gson.Gson.fromJson(Gson.java:1106)
2026-02-23 17:25:21     at com.google.cloud.functions.invoker.CloudFunctionsContext$Resource.from(CloudFunctionsContext.java:109)
2026-02-23 17:25:21     at com.google.cloud.functions.invoker.GcfEvents$EventAdapter.convertToCloudEvent(GcfEvents.java:143)
2026-02-23 17:25:21     at com.google.cloud.functions.invoker.GcfEvents.convertToCloudEvent(GcfEvents.java:116)
2026-02-23 17:25:21     at
com.google.cloud.functions.invoker.BackgroundFunctionExecutor$CloudEventFunctionExecutor.serviceLegacyEvent(BackgroundFunctionExecutor.java:325)
2026-02-23 17:25:21     at
com.google.cloud.functions.invoker.BackgroundFunctionExecutor.lambda$serviceLegacyEvent$8(BackgroundFunctionExecutor.java:402)
2026-02-23 17:25:21     at com.google.cloud.functions.invoker.BackgroundFunctionExecutor.runWithContextClassLoader(BackgroundFunctionExecutor.java:409)
2026-02-23 17:25:21     at com.google.cloud.functions.invoker.BackgroundFunctionExecutor.serviceLegacyEvent(BackgroundFunctionExecutor.java:402)
2026-02-23 17:25:21     at com.google.cloud.functions.invoker.BackgroundFunctionExecutor.handle(BackgroundFunctionExecutor.java:345)
2026-02-23 17:25:21     at org.eclipse.jetty.server.handler.EagerContentHandler.onConditionsMet(EagerContentHandler.java:155)
2026-02-23 17:25:21     at org.eclipse.jetty.server.handler.ConditionalHandler.handle(ConditionalHandler.java:378)
2026-02-23 17:25:21     at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:794)
2026-02-23 17:25:21     at com.google.cloud.functions.invoker.runner.Invoker$NotFoundHandler.handle(Invoker.java:498)
2026-02-23 17:25:21     at org.eclipse.jetty.server.Server.handle(Server.java:195)
2026-02-23 17:25:21     at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:680)
2026-02-23 17:25:21     at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:411)
2026-02-23 17:25:21     at org.eclipse.jetty.server.internal.HttpConnection$FillableCallback.succeeded(HttpConnection.java:1809)
2026-02-23 17:25:21     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
2026-02-23 17:25:21     at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:54)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:492)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.epcRunTask(AdaptiveExecutionStrategy.java:428)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:401)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:255)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:204)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:312)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:1009)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1239)
2026-02-23 17:25:21     at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1194)
2026-02-23 17:25:21     at java.base/java.lang.Thread.run(Unknown Source)
2026-02-23 17:25:21 Caused by: java.lang.IllegalStateException: Missing required properties: name
2026-02-23 17:25:21     at
com.google.cloud.functions.invoker.$AutoValue_CloudFunctionsContext_Resource$Builder.build($AutoValue_CloudFunctionsContext_Resource.java:108)
2026-02-23 17:25:21     at
com.google.cloud.functions.invoker.AutoValue_CloudFunctionsContext_Resource$GsonTypeAdapter.read(AutoValue_CloudFunctionsContext_Resource.java:118)
2026-02-23 17:25:21     at
com.google.cloud.functions.invoker.AutoValue_CloudFunctionsContext_Resource$GsonTypeAdapter.read(AutoValue_CloudFunctionsContext_Resource.java:25)
2026-02-23 17:25:21     at com.google.gson.Gson.fromJson(Gson.java:1358)
2026-02-23 17:25:21     ... 31 more
2026-02-23 17:25:21

This issue does not affect BackgroundFunction as Resource.from is not called when servicing legacy events without conversion.

主要言語
Java
スター
154
フォーク
63
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

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

GoogleCloudPlatform/functions-framework-java のほかの issue

GoogleCloudPlatform/functions-framework-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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