Android

com.google.firebase.messaging.FirebaseMessagingException: Requested entity was not found.

오류 : 요청 된 엔티티를 찾을 수 없습니다.

ERROR: Requested entity was not found.
com.google.firebase.messaging.FirebaseMessagingException: Requested entity was not found.
at com.google.firebase.messaging.FirebaseMessagingClientImpl.newException(FirebaseMessagingClientImpl.java:306)
at com.google.firebase.messaging.FirebaseMessagingClientImpl.createExceptionFromResponse(FirebaseMessagingClientImpl.java:211)
at com.google.firebase.messaging.FirebaseMessagingClientImpl.send(FirebaseMessagingClientImpl.java:127)
at com.google.firebase.messaging.FirebaseMessaging$1.execute(FirebaseMessaging.java:139)
at com.google.firebase.messaging.FirebaseMessaging$1.execute(FirebaseMessaging.java:136)
at com.google.firebase.internal.CallableOperation.call(CallableOperation.java:36)
at com.google.firebase.messaging.FirebaseMessaging.send(FirebaseMessaging.java:106)
at com.google.firebase.messaging.FirebaseMessaging.send(FirebaseMessaging.java:90)
at wellness.schedule.service.SendPushService.sendToToken(SendPushService.java:180)
at wellness.schedule.service.SendPushService.executeSchedule(SendPushService.java:119)
at wellness.schedule.job.SendPushJob.executeInternal(SendPushJob.java:38)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: com.google.api.client.http.HttpResponseException: 404 Not Found
{
“error”: {
“code”: 404,
“message”: “Requested entity was not found.”,
“status”: “NOT_FOUND”,
“details”: [
{
“@type”: “type.googleapis.com/google.firebase.fcm.v1.FcmError”,
“errorCode”: “UNREGISTERED”
}
]
}
}

at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1072)
at com.google.firebase.messaging.FirebaseMessagingClientImpl.sendSingleRequest(FirebaseMessagingClientImpl.java:153)
at com.google.firebase.messaging.FirebaseMessagingClientImpl.send(FirebaseMessagingClientImpl.java:125)
… 11 more

자세한 오류 내용은 details를 참고 하면 된다. GCM에서 FCM로 변환하는 과정에서 여러명을 대상으로 FCM보냈다.
오류가 발생한 원인은 기존에 GCM 에서 사용하던 regisiterID로 보냈기때문이다.
만약 마이그레이션 과정이라면, fcm regisiterID가 아닌경우는 제외시켜야한다.

Error responses
Calls to the Instance ID server API return the following HTTP error codes:

HTTP status 400 (Bad request) – request parameters are missing or invalid. Check error messages for detailed information.
HTTP status 401 (Unauthorized) – authorization header is invalid.
HTTP status 403 (Forbidden) – authorization header doesn’t match the authorizedEntity.
HTTP status 404 (Not found) – Invalid HTTP path or IID token not found. Check error messages for detailed information.
HTTP status 503 (Service unavailable) – service is unavailable. Retry the request with exponential backoff.

 

Leave a Reply

error: Content is protected !!