firebase functions - `firebase deploy` -服务当前不可用

b1payxdu  于 2023-11-21  发布在  其他
关注(0)|答案(2)|浏览(146)

我尝试运行firebase deploy,但得到:

=== Deploying to ...

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密钥/服务帐户/ouath客户端ID)。
我尝试了firebase logout,然后是firebase login,但没有成功部署。我也尝试了npm install -g firebase-tools@latestfirebase use --add <myproject>(我不知道这是什么)。我甚至重新运行了firebase-tools安装,但仍然没有帮助。
我也试过从google cloud console编辑firebase函数,但它不让我保存,它给了我一个undefined错误,和一个跟踪号码的问题,我提供了反馈,但没有听到任何消息。
任何想法将不胜感激。

    • 更新**

这是我的凭证页面,我不确定是否一切都配置正确,希望可以从中获得一些信息,因为我认为可能项目受到损害并必须更新密钥与firebase deploy问题有关:

    • 更新**

我也试过重置gcloud凭据,但没有成功:
./gcloud auth application-default login

    • 更新**

我运行了firebase deploy --only functions --debug,这里有更多的输出:
i职能:更新Node.js 6函数sendMessageNotification(us-central1)...[2018 - 09 - 20T22:28:14.587Z]触发器为:{"eventTrigger ":{" resource":"项目/PROJECT_ID/数据库/(默认)/documents/messages/{messageId}"," eventType ":" providers/cloud. firestore/eventTypes/document. write "," service ":" www.example.com "}}[2018 - 09 - 20T22:28:14.588Z]> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/functions/sendMessageNotification query params:{"updateMask":"sourceTrigger adUrl,name,labels,eventTrigger. resource,eventTrigger. eventType,eventTrigger. service "} sourceTrigger adUrl = https://www.example.com name = projects/firestore.googleapis.com15 GMT,server = ESF,cache-control = private,x-xss-protection = 1; mode = block,x-frame-options = SAMEORIGIN,x-content-type-options = nosniff,alt-svc = quic =":443"; ma = 2592000; v ="44,43,39,35",accept-ranges = none,connection = close [2018 - 09 - 20T22:28:storage.googleapis.com/
有趣的是,如果你点击https://cloudfunctions.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/functions/FUNCTION(从输出),它会给你带来这样的结果:

{
  "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时,它说:

<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 /Function-upload-us-central1/FILE.zip
</StringToSign>
</Error>

    • 更新**

Google的OAuth 2.0 Playground

GET /FUNCTION-central1-FILE.zip?GoogleAccessId=Service_Account@gcf-admin-robot.iam.gserviceaccount.com&Expires= HTTP/1.1
Host: storage.googleapis.com
Content-length: 0
Authorization: Bearer 
HTTP/1.1 403 Forbidden
Content-length: 298
Expires: Thu, 20 Sep 2018 23:01:16 GMT
X-guploader-uploadid: 
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>[email protected] does not have storage.objects.get access to Function-us-central1-FILE.zip.</Details></Error>


简而言之,它说:
email protected(https://stackoverflow.com/cdn-cgi/l/email-protection)没有存储。对象。访问www.example.com

ht4b089n

ht4b089n1#

问题可能是你删除了"Google App Engine's 'default service account'"作为这个S.O.帖子的细节。
不幸的是,当这种情况发生时,你可能不得不破坏google cloud项目并重新创建它。

vsaztqbk

vsaztqbk2#

我遇到了类似的问题,但代码已经部署,在部署的站点上我可以看到This page is temporarily unavailable.
这是由于包含"site": "abcd"在我的firbease.json(在hosting下)。删除它使网站再次工作。

相关问题