Could not save Firebase (FCM) server key


#1

We currently implementing and setup everything for the push notifications. Unfortunately I stuck at the step where we have to add the FCM server key to our server. When we insert the key and click save the following error occurs: "Couldn't update plugin: Cannot read property 'indexOf' of undefined". I follow step by step the documentation so this should be fine.

Just to be sure. Here a screenshot of the input field:

Does someone has the same problem or can give me an advice how to proceed here?

Thank you


#2

I think we had this issue fixed in 18.08.1. In that case, please update your server.


#3

I seems like the bug still exists in 18.08.01 cause I used the newest version for our countly setup and also the version note in the left corner prooves this:
32

I can't setup the notifications for android when the FCM is not working. I'm a bit helpless here. What can I do?


#4

Let's check your logs then. It's in countly/log/countly-api.log or in Server Logs plugin if you have it enabled.


#5

This is what the log captured:

TypeError: Cannot read property 'indexOf' of undefined
at Promise (/var/www/html/countly/plugins/push/api/parts/endpoints.js:971:38)
at new Promise ()
at api.appPluginsUpdate (/var/www/html/countly/plugins/push/api/parts/endpoints.js:962:16)
at pluginManager.dispatch (/var/www/html/countly/plugins/pluginManager.js:245:48)
at promises.push.Promise (/var/www/html/countly/api/parts/mgmt/apps.js:239:33)
at new Promise ()
at Object.keys.forEach.k (/var/www/html/countly/api/parts/mgmt/apps.js:238:35)
at Array.forEach ()
at common.db.collection.findOne (/var/www/html/countly/api/parts/mgmt/apps.js:236:46)
at /var/www/html/countly/plugins/pluginManager.js:970:29
at result (/var/www/html/countly/node_modules/mongodb/lib/utils.js:414:17)
at session.endSession (/var/www/html/countly/node_modules/mongodb/lib/utils.js:401:11)
at ClientSession.endSession (/var/www/html/countly/node_modules/mongodb-core/lib/sessions.js:114:41)
at executeCallback (/var/www/html/countly/node_modules/mongodb/lib/utils.js:397:17)
at handleCallback (/var/www/html/countly/node_modules/mongodb/lib/utils.js:128:55)
at cursor.next (/var/www/html/countly/node_modules/mongodb/lib/operations/collection_ops.js:544:5)
2018-11-06T12:18:00.135Z: ERROR [mgmt:apps] Error during plugin config updates for app XXXX: {} object, NaN

Maybe a missing package on ubuntu?


#6

Ok, this must be something new. Could you give me access to your dashboard? You can send it to asa at count.ly or to our Slack channel: countly-community.slack.com. Last one preferable since it'd speed up things.

In case you can't, please attach full request payload & db.countly.apps.findOne(ObjectId("APP_ID")) mongo query result.


#7

Ok, no need I guess. Apparently, we have the same issue on another server.


#8

Ok so how should I proceed here? Should I wait for an answer from your side or can you give me any advice?

Thank you in advance


#9

Hi Stephan, please wait for a fix from @artem - Possibly tomorrow :slight_smile:


#10

Hi Stephan,

Here are 2 patches you can apply in case you need it ASAP. Or you can wait for our next small release (should be out this month).

https://www.dropbox.com/s/cdyog2y4wvkz86y/0001-push-Fix-for-upload-of-APN-credentials-from-windows-.patch?dl=0
https://www.dropbox.com/s/964ir8t2cowgg1q/0002-push-Deny-APN-app-settings-update-if-no-file-is-sele.patch?dl=0


#11

Hi artem,

I applied your patches accordingly but got unfortunatley the same error. Do I have to flush a cache maybe to make this work? I also double checked the code files on our server and compared them with your patches.


#12

Hi Stephan,

Sorry forgot to mention. After applying patches you'll need to run sudo grunt dist-all in countly folder, restart the server and clear browser caches.


#13

Great! Now it works. Thank you