Since around 2020-03-27 6:35 UTC I get the following error on push tickets:
{
“id”: “0425180b-e83c-4c9c-ac9c-51f913192e6d”,
“status”: “error”,
“message”: “Failed to authenticate with the FCM server. Ensure the FCM server key you uploaded is correct.”,
“details”: {
“error”: “InvalidCredentials”,
“fault”: “developer”,
“fcm”: {
“httpStatus”: 401,
“response”: “\n\nPROJECT_NOT_PERMITTED\n\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n
PROJECT_NOT_PERMITTED
\n
Error 401
\n\n\n”
}
}
}
Firebase Server key seemed to be missing, so I updated it again. push:android:show returns it correctly now, but I stille get those errors.
Am I missing anything?
No luck yet. The error persists.
I reached out to Firebase support for this, because it looks like a Firebase error - however the response from Support was: “Firebase doesn’t have that error”. (“PROJECT_NOT_PERMITTED”).
I did not get the error any more after 07:45 UTC this morning, without any change on my end.
So either expo fixed something without mentioning it here, or Firebase resolved the issue (my guess - seemed like a Firebase error). I will monitor it, but all seems well at the moment.
We haven’t made any changes in the past few hours, so I would think this is a Firebase issue if you also haven’t made any changes to your FCM key. @venu7733@nigel is it also working for you?
I took out notifications on my live system. I can still replicate the issue this morning in Dev.
I’m not actually using expo so I can rule that out. At the moment I think it has something to do with trying to notify old device registrations. @charliecruzan
@entrecode@charliecruzan It looks like this was being caused by using an old Server Key. I’m not sure if Firebase rotates them or not. I had tried testing with that key before and was getting a 401 Unauthenticated so I thought that wasn’t the issue. I still don’t know exactly what causes a PROJECT_NOT_PERMITTED but I seem to be able to resolve the issue in my system for now.
Starting from March 2020, FCM stopped creating legacy server keys. Existing legacy server keys will continue to work, but we recommend that you instead use the newer version of key labeled Server key in the [Firebase console]
Ref link: Authorize send requests | Firebase Cloud Messaging
Issue resolved. It’s working with oAuth token migration v1 api.
Migrate legacy server keys
Starting from March 2020, FCM stopped creating legacy server keys. Existing legacy server keys will continue to work, but we recommend that you instead use the newer version of key labeled Server key in the [Firebase console]
Ref link: Authorize send requests | Firebase Cloud Messaging
I got another response from Firebase Support regarding this, and wanted it to share here:
Upon checking on with the team, the issue could be a cause of disabling the googlecloudmessaging.googleapis.com API.
[…]
If you ever encountered this issue again, please feel free to let me know […]