ewi*_*ard 5 command-line undefined firebase google-cloud-platform google-cloud-functions
我正在尝试跑步firebase deploy但我得到:
=== Deploying to ...\n\ni deploying functions\ni functions: ensuring necessary APIs are enabled...\n\xe2\x9c\x94 functions: all necessary APIs are enabled\ni functions: preparing functions directory for uploading...\ni functions: packaged functions (49.59 KB) for uploading\n\xe2\x9c\x94 functions: functions folder uploaded successfully\ni functions: updating Node.js 6 function sendMessageNotification(us-central1)...\n\xe2\x9a\xa0 functions: failed to update function sendMessageNotification\nHTTP Error: 503, The service is currently unavailable.\n\n\nFunctions deploy had errors. To continue deploying other features (such as database), run:\n firebase deploy --except functions\n\nError: Functions did not deploy properly.\n\nHaving trouble? Try firebase deploy --help\nRun Code Online (Sandbox Code Playgroud)\n仅供参考,这是在我的一个服务帐户被盗之后发生的,因为我不小心将json包含我的凭据的服务帐户文件上传到 github。我完成了此处描述的程序我的帐户被暂停后,在我删除并创建所有必要的凭据(API 密钥/服务帐户/ouath 客户端 ID)后,此问题才开始发生。
我firebase logout当时就尝试过firebase login,但部署不成功。我也尝试过npm install -g firebase-tools@latest(firebase use --add <myproject>我不确定那应该做什么)。我什至重新firebase-tools运行安装,但这仍然没有帮助。
我也尝试过编辑该firebase函数,google cloud console但它不允许我保存,它给了我一个undefined错误,以及该问题的跟踪号码,我提供了反馈,但没有听到任何消息。
任何想法将不胜感激。
\n更新
\n这是我的凭据页面,我不确定所有内容是否配置正确,希望可以从中获得一些信息,因为我认为项目可能受到损害并且必须更新密钥与该问题有关firebase deploy:
更新
\n我也尝试过重置gcloud凭据,但没有成功:
./gcloud auth application-default login
更新
\n我跑了firebase deploy --only functions --debug,这里有更多输出:
\n\ni 函数:更新 Node.js 6 函数\nsendMessageNotification(us-central1)... [2018-09-20T22:28:14.587Z]\n触发器是:\n{"eventTrigger":{"resource":"projects/ PROJECT_ID/databases/(默认)/documents/messages/{messageId}","eventType":"providers/cloud.firestore/eventTypes/document.write","service":"firestore.googleapis.com"}}\n [2018-09-20T22:28:14.588Z] >>> HTTP 请求补丁\n https://cloudfunctions.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/functions/sendMessageNotification \n查询参数:\ n{"updateMask":"sourceUploadUrl,名称,标签,eventTrigger.resource,eventTrigger.eventType,eventTrigger.service"}\nsourceUploadUrl=https://storage.googleapis.com/\nname=projects/PROJECT_ID/locations/us- central1/functions/Function,\ndeployment-tool=cli-firebase,\nresource=projects/PROJECT_ID/databases/(默认)/documents/messages/{messageId},\neventType=providers/cloud.firestore/eventTypes/document.write ,\nservice=firestore.googleapis.com [2018-09-20T22:28:15.055Z] <<< HTTP\n响应 503 变化=X-Origin、Referer、Origin、Accept-Encoding、\ncontent-type=application/json ; 字符集=UTF-8,日期=星期四,2018 年 9 月 20 日\n22:28:15 GMT,服务器=ESF,缓存控制=私有,x-xss-protection=1;\n模式=块,x-frame-options= SAMEORIGIN,\nx-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000;\nv="44,43,39,35",accept-ranges=none,连接=close\n[2018-09-20T22:28:15.056Z] <<< HTTP 响应正文代码=503, \nmessage=该服务当前不可用。, status=UNAVAILABLE \xe2\x9a\xa0\n功能:无法更新功能 sendMessageNotification HTTP\n错误:503,该服务当前不可用
\n
有趣的是,如果您单击https://cloudfunctions.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/functions/FUNCTION(从输出中),它会带您看到以下内容:
\n{\n "error": {\n "code": 401,\n "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.",\n "status": "UNAUTHENTICATED"\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n它说我缺少身份验证凭据...
\n更新
\n当我单击url上面输出中的 时,它显示:
<Error>\n<Code>SignatureDoesNotMatch</Code>\n<Message>\nThe request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.\n</Message>\n<StringToSign>\nGET 1537484293 /Function-upload-us-central1/FILE.zip\n</StringToSign>\n</Error>\nRun Code Online (Sandbox Code Playgroud)\n更新
\n来自谷歌的OAuth 2.0 Playground:
GET /FUNCTION-central1-FILE.zip?GoogleAccessId=Service_Account@gcf-admin-robot.iam.gserviceaccount.com&Expires= HTTP/1.1\nHost: storage.googleapis.com\nContent-length: 0\nAuthorization: Bearer \nHTTP/1.1 403 Forbidden\nContent-length: 298\nExpires: Thu, 20 Sep 2018 23:01:16 GMT\nX-guploader-uploadid: \nCache-control: private, max-age=0\nDate: Thu, 20 Sep 2018 23:01:16 GMT\nContent-type: application/xml; charset=UTF-8\n<?xml version=\'1.0\' encoding=\'UTF-8\'?><Error><Code>AccessDenied</Code><Message>Access denied.</Message><Details>user@gmail.com does not have storage.objects.get access to Function-us-central1-FILE.zip.</Details></Error>\nRun Code Online (Sandbox Code Playgroud)\n简而言之,它说:
\nuser@gmail.com 没有 storage.objects.get 访问 gFunction-us-central1-FILE.zip 的权限
\n问题可能是您删除了“Google App Engine 的‘默认服务帐户’”作为此 SO 帖子中的详细信息。
不幸的是,当这种情况发生时,你可能不得不销毁谷歌云项目并重新制作它。请参阅链接的帖子了解更多信息。
| 归档时间: |
|
| 查看次数: |
4573 次 |
| 最近记录: |