简体   繁体   English

将 NodeJS 应用程序部署到 Google Cloud App Engine 问题

[英]Deploying NodeJS application to Google Cloud App Engine Troubles

I have a standard environment NodeJS application deployed on Google Cloud App Engine.我在 Google Cloud App Engine 上部署了一个标准环境 NodeJS 应用程序。 The app was first deployed in Nov 2019. I'm now trying to update the code, but I'm no longer able to deploy via $ gcloud app deploy该应用程序于 2019 年 11 月首次部署。我现在正在尝试更新代码,但我不再能够通过$ gcloud app deploy进行部署

  • I've tried using the online console at https://console.cloud.google.com/appengine/quotadetails?cloudshell=true as well as the stand alone downloaded console tooling.我尝试使用https://console.cloud.google.com/appengine/quotadetails?cloudshell=true的在线控制台以及独立下载的控制台工具。 Both fail.两者都失败了。
  • The application works fine on localhost.该应用程序在 localhost 上运行良好。 It communicates with the online data storage just fine.它与在线数据存储通信得很好。
  • I've tried using $ gcloud app deploy --verbosity=debug It's not much help.我试过使用$ gcloud app deploy --verbosity=debug没有多大帮助。
  • I've verified the login's and accounting information, thru the Google Cloud console in the browser.我已经通过浏览器中的 Google Cloud 控制台验证了登录信息和会计信息。 At first three glances everything seems whole.乍一看,一切似乎都是完整的。

