[messaging] http module : failed to execute source
See original GitHub issue[READ] Step 1: Are you in the right place?
- For issues related to the code in this repository file a Github issue.
- If the issue pertains to Cloud Firestore, read the instructions in the “Firestore issue” template.
- For general technical questions, post a question on StackOverflow with the firebase tag.
- For general Firebase discussion, use the firebase-talk google group.
- For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Operating System version: MongoDB Atlas Trigger (Realm App)
- Firebase SDK version: 11.0.1
- Firebase Product: messaging
- JS SDK Version: 3.18.0
- NPM version: I don’t know
[REQUIRED] Step 3: Describe the problem
Executing admin.messaging().sendMulticast(message)
returns an error but is actually working :
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))
My Atlas Trigger reports error anyway even if the code is successfully executed.
Here is my StackOverflow bounty on the subject but since no one has an obvious answer i have decided to raise an issue here.
Steps to reproduce:
- Create a MongoDB Atlas trigger
- Add
firebase-admin
as external dependency - Add the service-account.json as a
value
- Run the code with the below code
Relevant Code:
exports = async function() {
const admin = require("firebase-admin");
const json_creds = context.values.get("service_account_value_name");
const title = "Test";
const body = "This is a test";
const message= {
android: {
notification: {
title: title,
sound: "default",
body: body,
},
},
apns: {
payload: {
aps: {
alert: {
title: title,
body: body,
},
mutableContent: 1,
contentAvailable: 1
}
},
},
tokens: ["device_token_1", "device_token_2"]
};
admin.initializeApp({
credential: admin.credential.cert(JSON.parse(json_creds))
});
admin.messaging().sendMulticast(message);
console.log("Messages sent !");
}
}
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:19 (3 by maintainers)
Top Results From Across the Web
http module : failed to execute source Node JS Atlas trigger
I have added a dependency to my Atlas trigger ( firebase-admin ). and it was working fine yesterday with the same code as...
Read more >IIS AspNetCore Module V2: Failed to start application '/LM ...
I have a .NET Core 3.1 Web API project that I am hosting using IIS. Project Details (see target framework):. <Project Sdk="Microsoft.NET.
Read more >Error Handlers | MuleSoft Documentation
Because the request produces an HTTP:NOT_FOUND error, the Studio console prints an error message indicating that OnErrorContinueHandler is handling the error.
Read more >HTTP | Node.js v19.3.0 Documentation
If a client connection emits an 'error' event, it will be forwarded here. Listener of this event is responsible for closing/destroying the underlying...
Read more >Troubleshooting Systems Manager Automation
This topic includes specific tasks to resolve issues based on Automation error messages. Topics. Common Automation errors; Automation execution failed to start ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lahirumaramba
If you can provide a PR, I would gladly look in to it.
I will have a look at it latest on monday.