【问题标题】:gcloud app deploy is asking for a 'storage' attributegcloud app deploy 要求“存储”属性
【发布时间】:2019-02-27 02:05:49
【问题描述】:

我正在尝试部署一个 Node.js 应用,仅在 app.yaml 文件中指定绝对最小值:

runtime: nodejs8

gcloud 给了我这个:

MaxRetrialsException: last_result=(None, (<type 'exceptions.AttributeError'>, AttributeError("'_Sections' object has no attribute 'storage'",), <traceback object at 0x106eca488>)), last_retrial=3, time_passed_ms=67,time_to_wait=0

我发现没有相关参考提到storage 属性,MaxRetrials 听起来像是网络问题,所以不知道从哪里开始。

gcloud 版本(未安装其他组件):

Google Cloud SDK 217.0.0
bq 2.0.34
core 2018.09.17
gsutil 4.34

这是我的package.json

{
  "name": "parrot-skill",
  "description": "Parrot skill",
  "version": "0.0.1",
  "private": true,
  "license": "MIT",
  "author": "Pirim",
  "engines": {
    "node": ">=6.9.1"
  },
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "^4.16.3"
  }
}

【问题讨论】:

    标签: node.js google-cloud-platform gcloud


    【解决方案1】:

    您是否创建了一个谷歌存储桶来上传与部署相关的文件?

    https://cloud.google.com/storage/docs/creating-buckets

    一旦有了存储桶,您就可以在运行 gcloud deploy 时使用标志 --bucket 指定它。如果未指定此参数,则使用应用程序的默认代码桶。

    参考:

    https://cloud.google.com/sdk/gcloud/reference/app/deploy

    【讨论】:

    • 我当然没有,谁甚至会阅读那些讨厌的先决条件。谢谢!
    【解决方案2】:

    看起来它没有找到存储依赖项。您可以尝试使用 package.json 文件中包含的 Cloud Storage 依赖项进行部署,如 this doc 所示?

    "dependencies": {
    "@google-cloud/storage": "1.6.0",
    

    【讨论】:

      猜你喜欢
      • 2017-01-09
      • 1970-01-01
      • 2020-12-29
      • 2021-03-26
      • 2021-04-27
      • 2015-08-28
      • 2020-09-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多