I have…
- [X] Checked the logs and have provided the logs if I found something suspicious there
I’m submitting a…
- [ ] Regression (a behavior that stopped working in a new release)
- [X] Bug report
- [ ] Performance issue
- [ ] Documentation issue or request
Current behavior
We have a google cloud function deployed as HTTP endpoint. The squidex webhook should send the data to the HTTP endpoint and success.
Currently I can see the data has been post to Google Function and processed. However the webhook function still returned an error and will resend it again.
- this is the log from the webhook,
System.Threading.Tasks.TaskCanceledException: The operation was canceled.
—> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.
—> System.Net.Sockets.SocketException (125): Operation canceled
— End of inner exception stack trace —
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.Security.SslStream.g__InternalFillBufferAsync|215_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial)
- this is the javascript code we deployed as cloud function.
exports.publishToQueue = async (req, res) => {
const pubsub = new PubSub();
const topic = pubsub.topic(process.env.TOPIC);
const callback = (err, messageId) => {
if (err) {
res.status(400).send();
console.error(err);
} else {
console.info(`${logPrefix} ${messageId} created`);
res.status(200).send('Result: OK');
}
};
topic.publishJSON(req.body, callback);
};
It seems this not work with nodejs for callback or async.
if I moved the res.send() after the topic.publishJSON(), then it worked. but I need to know if the operation worked or not to let Squidex know and resend it if it is not working
Expected behavior
Minimal reproduction of the problem
Create a node js async function and deploy as a service for squidex webhook to call.
I wonder if this can be the same issue for AWS lambda, we are using GCP cloud function.
Environment
- [ ] Self hosted with docker
- [ ] Cloud version
Others: