部署Google Cloud Functions ResponseError:updateMask字段包含event_trigger,但它不存在于CloudFunction资源中

Mar*_*man 6 node.js google-cloud-platform gcloud google-cloud-functions

我刚刚尝试使用以下方式部署Google云端HTTP功能时遇到错误:

gcloud functions deploy http_function --trigger-http
Run Code Online (Sandbox Code Playgroud)

现在我收到这样的错误:

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.
]
Run Code Online (Sandbox Code Playgroud)

该函数早先部署得很好,我只是弄乱了里面的一些代码,我认为没有什么能给我这个错误.

我的云功能如下所示:

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;
    }
}
Run Code Online (Sandbox Code Playgroud)

如果任何人有一些见解,以什么可能会导致这样的错误,我会非常感激,因为我挣扎找到它的信息?

编辑:它似乎有时只发生,所以现在我绝对相信gcloud有问题.

小智 1

该错误现已修复,请参阅: https ://status.cloud.google.com/incident/cloud-functions/18002

“截至 2018 年 9 月 11 日星期二 09:10 美国/太平洋地区,Google Cloud Functions 在通过 gcloud 更新函数时遇到错误的问题已为所有受影响的用户解决。我们将对此问题进行内部调查并做出适当的改进我们的系统有助于防止或最大程度地减少未来的复发。”