Current Error messages: ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build f3780207-1c95-4b88-8ae0-574fc6ad515b status: FAILURE Build error details: {"error":{"errorType":"BuildError","canonicalCode":"INVALID_ARGUMENT","errorId":"51A062A0","errorMessage":"INFO FTL version node-v0.17.0\nINFO Beginning FTL build for node\nINFO FTL arg passed: exposed_ports None\nINFO... lots of info removed here...当前错误消息: ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build f3780207-1c95-4b88-8ae0-574fc6ad515b status: FAILURE Build error details: {"error":{"errorType":"BuildError","canonicalCode":"INVALID_ARGUMENT","errorId":"51A062A0","errorMessage":"INFO FTL version node-v0.17.0\nINFO Beginning FTL build for node\nINFO FTL arg passed: exposed_ports None\nINFO...这里删除了很多信息...

Two errors on the build log:构建日志上有两个错误:

Step #1 - "builder": containerregistry.client.v2_2.docker_http_.V2DiagnosticException: response: {'status': '403', 'content-length': '288', 'x-xss-protection': '0', 'transfer-encoding': 'chunked', 'server': 'Docker Registry', '-content-encoding': 'gzip', 'docker-distribution-api-version': 'registry/2.0', 'cache-control': 'private', 'date': 'Tue, 04 Aug 2020 18:30:12 GMT', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json'}

Step #1 - "builder": Permission denied for "1dc7fa0ed97dedf2b18a5fa82c4847e36cdade4e1d65e024bfb78aacd0cc1a3d" from request "/v2/ccinema-app/app-engine-tmp/build-cache/ttl-7d/node-cache/manifests/1dc7fa0ed97dedf2b18a5fa82c4847e36cdade4e1d65e024bfb78aacd0cc1a3d". : None

app.yaml file: app.yaml 文件:

# [START runtime]
runtime: nodejs10
# [END runtime]

instance_class: F2
automatic_scaling:
  max_instances: 2
  target_cpu_utilization: 0.7   

# https://hackernoon.com/trials-and-tribulations-of-google-cloud-hosting-a-tutorial-26395eb25636
service: default

# https://cloud.google.com/appengine/docs/standard/nodejs/serving-static-files
handlers:
  # - url: /favicon\.ico
  #   static_files: favicon.ico

  - url: /images
    static_dir: public/images
  - url: /javascript
    static_dir: public/javascript
  - url: /stylesheets
    static_dir: public/stylesheets

  - url: /.*
    secure: always
    redirect_http_response_code: 301
    script: auto

Its not at all clear to me on why the app deploy fails now when it worked so well in the past.我完全不清楚为什么应用程序部署在过去运行良好时现在失败了。 Any ideas on why the deployment failure?关于为什么部署失败的任何想法? Note, is there a way to attach the build log / error log as attachments to this posting?请注意,有没有办法将构建日志/错误日志作为附件附加到此帖子?


Edit...编辑...

I've been spending a whole lot of time trying to figure this issue out.我一直在花费大量时间试图解决这个问题。 I thought I'd try a simple cloned site.我想我会尝试一个简单的克隆网站。 Same exact node content from my repo, but instead pull a brand new project with a new app engine deployment.与我的 repo 中完全相同的节点内容,而是使用新的应用程序引擎部署拉出一个全新的项目。 I can't tell if the above issue is a deployment issue or a code related issue.我无法判断上述问题是部署问题还是与代码相关的问题。 If I could create a new project perhaps I could troubleshoot why my current project fails to deploy.如果我可以创建一个新项目,也许我可以解决我当前项目无法部署的原因。

  • Create a new project.创建一个新项目。
  • $ gcloud app deploy
  • Updating service [default]...failed. ERROR: (gcloud.app.deploy) Error Response: [7] Access Not Configured. Cloud Build has not been used in project my-project-xxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbuild.googleapis.com/overview?project=my-project-xxx then retry.
  • I go to the link listed, and after clicking a series of links I get to here , and I see "Billing Account is Closed"我 go 到列出的链接,单击一系列链接后我到达这里,我看到“结算帐户已关闭”
  • Its not clear on why the account is closed.目前尚不清楚帐户关闭的原因。
  • Google search shows me "Reopen a closed Cloud Billing account". Google 搜索显示“重新打开已关闭的 Cloud Billing 帐户”。 I follow the instructions there and I'm missing a "REOPEN BILLING ACCOUNT button".我按照那里的说明进行操作,但我缺少“重新打开帐单帐户”按钮。 There are possible reasons for that, including unresolved payments, suspensions etc... In my case, we have none of that.这有可能的原因,包括未解决的付款、暂停等……就我而言,我们没有这些。 No unresolved bills, credit cards on record are still valid, not expired.没有未解决的账单,记录在案的信用卡仍然有效,未过期。 I just can't figure this out.我就是想不通。
  • What makes this worse is my inability to ask for help from Google on billing issues.更糟糕的是,我无法就计费问题向 Google 寻求帮助。 When I go to?当我 go 到? (help) --> Contact Billing Support I get a "Sorry, this page can't be found" response. (帮助)-->联系计费支持我收到“抱歉,找不到此页面”响应。
  • Er, wait is Google telling me I should be using Amazon Web Services or Microsoft Azure instead of Google Cloud?呃,等等,谷歌告诉我我应该使用亚马逊 Web 服务或微软 Azure 而不是谷歌云? I wasted a heck of a lot of time trying to figure this out via obscure error messages, and the AWS / Azure message comes thru quite clearly.我浪费了很多时间试图通过模糊的错误消息来解决这个问题,而 AWS / Azure 消息非常清楚地通过。 Normally the folks at Google are much better than that.通常谷歌的人比这要好得多。

So it turns out the billing account tied to this project was closed even thought the credit card on record was still valid.因此,即使记录在案的信用卡仍然有效,与该项目相关的计费帐户也已关闭。 The error messages for $ gcloud app deploy when there is a billing account problem don't remotely direct the user to the actual issue.当存在计费帐户问题时, $ gcloud app deploy的错误消息不会将用户远程引导至实际问题。

I'd much prefer to see an error message like Oops, the account appears to be closed.我更希望看到类似糟糕的错误消息,该帐户似乎已关闭。 Please check billing details... .请检查账单明细...... Keep it simple, make it accurate.保持简单,使其准确。 And I can't believe I'm the first person to be here.我不敢相信我是第一个来到这里的人。

I did pull a bug report at Google Issue Tracker.我确实在 Google 问题跟踪器上提取了一个错误报告。 Lets see where that goes?让我们看看它去哪儿了?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM