firebase / firebase-admin-java

Firebase Admin Java SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
535 stars 261 forks source link

java.lang.IllegalArgumentException: No enum constant com.google.firebase.ErrorCode.UNIMPLEMENTED #974

Closed cgdsyilmaz closed 1 week ago

cgdsyilmaz commented 1 month ago

Hello,

We are receiving IllegalArgumentException while calling com.google.firebase.messaging.FirebaseMessaging#sendMulticast(com.google.firebase.messaging.MulticastMessage) method since 2024-08-12 13:44 GMT. We are using 9.1.1 version of firebase-admin dependency.

Here is the exception detail:

java.lang.IllegalArgumentException: No enum constant com.google.firebase.ErrorCode.UNIMPLEMENTED
    at java.lang.Enum.valueOf(Unknown Source)
    at c.g.f.m.FirebaseMessagingClientImpl$MessagingBatchCallback.createFirebaseException(FirebaseMessagingClientImpl.java:271)
    at c.g.f.m.FirebaseMessagingClientImpl$MessagingBatchCallback.onFailure(FirebaseMessagingClientImpl.java:258)
    at c.g.f.m.FirebaseMessagingClientImpl$MessagingBatchCallback.onFailure(FirebaseMessagingClientImpl.java:243)
    at c.g.a.c.googleapis.batch.BatchUnparsedResponse.parseAndCallback(BatchUnparsedResponse.java:209)
    at c.g.a.c.googleapis.batch.BatchUnparsedResponse.parseNextResponse(BatchUnparsedResponse.java:149)
    at c.google.api.client.googleapis.batch.BatchRequest.execute(BatchRequest.java:269)
    at c.g.firebase.messaging.FirebaseMessagingClientImpl.sendBatchRequest(FirebaseMessagingClientImpl.java:138)
    at c.g.firebase.messaging.FirebaseMessagingClientImpl.sendAll(FirebaseMessagingClientImpl.java:118)
    at com.google.firebase.messaging.FirebaseMessaging$2.execute(FirebaseMessaging.java:295)
    at com.google.firebase.messaging.FirebaseMessaging$2.execute(FirebaseMessaging.java:292)
    at com.google.firebase.internal.CallableOperation.call(CallableOperation.java:36)
    at com.google.firebase.messaging.FirebaseMessaging.sendAll(FirebaseMessaging.java:183)
    at com.google.firebase.messaging.FirebaseMessaging.sendMulticast(FirebaseMessaging.java:254)
    at com.google.firebase.messaging.FirebaseMessaging.sendMulticast(FirebaseMessaging.java:227)....

Is there a chance that a deprecated resource was deleted today? In any case, we are switching to the sendEachForMulticast method as suggested.

google-oss-bot commented 1 month ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

GideonCallbus commented 1 month ago

same thing happening here as well. does anybody want to share any workaround?

tested upto 9.3.0 and still have no idea why the MessagingServiceErrorResponse's holding seemingly unintended status 'UNIMPLEMENTED'.

emindeniz99 commented 1 month ago

sendMulticast is unsupported since 22 july 2024 gradually they remove support from users. you can check the issue https://github.com/firebase/firebase-admin-java/issues/834#issuecomment-2186408729

GideonCallbus commented 1 month ago

sendMulticast is unsupported since 22 july 2024 gradually they remove support from users. you can check the issue #834 (comment)

Yes indeed! Thanks for clearly pointing that out 👍 ..yet still com.google.firebase.ErrorCode.UNIMPLEMENTED shall be added I think.

cshancj commented 1 month ago

FYI @GideonCallbus

FCM will start a gradual shutdown of deprecated APIs around July 22nd, 2024. After this date, deprecated services will be subject to a "flickering" process in which increasing numbers of requests will return error responses. During the gradual ramp-down period you can expect the following behavior and error responses to increase in frequency over time:

cgdsyilmaz commented 1 month ago

sendMulticast is unsupported since 22 july 2024 gradually they remove support from users.

you can check the issue https://github.com/firebase/firebase-admin-java/issues/834#issuecomment-2186408729

Thank you for pointing this out. However a smoother transition from the deprecated resource to the new one could have been planned.

Changing to the new sendEachForMulticast api fixed this, if anyone is still looking for a solution.

hezhijie commented 3 weeks ago

mark

lahirumaramba commented 1 week ago

I am closing this issue as switching to sendEachForMulticast() is the right approach here