我正在尝试运行firebase deploy
,但得到:
=== Deploying to 'snag-b2b2d'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (49.59 KB) for uploading
✔ functions: functions folder uploaded successfully
i functions: updating Node.js 6 function sendMessageNotification(us-central1)...
⚠ functions: failed to update function sendMessageNotification
HTTP Error: 503, The service is currently unavailable.
Functions deploy had errors. To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
Having trouble? Try firebase deploy --help
仅供参考,这是在我的一个服务帐户被盗用之后发生的,因为我不小心将一个带有我的凭证的服务帐户json
文件上传到了github。帐户被暂停后,我按照here中所述的程序进行操作,并成功恢复了该帐户。在我删除并创建了所有必要的凭据(API密钥/服务帐户/哇客户端ID)之后,才开始出现此问题。
我先尝试firebase logout
,然后尝试firebase login
,但部署失败。我也尝试过npm install -g firebase-tools@latest
和firebase use --add <myproject>
(我不确定该怎么做)。我什至重新运行了firebase-tools
安装,但这仍然无济于事。
我也尝试过从firebase
编辑google cloud console
函数,但是它不让我保存,它给了我一个undefined
错误,以及该问题的跟踪号,我提供了反馈,但什么都没听到。
任何想法都将不胜感激。
更新
这是我的凭据页面,我不确定所有配置是否正确,希望可以从中获取一些信息,因为我认为也许项目受到了损害并且必须更新密钥与{ {1}}问题:
更新
我也尝试过重置firebase deploy
凭据,但没有运气:
gcloud
更新
我运行了./gcloud auth application-default login
,这是更多输出:
i函数:更新Node.js 6函数 sendMessageNotification(us-central1)... [2018-09-20T22:28:14.587Z] 触发是: {“ eventTrigger”:{“资源”:“项目/ snag-b2b2d /数据库/(默认)/ documents / messages / {messageId}”,“ eventType”:“ providers / cloud.firestore / eventTypes / document.write”, “ service”:“ firestore.googleapis.com”}} [2018-09-20T22:28:14.588Z] >>> HTTP请求补丁 https://cloudfunctions.googleapis.com/v1/projects/snag-b2b2d/locations/us-central1/functions/sendMessageNotification 查询参数: {“ updateMask”:“ sourceUploadUrl,名称,标签,eventTrigger.resource,eventTrigger.eventType,eventTrigger.service”} sourceUploadUrl = https://storage.googleapis.com/gcf-upload-us-central1-42327ef0-9b18-406c-9b7e-7b716bb814f8/d84bdea4-ba16-4260-93c8-c46c2d4066f0.zip?GoogleAccessId=service-599782590095@gcf-admin-robot.iam.gserviceaccount.com&Expires=1537484293&Signature=WRnMwsiVxLWWPWgf6MEgB6ggvAu3Zbl1bpYtqOCr4p7Ry3JcvN%2B3Xa44WjNT2XD4sC%2FfQKcTC0UJCbX8t8F7YPnR2EO1nKM%2BPJTZyJBxYOMvJTFXiqaEe97FWTBU8BifcPGmyp%2FRMttlBIvC7CWoi8swBceMKKF3zjFbfvoy7jCBkAqvJHlvLeBb6GEb4Gg6CFMYA3eL9ue4TFksLvk1lUYUJrHX2Pv5P2ezRj8%2BYoUFoHrY7xammMy0USgPi23CzPWGGdL%2BMu2Iy2%2BZA4ZE8q0KRCLXXVTr8TQK0Qx2G9IM3mWogL5ViNwxDdX6Xl7iiAHwsyBdvQRn%2FfO6AEm7nQ%3D%3D, 名称= projects / snag-b2b2d / locations / us-central1 / functions / sendMessageNotification, Deployment-tool = cli-firebase, resource = projects / snag-b2b2d / databases /(默认)/ documents / messages / {messageId}, eventType = providers / cloud.firestore / eventTypes / document.write, service = firestore.googleapis.com [2018-09-20T22:28:15.055Z] <<< HTTP 响应503变化= X来源,引荐来源网址,来源,接受编码, content-type =应用程序/ json; charset = UTF-8,date = Thu,2018年9月20日 22:28:15 GMT,服务器= ESF,缓存控制=专用,x-xss-protection = 1; 模式=块,x帧选项= SAMEORIGIN, x-content-type-options = nosniff,alt-svc = quic =“:443”; ma = 2592000; v =“ 44,43,39,35”,accept-ranges =无,连接=关闭 [2018-09-20T22:28:15.056Z] <<< HTTP RESPONSE BODY代码= 503, message =该服务当前不可用。status = UNAVAILABLE⚠ 函数:无法更新函数sendMessageNotification HTTP 错误:503,该服务当前不可用
有趣的是,如果您单击https://cloudfunctions.googleapis.com/v1/projects/snag-b2b2d/locations/us-central1/functions/sendMessageNotification(在输出中),它将带您进入:
firebase deploy --only functions --debug
它说我缺少身份验证凭据...
更新
当我在上面的输出中单击{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
时,它说:
url
更新
来自Google的<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.
</Message>
<StringToSign>
GET 1537484293 /gcf-upload-us-central1-42327ef0-9b18-406c-9b7e-7b716bb814f8/d84bdea4-ba16-4260-93c8-c46c2d4066f0.zip
</StringToSign>
</Error>
:
OAuth 2.0 Playground
简而言之:
GET /gcf-upload-us-central1-42327ef0-9b18-406c-9b7e-7b716bb814f8/d84bdea4-ba16-4260-93c8-c46c2d4066f0.zip?GoogleAccessId=service-599782590095@gcf-admin-robot.iam.gserviceaccount.com&Expires=1537484293&Signature=WRnMwsiVxLWWPWgf6MEgB6ggvAu3Zbl1bpYtqOCr4p7Ry3JcvN%2B3Xa44WjNT2XD4sC%2FfQKcTC0UJCbX8t8F7YPnR2EO1nKM%2BPJTZyJBxYOMvJTFXiqaEe97FWTBU8BifcPGmyp%2FRMttlBIvC7CWoi8swBceMKKF3zjFbfvoy7jCBkAqvJHlvLeBb6GEb4Gg6CFMYA3eL9ue4TFksLvk1lUYUJrHX2Pv5P2ezRj8%2BYoUFoHrY7xammMy0USgPi23CzPWGGdL%2BMu2Iy2%2BZA4ZE8q0KRCLXXVTr8TQK0Qx2G9IM3mWogL5ViNwxDdX6Xl7iiAHwsyBdvQRn%2FfO6AEm7nQ%3D%3D HTTP/1.1
Host: storage.googleapis.com
Content-length: 0
Authorization: Bearer ya29.GlseBoHbz-SSMNdBt4CZzIoS0-4TxssVDxxa5Ib3U5FQhww8N8c3wk6Xy-uImyg9RVB8ogP_e-_M5kZ0lG-OfkLZmlofnJ4eCou1gRERhyv_Kijj2n3S4Ibxg48O
HTTP/1.1 403 Forbidden
Content-length: 298
Expires: Thu, 20 Sep 2018 23:01:16 GMT
X-guploader-uploadid: AEnB2UocixHqTdwq-e3DKumvoepRCJ4VbWSRgF5bYp20OV4ciz_9ImfsAT6CGoWEq78oOThUpfNtrPfRJYgmy5tn_uIG3cCqBw
Cache-control: private, max-age=0
Date: Thu, 20 Sep 2018 23:01:16 GMT
Content-type: application/xml; charset=UTF-8
<?xml version='1.0' encoding='UTF-8'?><Error><Code>AccessDenied</Code><Message>Access denied.</Message><Details>eamon.white7@gmail.com does not have storage.objects.get access to gcf-upload-us-central1-42327ef0-9b18-406c-9b7e-7b716bb814f8/d84bdea4-ba16-4260-93c8-c46c2d4066f0.zip.</Details></Error>
答案 0 :(得分:0)
问题可能是您在本S.O.中删除了"Google App Engine's 'default service account'"作为详细信息。帖子。
不幸的是,发生这种情况时,您可能必须销毁google cloud项目并重新制作它。有关更多信息,请参见链接的帖子。