Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messaging/unknown-error when using sendEachForMulticast #2687

Closed
davideicardi opened this issue Aug 27, 2024 · 15 comments
Closed

messaging/unknown-error when using sendEachForMulticast #2687

davideicardi opened this issue Aug 27, 2024 · 15 comments

Comments

@davideicardi
Copy link

davideicardi commented Aug 27, 2024

  • Operating System version: AWS Lambda
  • Firebase SDK version: firebase-admin 12.3.0 (but also previous versions)
  • Firebase Product: message notification
  • Node.js version: Node.JS 18
  • NPM version: 9

I have a project that send notification messages to Android and IoS. We use sendEachForMulticast method. It worked fine for several months. But recently we started to receive the following error:

{
"code":"messaging/unknown-error"
"message":"Operation is not implemented, or supported, or enabled. Raw server response: "{"error":{"code":501,"message":"Operation is not implemented, or supported, or enabled.","status":"UNIMPLEMENTED"}}""
}

We create the messages, using the MulticastMessage type, with the following structure:

{
      tokens: [token1, token2],
      data: {
         // ... (string->string)
      },
      android: {
        priority: 'normal',
        ttl: TTL_SECONDS * 1000,
      },
      fcmOptions: {
        analyticsLabel: 'my-label',
      },
      apns: {
        payload: {
          aps: {
            alert: {
              titleLocKey: 'key1',
              locKey: 'key2',
              locArgs: ['value1'],
            },
          },
          contentAvailable: true,
        },
        headers: {
          'apns-expiration': `${Math.floor(Date.now() / 1000) + TTL_SECONDS}`,
        },
      },
    };

Any ideas of what can be the problem? It could be related to https://firebase.google.com/docs/cloud-messaging/migrate-v1?authuser=0&hl=en ?

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@davideicardi davideicardi changed the title when using sendEachForMulticast messaging/unknown-error when using sendEachForMulticast Aug 27, 2024
@davideicardi
Copy link
Author

Sorry, my fault. I still used sendMulticast deprecated method.

@quanndh
Copy link

quanndh commented Sep 5, 2024

sendMulticast

hi what should we use instead?

@davideicardi
Copy link
Author

sendEachForMulticast
From the latest version of the lib

@Sanjeevbadnur
Copy link

Hi Team,

Issue :
Facing inconsistent push notifications. With same token without any changes push notifications works for some times and does not works some times.

Platform : Android and IOS
Codebase : node.js
Firebase-admin sdk version : 12.4.0
Node.js version: Node.JS 20

Sample node code :

let message = {
  tokens: array of fcm tokens
  notification: 
    {
       title: "test_title",
       body: push notification message,
    },
  data: 
    {
       data: payload,
       alertType: "crash",
    },
};

let response = await firebaseAdmin.messaging().sendEachForMulticast(message);

The error message is random and either one of them

  1. {"success":false,"error":{"code":"messaging/mismatched-credential","message":"SenderId mismatch"}}

  2. {"success":false,"error":{"code":"messaging/unknown-error","message":"Operation is not implemented, or supported, or enabled. Raw server response: "{"error":{"code":501,"message":"Operation is not implemented, or supported, or enabled.","status":"UNIMPLEMENTED"}}""}}

  3. {"success":false,"error":{"code":"messaging/registration-token-not-registered","message":"Requested entity was not found."}}

@p29hieu
Copy link

p29hieu commented Sep 10, 2024

Hi Team,

Issue : Facing inconsistent push notifications. With same token without any changes push notifications works for some times and does not works some times.

Platform : Android and IOS Codebase : node.js Firebase-admin sdk version : 12.4.0 Node.js version: Node.JS 20

Sample node code :

let message = {
  tokens: array of fcm tokens
  notification: 
    {
       title: "test_title",
       body: push notification message,
    },
  data: 
    {
       data: payload,
       alertType: "crash",
    },
};

let response = await firebaseAdmin.messaging().sendEachForMulticast(message);

The error message is random and either one of them

  1. {"success":false,"error":{"code":"messaging/mismatched-credential","message":"SenderId mismatch"}}
  2. {"success":false,"error":{"code":"messaging/unknown-error","message":"Operation is not implemented, or supported, or enabled. Raw server response: "{"error":{"code":501,"message":"Operation is not implemented, or supported, or enabled.","status":"UNIMPLEMENTED"}}""}}
  3. {"success":false,"error":{"code":"messaging/registration-token-not-registered","message":"Requested entity was not found."}}

