FCM: send()/sendEachForMulticast() with `fid` return NotRegistered for a FID that Console delivers to at the same moment
维护者通常 1 天内回复
@Doris-Ge 已经在做这个了。
开始于 2026年10月21日。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 22/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
- 领域
- backend
调研方向
The failing calls are Messaging.send() with fid and Messaging.sendEachForMulticast() with fids, both returning messaging/installation-id-not-registered with a 404. Start by reproducing with a FID from a fresh client register() call, then compare results under the emulator's user credentials and under a deployed function's service account, since the reporter has not yet tested the latter. Done means either a credential-identity explanation confirmed by the reporter or a reproducible SDK-side cause with a fix.
由索引模型根据 Issue 内容生成。
描述
[READ] Step 1: Are you in the right place?
Yes — this is about the code in firebase-admin-node itself (Messaging.send() / Messaging.sendEachForMulticast() FID targeting).
[REQUIRED] Step 2: Describe your environment
- Operating System version: Ubuntu 24.04.4 LTS (WSL2, kernel 6.6.114.1-microsoft-standard-WSL2)
- Firebase SDK version:
firebase-admin14.5.0 (also reproduces on^14.4.0); client-sidefirebase12.19.0 /@firebase/messaging0.13.3 - Firebase Product: Cloud Messaging (FCM) — Firebase Installation ID (FID) targeting
- Node.js version: 22.23.x
- NPM version: 10.8.2 (package management via pnpm workspaces; npm version given for reference)
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
- Client registers for push notifications using the new FID-based API:
register(messaging, { vapidKey, serviceWorkerRegistration })fromfirebase/messaging.
onRegisteredfires with FIDceewOt8IieuDcWg1YUkduN. - In the Firebase Console → Cloud Messaging → Compose notification → Send test message, the same FID is pasted into "Firebase Installation ID or FCM registration
token". Delivery succeeds. - From a Node backend using
firebase-admin, both of the following are called for the same FID and both fail:
Both reject / returnawait getMessaging().send({ fid: 'ceewOt8IieuDcWg1YUkduN', notification: { title, body }, }); // and await getMessaging().sendEachForMulticast({ fids: ['ceewOt8IieuDcWg1YUkduN'], notification: { title, body }, });success: falsewith aNotRegisterederror (see Relevant Code for the full error object). - Immediately after step 3's failure (within the same minute), repeating step 2 (Console test send) with the identical FID succeeds again.
This rules out:
- Propagation delay (Console succeeds within the same minute as the failed Admin SDK calls, both before and after).
- A multicast-specific bug (reproduces identically on both
send()andsendEachForMulticast()). - Project/config mismatch (
firebase useconfirms the same project,refpro-app-staging, as the client'sVITE_FIREBASE_PROJECT_ID).
Note: this reproduction was observed while running the backend via the Firebase Functions emulator (firebase emulators:start --only functions), authenticated
via a firebase login user session (no GOOGLE_APPLICATION_CREDENTIALS / gcloud ADC configured locally) rather than a deployed function's service account.
Re-testing against a real deployed Cloud Function (with its actual runtime service account) is still pending on our side — flagging this in case the discrepancy turns
out to be credential-identity-related rather than an SDK bug; will update this issue once confirmed either way.
Possibly related: #2970 reports Console succeeding while Admin SDK's sendEachForMulticast() fails with a 404, but with a different error shape (raw HTML, not a
structured NotRegistered error) and using legacy tokens rather than FIDs — closed by the reporter without explanation, so inconclusive whether it's the same root
cause.
Relevant Code:
import { getMessaging } from 'firebase-admin/messaging';
const response = await getMessaging().sendEachForMulticast({
fids: ['ceewOt8IieuDcWg1YUkduN'],
notification: { title: 'Test', body: 'Test' },
});
// response.responses[0] => { success: false, error: FirebaseMessagingError }
FirebaseMessagingError: NotRegistered
code: 'messaging/installation-id-not-registered',
cause: RequestResponseError: Server responded with status 404.
httpResponse: { status: 404, ... }
codePrefix: 'messaging'
- 主要语言
- TypeScript
- 星标
- 1.7k
- 派生
- 423
- 平均合并
- 1 天 54 分钟
- 30 天内合并 PR
- 16
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-admin-node 的其他 Issue
-
Password policy violation is reported as `auth/internal-error` instead of a specific error code可能已有人在做 @lahirumaramba 于 15 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
firebase/firebase-admin-node#3265 · 已指派 1 人 ·
维护者通常 1 天内回复
-
getToken() replays a failed token refresh to later callers while a valid token is cached可能已有人在做 @GUMBOKIM 于 69 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
firebase/firebase-admin-node#3234 ·
维护者通常 1 天内回复
-
Misleading error message for THIRD_PARTY_AUTH_ERROR: raw "OAuth 2 access token" text surfaced instead of the APNs-specific message可能已有人在做 @milcho0604 于 71 天前认领。 未关闭api: messaging
难度 3/5 1-2 天 新手友好度 70/100
firebase/firebase-admin-node#3215 ·
维护者通常 1 天内回复
-
api: messaging
难度 5/5 一周以上 新手友好度 28/100
firebase/firebase-admin-node#3214 ·
维护者通常 1 天内回复
-
[Firestore] Re-export functions from '@google-cloud/firestore/pipelines'可能重新可做 @jonathanedey 于 114 天前认领,目前没有进行中的 PR。 未关闭api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 firebase/firebase-admin-node 的全部 Issue
相似的 Issue
-
area:agent-view area:tui bug platform:macos
难度 2/5 1-3 小时 新手友好度 70/100
anthropics/claude-code#104558 ·
维护者通常 1 天内回复
-
updater
难度 2/5 1-3 小时 新手友好度 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
难度 2/5 1-3 小时 新手友好度 74/100
inmanta/web-console#7606 ·
维护者通常 1 天内回复
-
bug skills
难度 2/5 1-3 小时 新手友好度 77/100
equinor/fusion-framework#5846 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 74/100