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

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

Open
gilyeon00 opened this issue Aug 13, 2024 · 8 comments
Assignees

Comments

@gilyeon00
Copy link

Hello I'm a user using firebase admin 8.1.0.
When I was scheduling push notifications to Jenkins, I saw the following error log

java.lang.IllegalArgumentException: No enum constant com.google.firebase.ErrorCode.UNIMPLEMENTED
	at java.base/java.lang.Enum.valueOf(Enum.java:240)
	at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingBatchCallback.createFirebaseException(FirebaseMessagingClientImpl.java:271)
	at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingBatchCallback.onFailure(FirebaseMessagingClientImpl.java:258)
	at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingBatchCallback.onFailure(FirebaseMessagingClientImpl.java:243)
	at com.google.api.client.googleapis.batch.BatchUnparsedResponse.parseAndCallback(BatchUnparsedResponse.java:209)
	at com.google.api.client.googleapis.batch.BatchUnparsedResponse.parseNextResponse(BatchUnparsedResponse.java:149)
	at com.google.api.client.googleapis.batch.BatchRequest.execute(BatchRequest.java:268)
	at com.google.firebase.messaging.FirebaseMessagingClientImpl.sendBatchRequest(FirebaseMessagingClientImpl.java:138)
	at com.google.firebase.messaging.FirebaseMessagingClientImpl.sendAll(FirebaseMessagingClientImpl.java:118)
	at com.google.firebase.messaging.FirebaseMessaging$2.execute(FirebaseMessaging.java:295)

Previously, I used the sendAll() method, and for some reason, I don't get this error every time.
When I looked at ErrorCode.class, there was no UNIMPLEMENTED enum
I updated it to 9.2.0 because I thought it might be a version problem.

However, it is written in the 'firebase exception code document' (https://firebase.google.com/docs/reference/kotlin/com/google/firebase/firestore/FirebaseFirestoreException.Code) , but there is no UNIMPLEMENTED enum in both 9.2.0 and 9.3.0 versions

In the end, I heard that sendAll() is not supported in version 9.2.0, so I'm going to use sendEach(), but I think it should still be added to enum.
I think it's a critical error in earlier versions of 8.x.x and earlier

I'd appreciate it if you could reflect it for users who might be embarrassed like me. Thank you😀

gilyeon00 added a commit to gilyeon00/firebase-admin-java that referenced this issue Aug 13, 2024
@cgdsyilmaz
Copy link

Same issue as: #974

@lahirumaramba
Copy link
Member

sendAll() is deprecated (replaced with sendEach() and will be removed in the upcoming major version. This is why I wasn't sure if it is worth adding this Error code now... we can certainly consider it if folks find this useful though.

CC: @jonathanedey

@dsoni768
Copy link

dsoni768 commented Sep 5, 2024

sendEach method not found

@koti-muppavarapu
Copy link

I am facing exact same error now using firebase-admin version 8.2.0.

This worked 100% when I tested last month between 10th August till 16th August. Now suddenly it's not working with error below.

java.lang.IllegalArgumentException: No enum constant com.google.firebase.ErrorCode.UNIMPLEMENTED at java.lang.Enum.valueOf(Enum.java:238) at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingBatchCallback.createFirebaseException(FirebaseMessagingClientImpl.java:271) at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingBatchCallback.onFailure(FirebaseMessagingClientImpl.java:258) at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingBatchCallback.onFailure(FirebaseMessagingClientImpl.java:243) at com.google.api.client.googleapis.batch.BatchUnparsedResponse.parseAndCallback(BatchUnparsedResponse.java:209) at com.google.api.client.googleapis.batch.BatchUnparsedResponse.parseNextResponse(BatchUnparsedResponse.java:149) at com.google.api.client.googleapis.batch.BatchRequest.execute(BatchRequest.java:269) at com.google.firebase.messaging.FirebaseMessagingClientImpl.sendBatchRequest(FirebaseMessagingClientImpl.java:138) at com.google.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.sendAll(FirebaseMessaging.java:158) at

Below is the my gradle dependency.

implementation 'com.google.firebase:firebase-admin:8.2.0'

Any help with this is greatly appreciated.

@gilyeon00
Copy link
Author

@dsoni768

sendEach 메서드를 찾을 수 없습니다

sendEach() is available in version 9.2.0

@gilyeon00
Copy link
Author

gilyeon00 commented Sep 11, 2024

@koti-muppavarapu

지금 firebase-admin 버전 8.2.0을 사용하면서 똑같은 오류가 발생했습니다.

I got into the same problem, so I had no choice but to update it to version 9.2.0 and I had no choice but to write sendEach()
I want firebase team to do something for people who are suffering from this problem

@koti-muppavarapu
Copy link

@gilyeon00 ,

Really appreciate your feedback on this. I have initially tried using version 9.2.0, but that broke my spring application's startup causing conflicts with logback logging libraries.

Now I have tried using version 9.3.0, with this version at least my application starts fine and sendEach is working fine but the application logging is not working.

The tried version 9.0.0, with this version the application starts fine, logging working fine but sendAll is not working with same error as mentioned above on this thread.

@koti-muppavarapu
Copy link

@gilyeon00,

I have addressed the logging issue by exlcuding slf4j-api from the firebase admin dependency. Now using version 9.3.0 and sendEach method the messaging is working fine.

implementation ("com.google.firebase:firebase-admin:$firebaseAdminVersion") {
    	exclude group: 'org.slf4j', module: 'slf4j-api'
}

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

5 participants