I have added a dependency to my Atlas trigger (firebase-admin)
and it was working fine yesterday with the same code as today. Suddenly i came across this error :
FunctionError: 'http' module: FunctionError: failed to execute source for 'node_modules/@fastify/busboy/lib/main.js': FunctionError: failed to execute source for 'node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js': FunctionError: failed to execute source for 'node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js': FunctionError: failed to execute source for 'node_modules/@fastify/busboy/lib/utils.js': TypeError: Value is not an object: undefined
at node_modules/@fastify/busboy/lib/utils.js:23:27(322)
at require (native)
at node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js:15:24(29)
at require (native)
at node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:19:28(39)
at require (native)
at node_modules/@fastify/busboy/lib/main.js:28:21(44)
at execute (native)
at <eval>:16:29(8)
at K (<eval>:10:6625(35))
at <eval>:10:4454(115)
at M (<eval>:10:9199(23))
at T (<eval>:10:9026(174))
at <eval>:10:9810(49)
at onStreamRead (<eval>:10:2062(36))
And i have no idea what this is about.
I am initializing the firebase SDK this way :
const admin = require("firebase-admin");
const json_creds = context.values.get("sdk_key");
admin.initializeApp({
credential: admin.credential.cert(JSON.parse(json_creds))
});
...
admin.messaging().sendMulticast(message);
EDIT : The error actually comes from : admin.messaging().sendMulticast(message);
EDIT 2 : The message is :
const message = {
android: {
notification: {
title: title,
sound: "default",
body: content,
},
},
apns: {
payload: {
aps: {
alert: {
title: title,
body: content,
},
mutableContent: 1,
contentAvailable: 1
}
},
},
tokens: ["token1", "token2"]
};
This same behavior is working very fine in python (i have been using it for months already) but in Node JS it seems that there are some http issues to send the message.
I have also checked the timeouts of an Atlas trigger (90 seconds) it's not the issue because i have the error when i run the trigger manually as well.