I just started getting an error when trying to deploy a google cloud HTTP function using:
gcloud functions deploy http_function --trigger-http
And now I'm getting an error like this:
ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[The request has errors
Problems:
The updateMask field contains event_trigger but it is not present in CloudFunction resource.
]
The function deployed fine earlier and I've only fiddled with the some code inside, nothing that I believe should give me this error.
My cloud function looks like this:
exports.http_function = (req, res) => {
if (req.method === 'POST') {
// some code and then
res.json(jsonVariable);
} else {
const error = new Error('Only POST requests are accepted');
error.code = 405;
console.error(error);
res.status(error.code || 500).send(error);
throw error;
}
}
If anyone has some insight as to what might cause this error, I'd greatly appreciate it, because I'm struggling to find info on it?
EDIT: It only seems to happen sometimes, so now I definitely believe it's something wrong with gcloud.
The error has been fixed now, see: https://status.cloud.google.com/incident/cloud-functions/18002
"The issue with Google Cloud Functions experiencing errors when updating functions via gcloud has been resolved for all affected users as of Tuesday, 2018-09-11 09:10 US/Pacific. We will conduct an internal investigation of this issue and make appropriate improvements to our systems to help prevent or minimize future recurrence."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With