Same Issue

SokratisVidros added a commit to novuhq/novu that referenced this issue Sep 10, 2024
Use sendEachForMulticast instead of sendMulticast that is now deprecated.

See firebase/firebase-admin-node#2687
@levepic
Copy link

levepic commented Sep 11, 2024

Where is it stated that sendEach is deprecated? https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.messaging#messagingsendeach Its still in the docu. Thanks for the answer I couldnt find out whats wrong since they secretely changed the method and the error response is misleading, also tests are misleading because for some of the requests they let it go through while randomly others get refused!:D

@byeong1
Copy link

byeong1 commented Sep 12, 2024

same issue

Platform : Android and IOS
Codebase : node.js
Firebase-admin sdk version : 12.2.0,
Node.js version: Node.JS 20.12.1

use fn : sendAll()


Sometimes attempts with the same token will fail and sometimes they will succeed.


[ERROR]

[2024-09-12T04:43:08.339Z]  500   ERROR: (Error)Operation is not implemented, or supported, or enabled.
Raw server response:
"{"error":{"code":501,"message":"Operation is not implemented, or supported, or enabled.","status":"UNIMPLEMENTED"}}"

@gokul1630
Copy link

same issue

Platform : Android and IOS Codebase : node.js Firebase-admin sdk version : 12.2.0, Node.js version: Node.JS 20.12.1

use fn : sendAll()

Sometimes attempts with the same token will fail and sometimes they will succeed.

[ERROR]

[2024-09-12T04:43:08.339Z]  500   ERROR: (Error)Operation is not implemented, or supported, or enabled.
Raw server response:
"{"error":{"code":501,"message":"Operation is not implemented, or supported, or enabled.","status":"UNIMPLEMENTED"}}"

try sendEachForMulticast
https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.messaging.md#messagingsendeachformulticast

@byeong1
Copy link

byeong1 commented Sep 12, 2024

same issue
Platform : Android and IOS Codebase : node.js Firebase-admin sdk version : 12.2.0, Node.js version: Node.JS 20.12.1
use fn : sendAll()
Sometimes attempts with the same token will fail and sometimes they will succeed.
[ERROR]

[2024-09-12T04:43:08.339Z]  500   ERROR: (Error)Operation is not implemented, or supported, or enabled.
Raw server response:
"{"error":{"code":501,"message":"Operation is not implemented, or supported, or enabled.","status":"UNIMPLEMENTED"}}"

try sendEachForMulticast https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.messaging.md#messagingsendeachformulticast

nice!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@sawaYch
Copy link

sawaYch commented Sep 12, 2024

same issue
Platform : Android and IOS Codebase : node.js Firebase-admin sdk version : 12.2.0, Node.js version: Node.JS 20.12.1
use fn : sendAll()
Sometimes attempts with the same token will fail and sometimes they will succeed.
[ERROR]

[2024-09-12T04:43:08.339Z]  500   ERROR: (Error)Operation is not implemented, or supported, or enabled.
Raw server response:
"{"error":{"code":501,"message":"Operation is not implemented, or supported, or enabled.","status":"UNIMPLEMENTED"}}"

try sendEachForMulticast https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.messaging.md#messagingsendeachformulticast

Thanks u really save my day 😄 !!
According to the change log, we may upgrade to >=11.7.0
https://firebase.google.com/support/release-notes/admin/node#cloud-messaging_2

@kokitkar1
Copy link

const response = await admin.messaging().sendEachForMulticast(messageSend); // Use sendMulticast
use this function didnt get any response further

@gy0857478
Copy link

const response = await admin.messaging().sendEachForMulticast(messageSend); // Use sendMulticast use this function didnt get any response further

Any Error Response ?

@onzou
Copy link

onzou commented Nov 14, 2024

sendEachForMulticast From the latest version of the lib

Thanks a lot.

@sumitkumardey91
Copy link

Push notifications are not being delivered in the Android Edge browser when using:
await this.app.messaging().sendEachForMulticast(message); Notifications work as expected in all other browsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests